Skip to content

Commit

Permalink
chore: Verify if scrape definition is created correctly (#1381)
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Kerkhove <[email protected]>
  • Loading branch information
tomkerkhove authored Nov 26, 2020
1 parent 746622d commit 011c57c
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@ public MetricDefinition(PrometheusMetricDefinition prometheusMetricDefinition,
/// <returns>The scrape definition.</returns>
public ScrapeDefinition<IAzureResourceDefinition> CreateScrapeDefinition(IAzureResourceDefinition resource, AzureMetadata azureMetadata)
{
// TODO: Verify if this logic is valid as we always use defaults? 🤔
return new ScrapeDefinition<IAzureResourceDefinition>(
var subscriptionId = string.IsNullOrEmpty(resource.SubscriptionId) ? azureMetadata.SubscriptionId : resource.SubscriptionId;
var resourceGroupName = string.IsNullOrEmpty(resource.ResourceGroupName) ? azureMetadata.ResourceGroupName : resource.ResourceGroupName;

var output = new ScrapeDefinition<IAzureResourceDefinition>(
AzureMetricConfiguration,
PrometheusMetricDefinition,
Scraping,
resource,
string.IsNullOrEmpty(resource.SubscriptionId) ? azureMetadata.SubscriptionId : resource.SubscriptionId,
string.IsNullOrEmpty(resource.ResourceGroupName) ? azureMetadata.ResourceGroupName : resource.ResourceGroupName);
subscriptionId,
resourceGroupName);

return output;
}
}
}

0 comments on commit 011c57c

Please sign in to comment.