Skip to content

Commit

Permalink
go back
Browse files Browse the repository at this point in the history
  • Loading branch information
hkfgo committed Sep 18, 2024
1 parent 124acbc commit c5fd2be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Promitor.Core.Scraping/AzureMonitorScraper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected override async Task<List<ScrapeResult>> BatchScrapeResourceAsync(strin
subscriptionId: scrapeDefinition.SubscriptionId,
resourceName: scrapeDefinition.Resource.ResourceName
); // the resource definition attached is missing some attributes, filling them in here
Logger.LogWarning("Caching resource group {Group}, resource name {ResourceName}, subscription ID {SubscriptionID}, resource group {ResourceGroup}, for {ResourceId}", resourceDefinitionToCache.ResourceGroupName, resourceDefinitionToCache.ResourceName, resourceDefinitionToCache.SubscriptionId, resourceDefinitionToCache.ResourceGroupName, resourceUri);
Logger.LogWarning("Caching resource group {Group}, resource name {ResourceName}, subscription ID {SubscriptionID}, resource group {ResourceGroup}, for {ResourceId}", resourceDefinitionToCache.ResourceGroupName, resourceDefinitionToCache.ResourceName, resourceDefinitionToCache.SubscriptionId, resourceDefinitionToCache, resourceUri);
_resourceDefinitions.TryAdd(resourceUri, resourceDefinitionToCache);
}
}
Expand Down Expand Up @@ -143,9 +143,9 @@ protected override async Task<List<ScrapeResult>> BatchScrapeResourceAsync(strin
{
var resourceId = resourceMetricsGroup.Key;
_resourceDefinitions.TryGetValue(resourceId, out IAzureResourceDefinition resourceDefinition);
var metricLabels = DetermineMetricLabels((TResourceDefinition) resourceDefinition);
var finalMetricValues = EnrichMeasuredMetrics((TResourceDefinition) resourceDefinition, dimensionNames, resourceMetricsGroup.ToImmutableList());
Logger.LogWarning("Processing {MetricsCount} measured metrics for Metric {MetricName}, resourceID {ResourceId} with name {ResourceName}, of resource group {ResourceGroup}", finalMetricValues.Count, metricName, resourceId, resourceDefinition.ResourceName, resourceDefinition.ResourceGroupName);
var metricLabels = DetermineMetricLabels((TResourceDefinition) batchScrapeDefinition.ScrapeDefinitions[0].Resource);
var finalMetricValues = EnrichMeasuredMetrics((TResourceDefinition) batchScrapeDefinition.ScrapeDefinitions[0].Resource, dimensionNames, resourceMetricsGroup.ToImmutableList());
Logger.LogWarning("Processing {MetricsCount} measured metrics for resourceID {ResourceId}", finalMetricValues.Count, metricName, resourceId, resourceDefinition.ResourceName, resourceDefinition.ResourceGroupName);
scrapeResults.Add(new ScrapeResult(subscriptionId, resourceDefinition.ResourceGroupName, resourceDefinition.ResourceName, resourceId, finalMetricValues, metricLabels));
Logger.LogWarning("Processed {MetricsCount} measured metrics for Metric {MetricName} and resource {ResourceName}", finalMetricValues.Count, metricName, resourceId);
}
Expand Down

0 comments on commit c5fd2be

Please sign in to comment.