grok_exporter
grok_exporter copied to clipboard
Is there a debug mode or log to troubleshoot the grok_exporter?
Hi,
I wonder if it exist a debug mode, or logfile for the grok_exporter which help us to troubleshoot any problem? Because currently I am facing an issue with the SSL and I have no clue why it doesn't work .
My grok_exporter is running under a POD, and the communication between the POD and prometheus work fine in HTTP, but failed when I switch to SSL with the following error message :
Starting server on https://cs-0:9144/metrics 2020/06/05 07:55:38 http: TLS handshake error from x.x.x.x:53912: remote error: tls: bad certificate 2020/06/05 07:55:38 http: TLS handshake error from x.x.x.x:54020: remote error: tls: bad certificate ...
I've configured properly the config.yml file, though:
server: protocol: https port: 9144 cert: /home/dmadmin/certs/cs-0.cs.server1.svc.cluster.local.csr key: /home/dmadmin/certs/cs-0.cs.server1.svc.cluster.local.key
Thanks for your help
grok_exporter doesn't have it's own implementation of an https server, it just passes the certFile and keyFile to Golang's ListenAndServeTLS function. There are no debug messages, but maybe the official documentation of ListenAndServeTLS helps:
ListenAndServeTLS acts identically to ListenAndServe, except that it expects HTTPS connections. Additionally, files containing a certificate and matching private key for the server must be provided. If the certificate is signed by a certificate authority, the certFile should be the concatenation of the server's certificate, any intermediates, and the CA's certificate.
If you want to isolate the issue, the ListenAndServeTLS documentation provides a very small example program for starting an https server on port 8443 locally. This should work exactly the same way as the https server in grok_exporter and may help you track down the root cause of your issue.