webdevops / azure-metrics-exporter

Azure Monitor metrics exporter for Prometheus with dimension support, template engine and ServiceDiscovery
MIT License
124 stars 25 forks source link

Retrieve metrics from StorageAccount/Fileshares #52

Closed satare closed 1 year ago

satare commented 1 year ago

Hi, First : thanks for this product, i'm using it a lot in my monitoring strategy, it's a very cool addition. People come see me to monitor fileshares usage, so i made a prometheus scrape config for that but can't make it work.

In one of my subscriptions, i have 2 storage accounts, with somes fileshares in them. I can reach the metrics from the fileshare with this scrape config : (thanks again for the UI ... game changer)

scrape_configs:
  - job_name: azure-metrics-example
    scrape_interval: 1m
    metrics_path: /probe/metrics/resourcegraph
    params:
      name:
        - fs
      template:
        - '{name}_{metric}_{aggregation}_{unit}'
      help:
        - Azure metric {metric} for {aggregation}
      subscription:
        - 999-999-999-999-999999
      resourceType:
        - Microsoft.Storage/storageAccounts
      metric:
        - Availability
      interval:
        - PT1M
      timespan:
        - PT1M
      aggregation:
        - average
        - total
        - count
      metricTop:
        - 10
    static_configs:
      - targets:
          - url-to-your-azure-metrics-exporter-instance

But as soon as i add the

      metricNamespace:
        - Microsoft.Storage/storageAccounts/fileServices

to this scrape config, i get a HTTP200 from the azure exporter, but no results at all.

Is there something i do wrong ? I take the exemple from the last section of the readme.

Thanks in advance, if someone can help me.

mblaschke commented 1 year ago

Can you enable the debug mode and check if you get any issues there? and please use 23.6.0.

You get these metrics in Azure portal, right? You can always check how the Azure Monitor REST API is querying the metrics int he Azure portal when you use the browser developer console. AFAIK there is no real documentation from Azure how to use it, they only publish the metric names and this exporter is mostly just a Azure Monitor REST client.

satare commented 1 year ago

Hi Markus, Thanks for your reply. I did upgrade to the last release and it work now, as simple as that ^^

Anyway, i upgraded to 23.7.0 as the "subscriptionName" tag is a nice addition to our metrics labels, thanks for that too.