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

Timestamps in promitor-agent-resource-discovery metrics produces TargetDown alert in prometheus #2528

Open
schmidt-i opened this issue Jun 28, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@schmidt-i
Copy link

Report

Since some discovery jobs are scheduled, the metrics that they produce can be up to 1h in the past. All produced gauges by the promitor agend discovery have a timestamps on the metric included and this brings our prometheus instance into trouble since it reports "too old samples" during the scraping.

Expected Behavior

timestamps on gauges are optional and can be turned off like on the promitor-agent-scraper

Actual Behavior

Old timestamps are reported for each gauge metric: example:

Current time 17:49:
Extract from the metrics:

# HELP promitor_azure_landscape_resource_group_info Provides information concerning the Azure resource groups in the landscape that Promitor has access to.
# TYPE promitor_azure_landscape_resource_group_info gauge
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxx",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxx-rg",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxx",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxx-rg",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxx-rg",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxxrg",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxxressources",region="westeurope",provisioning_state="Succeeded",managed_by="/subscriptions/xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx/resourcegroups/xxxxaks-rg/providers/Microsoft.ContainerService/managedClusters/xxxxaks"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxxrg",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxxrg",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxxrg",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxx",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
promitor_azure_landscape_resource_group_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",resource_group_name="xxxxarg",region="westeurope",provisioning_state="Succeeded",managed_by="n/a"} 1 1719588601162
# HELP promitor_azure_landscape_subscription_info Provides information concerning the Azure subscriptions in the landscape that Promitor has access to.
# TYPE promitor_azure_landscape_subscription_info gauge
promitor_azure_landscape_subscription_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_name="YYYYYYYY-DEV",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",state="Enabled",spending_limit="Off",quota_id="EnterpriseAgreement_2014-09-01",authorization="n/a"} 1 1719586800463
promitor_azure_landscape_subscription_info{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",subscription_name="YYYYYYYY-PROD",subscription_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",state="Enabled",spending_limit="Off",quota_id="EnterpriseAgreement_2014-09-01",authorization="n/a"} 1 1719586800463
# HELP promitor_ratelimit_resource_graph_remaining Indication how many calls are still available before Azure Resource Graph is going to throttle us.
# TYPE promitor_ratelimit_resource_graph_remaining gauge
promitor_ratelimit_resource_graph_remaining{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",cloud="Global",auth_mode="UserAssignedManagedIdentity",app_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx"} 4 1719588909324
# HELP promitor_ratelimit_resource_graph_throttled Indication concerning Azure Resource Graph are being throttled. (1 = yes, 0 = no).
# TYPE promitor_ratelimit_resource_graph_throttled gauge
promitor_ratelimit_resource_graph_throttled{tenant_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx",cloud="Global",auth_mode="UserAssignedManagedIdentity",app_id="xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx"} 0 1719588909324

Steps to Reproduce the Problem

  1. Start promitor agent discovery
  2. look at the metrics endpoint - timestamps are reported on the gauges and can't be turned off

includeTimestamp is hard-coded to "true"

await _systemMetricsPublisher.WriteGaugeMeasurementAsync(metricName, metricDescription, value, labels, includeTimestamp: true);

Component

Resource Discovery

Version

0.8.0

Configuration

Configuration:

# Add your scraping configuration here

Logs

example

Platform

Microsoft Azure

Contact Details

No response

@schmidt-i schmidt-i added the bug Something isn't working label Jun 28, 2024
Copy link

Thank you for opening an issue! We rely on the community to maintain Promitor. (Learn more)

Is this something you want to contribute?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Proposed
Development

No branches or pull requests

2 participants