Azure monitor Containers and prometheus integration 401 Unauthorized

Burningfish 1 Reputation point
2021-04-06T07:23:56.857+00:00

Hi, team

I am setting up monitoring and alert system for my applications using prometheus.

In reference to below MSDN documentation . Executed steps document in the reference which needs more details.

https://learn.microsoft.com/en-us/azure/azure-monitor/insights/container-insights-prometheus-integration

I have AKS cluster with application deployed. It requires basic auth to access metrics, e.g. http://user@Patrick @10.240.1.78:8001/wls-exporter/metrics

I configured prometheus with basic auth, following https://prometheus.io/docs/guides/basic-auth/, like:

basic_auth:  
    username: user  
    password: secret  

Prometheus can scrape the metrics from the application.

I used the YAML file from https://aka.ms/container-azm-ms-agentconfig to integrate metrics from Prometheus to Azure Monitoring.

I tried url "http://user@Patrick @10.240.1.78:8001/wls-exporter/metrics" and "http://10.240.1.78:8001/wls-exporter/metrics". Both case got 401 Unauthorized error.

Error in plugin: http://10.240.1.78:8001/wls-exporter/metrics returned HTTP status 401 Unauthorized

How to set the basic auth?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,798 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,854 questions
{count} votes