Hello,
I have Metricbeat 8.9.0 pod trying to scrape Prometheus metrics using this config
- module: prometheus
hosts: ["https://prometheus.demo.svc:9090"]
ssl.enabled: true
ssl.certificate: "/tmp/tls.crt"
ssl.key: "/tmp/tls.key"
ssl.certificate_authorities: ["/tmp/root/ca.pem"]
The Prometheus server is using mTLS.
Metricbeat fails to connect & got this error on log
{\n \"message\": \"unable to fetch data from prometheus endpoint https://prometheus.demo.svc:9090/api/v1/query?query=increase%28data_service_notifications_sent_total%5B90s%5D%29: error making http request: Get \\\"https://prometheus.demo.svc:9090/api/v1/query?query=increase%28data_service_notifications_sent_total%5B90s%5D%29\\\": remote error: tls: certificate required\"\n }\n}","service.name":"metricbeat","ecs.version":"1.6.0"}
I can confirm that Prometheus server is working fine as I have other app that can connect to it without issue.
I can also confirm that Prometheus server not receiving certificate because on its log I can see tls: client didn't provide a certificate
.
If its invalid certificate on log it will say tls: bad certificate
.
Am I missing something?
Thanks