Skip to content

Commit

Permalink
fix: Exception thrown when metric is not found (#1546)
Browse files Browse the repository at this point in the history
* fix: Exception thrown when metric is not found

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Revert

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Update changelog

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>

* Align expectation with Azure subscription

Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
  • Loading branch information
tomkerkhove authored Mar 3, 2021
1 parent 24a52f4 commit 0f59ea8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions changelog/content/released/v2.1.1-scraper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
subtitle: "released on 2021-03-03"
date: 2021-03-03T10:38:47+02:00
weight: 211-scraper
version: Scraper - v2.1.1
---

- {{% tag fixed %}} Issue when metric (values) where not found causing exceptions to be thrown ([#1545](https://github.com/tomkerkhove/promitor/issues/1545))

Full release notes can be found [here](https://github.com/tomkerkhove/promitor/releases/tag/2.1.1-scraper).
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public async Task<List<MeasuredMetric>> QueryMetricAsync(string metricName, stri
var relevantMetric = await GetRelevantMetric(metricName, aggregationType, closestAggregationInterval, metricFilter, metricDimension, metricDefinition, startQueryingTime);
if (relevantMetric.Timeseries.Count < 1)
{
throw new MetricInformationNotFoundException(metricName,metricDimension, "No time series was found");
throw new MetricInformationNotFoundException(metricName,"No time series was found", metricDimension);
}

var measuredMetrics = new List<MeasuredMetric>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public async Task ResourceDiscovery_GetWithFilterOnOneSubscription_ReturnsExpect
{
// Arrange
const string resourceDiscoveryGroupName = "one-subscriptions-scenario";
const int expectedResourceCount = 2;
const int expectedResourceCount = 1;
var resourceDiscoveryClient = new ResourceDiscoveryClient(Configuration, Logger);

// Act
Expand Down

0 comments on commit 0f59ea8

Please sign in to comment.