Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Metrics without a timeseries are not reported #1369

Merged
merged 5 commits into from
Nov 22, 2020

Conversation

tomkerkhove
Copy link
Owner

fix: Metrics without a timeseries are not reported with the metricSinks.prometheusScrapingEndpoint.metricUnavailableValue

Fixes #1197

Before:

# HELP azure_event_hubs_incoming_messages_discovery The number of incoming messages on an Azure Event Hub namespace
# TYPE azure_event_hubs_incoming_messages_discovery gauge
azure_event_hubs_incoming_messages_discovery{resource_group="promitor-sources",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/promitor-sources/providers/Microsoft.EventHub/namespaces/promitor-streaming",instance_name="promitor-streaming",entity_name="topic-1"} 1 1606049042395

For the other dimension that does not have a value triggered an exception:

[12:44:02 FTL] Failed to scrape resource for metric 'azure_event_hubs_incoming_messages_discovery'
Promitor.Integrations.AzureMonitor.Exceptions.MetricInformationNotFoundException: No metric information was found for 'IncomingMessages'. Reason: 'No time series was found'
at Promitor.Integrations.AzureMonitor.AzureMonitorClient.QueryMetricAsync(String metricName, String metricDimension, AggregationType aggregationType, TimeSpan aggregationInterval, String resourceId, String metricFilter) in C:\Code\GitHub\promitor\src\Promitor.Integrations.AzureMonitor\AzureMonitorClient.cs:line 88
at Promitor.Core.Scraping.AzureMonitorScraper1.ScrapeResourceAsync(String subscriptionId, ScrapeDefinition1 scrapeDefinition, TResourceDefinition resourceDefinition, AggregationType aggregationType, TimeSpan aggregationInterval) in C:\Code\GitHub\promitor\src\Promitor.Core.Scraping\AzureMonitorScraper.cs:line 46
at Promitor.Core.Scraping.Scraper1.ScrapeAsync(ScrapeDefinition1 scrapeDefinition) in C:\Code\GitHub\promitor\src\Promitor.Core.Scraping\Scraper.cs:line 69

After:

# HELP azure_event_hubs_incoming_messages_discovery The number of incoming messages on an Azure Event Hub namespace
# TYPE azure_event_hubs_incoming_messages_discovery gauge
azure_event_hubs_incoming_messages_discovery{resource_group="dapr-actors",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/dapr-actors/providers/Microsoft.EventHub/namespaces/dapr-actors",instance_name="dapr-actors",entity_name="unknown"} -1 1606048322048
azure_event_hubs_incoming_messages_discovery{resource_group="promitor-sources",subscription_id="0f9d7fea-99e8-4768-8672-06a28514f77e",resource_uri="subscriptions/0f9d7fea-99e8-4768-8672-06a28514f77e/resourceGroups/promitor-sources/providers/Microsoft.EventHub/namespaces/promitor-streaming",instance_name="promitor-streaming",entity_name="topic-1"} 1 1606048322133

…nks.prometheusScrapingEndpoint.metricUnavailableValue`
Signed-off-by: Tom Kerkhove <[email protected]>
Signed-off-by: Tom Kerkhove <[email protected]>
Signed-off-by: Tom Kerkhove <[email protected]>
@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label Nov 22, 2020
@promitor-bot
Copy link

Docker image for this PR was built and is available on Docker Hub.

You can pull it locally via the CLI:

docker pull tomkerkhove/promitor-agent-scraper-ci:pr1369-linux

Want to verify the new version? Run it locally:

docker run -d -p 8999:80 --name promitor-agent-scraper-pr1369-linux \
                         --env PROMITOR_AUTH_APPID='<azure-ad-app-id>' \
                         --env-file C:/Promitor/az-mon-auth.creds \
                         --volume C:/Promitor/metrics-declaration.yaml:/config/metrics-declaration.yaml  \
                         --volume C:/Promitor/runtime-config.yaml:/config/runtime.yaml \
                         tomkerkhove/promitor-agent-scraper-ci:pr1369-linux

You can find a CI version of our Helm chart on hub.helm.sh

@tomkerkhove tomkerkhove merged commit 009b1db into master Nov 22, 2020
@tomkerkhove tomkerkhove deleted the metrics-without-timeseries branch November 22, 2020 13:05
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed 🔍 Ready for Review Pull Request is not reviewed yet labels Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
2 participants