RobustPerception / azure_metrics_exporter

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

Runtime error while running #97

Open sourabhtk37 opened 3 years ago

sourabhtk37 commented 3 years ago

Hello,

I am facing issues while trying to run the exporter, I am wondering If I have missed some necessary pre-requisites or configuration changes:

$ ./azure_metrics_exporter --config.file="azure.yml"
2021/01/12 04:53:14 Using managed identity
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x827dd5]

goroutine 1 [running]:
main.(*AzureClient).getAccessToken(0xc0000662c0, 0x0, 0x0)
    /home/tsourab/go/src/github.com/RobustPerception/azure_metrics_exporter/azure.go:224 +0x355
main.main()
    /home/tsourab/go/src/github.com/RobustPerception/azure_metrics_exporter/main.go:321 +0xdf

azure.yml

---
active_directory_authority_url: "https://login.microsoftonline.com/"
resource_manager_url: "https://management.azure.com/"
credentials:
  subscription_id: "<subscription ID here>" 

resource_groups:
  - resource_group: "tsourab-metric"
    resource_types:
      - "Microsoft.Compute/virtualMachines"
    resource_name_include_re:
      - "metrics"
    metrics:
      - name: "CPU Credits Consumed"

OS: Fedora 33 Kernel: 5.8.15-301.fc33.x86_64 Go version: go version go1.15.6 linux/amd64

brian-brazil commented 3 years ago

That doesn't look possible, NewAzureClient can never return nil.