Monitor Consul Cluster With Azure Monitor
I am successfully using Azure Monitor container insights Prometheus integration to monitor services deployed on our Azure Kubernetes Service (AKS) instances (e.g. RabbitMQ) and I want to monitor our Hashicorp Consul cluster in the same manner.
ref:
https://zcusa.951200.xyz/en-us/azure/azure-monitor/insights/container-insights-prometheus-integration
I have added annotations to the pod in the same way as working other k8s services, but I am not seeing the data get scraped.
"prometheus.io/scrape": "true"
"prometheus.io/port": "80"
"prometheus.io/path": "/v1/agent/metrics?format=prometheus"
The metrics are being exposed on the path and port specified and I can access them fine manually via the external IP. I have configured the config map to read the annotations and other services are correctly getting their metrics scraped.
Using native Prometheus monitoring, I would use the base URL "/v1/agent/metrics" and have to add a?format=prometheus URL parameter in the YAML config as a parameter.
Do I need add a something similar here with Azure Monitor? There is nothing I can find in the current documentation.
Consul requires the passing of this URL parameter to expose Prometheus style metrics.
Looking through the logs in the OMS we can see errors due to the URL encoding the URL parameter, which is not returning metrics.
2020-08-10T15:04:00Z E! [inputs.prometheus]: Error in plugin: error making HTTP request to http://10.x.x.x:80/v1/agent/metrics%3Fformat=prometheus: Get http://10.x.x.x:80/v1/agent/metrics%3Fformat=prometheus: dial tcp 10.x.x.x:80: getsockopt: connection refused