azure-metrics-exporter
azure-metrics-exporter copied to clipboard
Unable to fetch Azure metrics
I am using Azure metrics exporter for fetching azure metrics but I am unable to get my virtual machine metrics while running below config file.
./azure-metrics-exporter sample_vm.yml --log.debug
this is my config file
- job_name: azure-metrics-compute
scrape_interval: 1m
metrics_path: /metrics
params:
name: ["azure_metric_compute"]
subscription:
- xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
filter: ["Microsoft.Compute/virtualMachines"]
metric:
- CPU Credits Consumed
- CPU Credits Remaining
interval: ["PT15M"]
timespan: ["PT15M"]
aggregation:
- average
static_configs:
- targets: ["localhost:8080"]
And i exported my client_id , secret_id, tenant_id.
sample screenshot
Kindly help me to resolve this one, Thanks.
@Vishnupriya9943 If I'm not mistaken the utility doesn't expect a file as input parameter. Your sample_vm.yml is designed for a Prometheus instance where you define an external source of metrics.
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#static_config
Also your metrics_path is probably not what you want. /metrics context is default prometheus golang metrics which is confirmed by your screenshot with localhost:8080/metrics
Try to get
curl "http://localhost:8080/probe/metrics?subscription=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&resourceType=Microsoft.Compute/virtualMachines&metric=xxxxxxx"