How to use azure_sd_configs to scrape azure VM's and VMSS's

21 views
Skip to first unread message

Kirti Ranjan Parida

unread,
Jun 30, 2020, 9:38:33 AM6/30/20
to Prometheus Users
I am trying to scrape VM's and VMSS's in azure using prometheus.For discovery I am using azure_sd_configs.Below is my configuration 

  - job_name: 'node_exporter'
    azure_sd_configs:
      - authentication_method: ManagedIdentity
        subscription_id: <subscriptionID>
        refresh_interval: 5m
        port: 9100

Do I have to mention anything ? 

I am getting below error 

level=warn ts=2020-06-30T08:13:55.895Z caller=klog.go:86 component=k8s_client_runtime func=Warningf msg="/app/discovery/kubernetes/kubernetes.go:261: watch of *v1.Endpoints ended with: too old resource version: 1291352 (1292845)"
level=error ts=2020-06-30T08:15:28.938Z caller=refresh.go:98 component="discovery manager scrape" discovery=azure msg="Unable to refresh target groups" err="could not get virtual machines: could not list virtual machines: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/<REMOVEDSUBSCRIPTION>/providers/Microsoft.Compute/virtualMachines?api-version=2018-10-01: StatusCode=404 -- Original Error: adal: Refresh request failed. Status Code = '404'. Response body: getting assigned identities for pod <PROMETHEUS POD NAME> in CREATED state failed after 16 attempts, retry duration [5]s. Error: <nil>\n"


Any help ? 
Reply all
Reply to author
Forward
0 new messages