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

Metric not found for Azure SQL Database #2541

Closed
thiDucTran opened this issue Aug 15, 2024 · 3 comments
Closed

Metric not found for Azure SQL Database #2541

thiDucTran opened this issue Aug 15, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@thiDucTran
Copy link

thiDucTran commented Aug 15, 2024

Report

From https://docs.promitor.io/v2.11/scraping/providers/sql-database/, "All supported metrics are documented in the official Azure Monitor documentation". AFAIK, the link https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/metrics-supported#microsoftsqlserversdatabases no longer exists... I am assuming the supported metrics new URL is https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-sql-servers-databases-metrics ?

Using https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-sql-servers-databases-metrics, I've tried scrape several metrics... like storage_percent ...they all have the same error similar to Promitor.Integrations.AzureMonitor.Exceptions.MetricNotFoundException: The metric 'storage_percent' was not found

detail logs

Promitor.Integrations.AzureMonitor.Exceptions.MetricNotFoundException: The metric 'storage_percent' was not found
   at Promitor.Integrations.AzureMonitor.AzureMonitorQueryClient.QueryMetricAsync(String metricName, List`1 metricDimensions, PromitorMetricAggregationType aggregationType, TimeSpan aggregationInterval, String resourceId, String metricFilter, Nullable`1 metricLimit) in /src/Promitor.Integrations.AzureMonitor/AzureMonitorQueryClient.cs:line 88
   at Promitor.Core.Scraping.AzureMonitorScraper`1.ScrapeResourceAsync(String subscriptionId, ScrapeDefinition`1 scrapeDefinition, TResourceDefinition resourceDefinition, PromitorMetricAggregationType aggregationType, TimeSpan aggregationInterval) in /src/Promitor.Core.Scraping/AzureMonitorScraper.cs:line 54
   at Promitor.Core.Scraping.Scraper`1.ScrapeAsync(ScrapeDefinition`1 scrapeDefinition) in /src/Promitor.Core.Scraping/Scraper.cs:line 80

my yaml file

version: v1
azureMetadata:
  tenantId: abc123
  subscriptionId: 123456
  resourceGroupName: promitor
  cloud: Global
metricDefaults:
  aggregation:
    interval: 00:05:00
  scraping:
    schedule: "*/5 * * * *"
metrics:
- name: azure_sql_storage_percent
  description: "Data space used percent"
  resourceType: SqlDatabase
  azureMetricConfiguration:
    metricName: storage_percent
    aggregation:
      type: Average
  resources:
  - serverName: foo
    databaseName: bar
    subscriptionId: 9876554321 # AFAIK, you can overwrite this. See https://github.com/promitor/docs/blob/main/docs/scraping/overview.md
    resourceGroupName: Default-SQL-EastUS # AFAIK, you can overwrite this. See https://github.com/promitor/docs/blob/main/docs/scraping/overview.md

Expected Behavior

Able to scrape metrics @ https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-sql-servers-databases-metrics

Actual Behavior

Error: The metric was not found

Steps to Reproduce the Problem

  1. Have an Azure Sql Server
  2. Create a DB in Server
  3. use metrics declaration yaml provided

Component

Scraper

Version

2.11.2

Configuration

Configuration:

version: v1
azureMetadata:
  tenantId: abc123
  subscriptionId: 123456
  resourceGroupName: promitor
  cloud: Global
metricDefaults:
  aggregation:
    interval: 00:05:00
  scraping:
    schedule: "*/5 * * * *"
metrics:
- name: azure_sql_storage_percent
  description: "Data space used percent"
  resourceType: SqlDatabase
  azureMetricConfiguration:
    metricName: storage_percent
    aggregation:
      type: Average
  resources:
  - serverName: foo
    databaseName: bar
    subscriptionId: 9876554321 # AFAIK, you can overwrite this. See https://github.com/promitor/docs/blob/main/docs/scraping/overview.md
    resourceGroupName: Default-SQL-EastUS # AFAIK, you can overwrite this. See https://github.com/promitor/docs/blob/main/docs/scraping/overview.md

Logs

Promitor.Integrations.AzureMonitor.Exceptions.MetricNotFoundException: The metric 'storage_percent' was not found
   at Promitor.Integrations.AzureMonitor.AzureMonitorQueryClient.QueryMetricAsync(String metricName, List`1 metricDimensions, PromitorMetricAggregationType aggregationType, TimeSpan aggregationInterval, String resourceId, String metricFilter, Nullable`1 metricLimit) in /src/Promitor.Integrations.AzureMonitor/AzureMonitorQueryClient.cs:line 88
   at Promitor.Core.Scraping.AzureMonitorScraper`1.ScrapeResourceAsync(String subscriptionId, ScrapeDefinition`1 scrapeDefinition, TResourceDefinition resourceDefinition, PromitorMetricAggregationType aggregationType, TimeSpan aggregationInterval) in /src/Promitor.Core.Scraping/AzureMonitorScraper.cs:line 54
   at Promitor.Core.Scraping.Scraper`1.ScrapeAsync(ScrapeDefinition`1 scrapeDefinition) in /src/Promitor.Core.Scraping/Scraper.cs:line 80

Platform

Microsoft Azure

Contact Details

No response

@thiDucTran thiDucTran added the bug Something isn't working label Aug 15, 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?

@tomkerkhove
Copy link
Owner

Similar to #2540; did you check if portal is reporting the metric? Maybe time window is too small

@thiDucTran
Copy link
Author

i'll close the issue...seems I did not wait long enough...metrics started to come in after few hours. sorry about this

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: Ready To Ship
Development

No branches or pull requests

2 participants