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

Unable to fetch Azure metrics #82

Open
Vishnupriya9943 opened this issue Mar 19, 2024 · 1 comment
Open

Unable to fetch Azure metrics #82

Vishnupriya9943 opened this issue Mar 19, 2024 · 1 comment

Comments

@Vishnupriya9943
Copy link

Vishnupriya9943 commented Mar 19, 2024

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
azure_metrics_exporter

Screenshot from 2024-03-19 18-14-56

Kindly help me to resolve this one,
Thanks.

@Neurobion
Copy link

Neurobion commented Mar 21, 2024

@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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants