RobustPerception / azure_metrics_exporter

Azure metrics exporter for Prometheus
Apache License 2.0
133 stars 69 forks source link

I should be able to assign metrics per resource type when using resource groups #63

Open andrewmitchell21 opened 5 years ago

andrewmitchell21 commented 5 years ago

At present this module doesn't appear to support exporting different metrics for resource groups that have multiple resource Ids, for example, we should be able to to the following:

resource_groups:
  - resource_group: "test-rg"
    resource_types:
    - "Microsoft.Sql/servers/databases"
        metrics:
        - name: "storage_percent"
        - name: "cpu_percent"
        - name: "allocated_data_storage"
        - name: "workers_percent"
        - name: "physical_data_read_percent"
        - name: "log_write_percent"
        - name: "sessions_percent"
        - name: "xtp_storage_percent"
        - name: "storage"
        - name: "connection_successful"
        - name: "connection_failed"
        - name: "blocked_by_firewall"
        - name: "deadlock"
     - "Microsoft.Sql/servers/elasticPools"
        metrics
        -name "cpu_percent"

At the moment the config expects the following:

resource_groups:
  - resource_group: "test-rg"
    resource_types:
    - "Microsoft.Sql/servers/databases"
    - "Microsoft.Sql/servers/elasticPools"
    metrics:
     - name: "storage_percent"
     - name: "cpu_percent"
     - name: "allocated_data_storage"
     - name: "workers_percent"
     - name: "physical_data_read_percent"
     - name: "log_write_percent"
     - name: "sessions_percent"
     - name: "xtp_storage_percent"
     - name: "storage"
     - name: "connection_successful"
     - name: "connection_failed"
     - name: "blocked_by_firewall"
     - name: "deadlock"

resource types have different metrics, and this causes 400's

wanieldilson commented 3 years ago

Also having this issue

brian-brazil commented 3 years ago

What does the output for the respective metrics look like?

wanieldilson commented 3 years ago

I just get a tonne of 400 errors for metrics that don't exist for x resource type. But that seems to stop any valid metrics coming through also. Config below

resource_tags:
      - resource_tag_name: "prometheus"
        resource_tag_value: "tomonitor"
        resource_types:
          - "Microsoft.Network/loadbalancers"
          - "Microsoft.Network/virtualnetworkgateways"
          - "Microsoft.Compute/virtualMachines"
        metrics:
          - name: "CPU Credits Consumed"
          - name: "Percentage CPU"
          - name: "Inbound Flows"
          - name: "Outbound Flows"
          - name: "Network In Total"
          - name: "Network Out Total"
          - name: "OS Disk Queue Depth"
          - name: "Byte Count"
          - name: "Health Probe Status"
          - name: "Tunnel Ingress Bytes"
          - name: "Tunnel Egress Bytes"
          - name: "Tunnel Bandwidth" 
wanieldilson commented 3 years ago

Any idea where we can go from here?