Unable to scrape metrics from Azure monitor #2024
Replies: 3 comments
-
Here are the checks I would do to investigate this issue (following the docs http://docs.promitor.io/walkthrough/use-promitor-with-managed-identity) Be sure you have installed your AKS cluster using the managed identity option. Query the identity from the cluster:
If I remember well, you may have the managed identity item also in the AKS resource group (called MC_....) If you have created another managed identity (to respect the separation of concerns), be sure this identity has the "Monitor Reader" role assigned on your subscription / resource group
If you are using the system assigned identity, you can make the same check From your cluster, check that your AAD Pod identity is correctly configured
If you have correctly bind the AAD Pod Identity to your Managed Identity (System assigne or User Assigned) you should be able to use it.
If you CLI is launching correctly that means your AAD pod Identity is configured correctly and ready to use. Once you are sure everything is correctly configured on your AKS cluster, you can configure Promitor
|
Beta Was this translation helpful? Give feedback.
-
@Mimetis Thank you so much for clear instructions. I think the issue was with authentication mode. Based on the steps mentioned in your comment I tried the command "az login -i --debug" and found that the identity which I was using SystemAssignedManagedIdentity and not UserAssignedManagedIdentity. The application started scraping metrics from Azure monitor without any issues after changing the azureAuthentication mode to "SystemAssignedManagedIdentity". Thanks for your help. |
Beta Was this translation helpful? Give feedback.
-
Great to hear that helped. Would it help if this is a troubleshooting guide on docs.promitor.io @anoop2503? Thank you @Mimetis! |
Beta Was this translation helpful? Give feedback.
-
Discussed in #2011
Originally posted by anoop2503 April 21, 2022
Hi,
I could manage to set up the promitor application in kubernetes environment. The application is up and running without any issues. However, it does not scrape metrics from Azure monitor.
Here is the configuration for setting up the promitor scraper agent (without resourceDiscovery).
I can see there is some authentication failure logs in the container logs though. Here is the container logs:
Here are the metrics what promitor is exposing now:
What I understood from the container log is, the UserAssignedManagedIdentity authentication is failing when scraping metrics from azure monitor. But, I tried the same UserAssignedManagedIdentity as aadpodidbinding with azure_metrics_exporter and it returns the metrics without any issues. So, wondering if I have done any mistakes in the configurations side?
For authentication.identityId in runtime.yaml, I am using the same value what I am using for aadpodidbinding in deployment label section. I believe that is the correct configuration.
Please help.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions