CoreDNS monitoring with stunnel
This article can be seen as a follow up to Monitor with SSH and Prometheus, but in a different, hopefully, more simple way.1
Now I want to monitor CoreDNS running as a DNS to HTTPS proxy in my home network.
In one word: stunnel. (I had to upgrade Raspbian to Debian Testing to get an up to date stunnel though.)
I’ve setup a simple TLS tunnel with a pre-shared-key between my prometheus server and the NATted Raspberry Pi running in my homenetwork.
The client config on the server; % more /etc/stunnel/coredns-monitor.conf
:
And on the client, the server config:
CoreDNS has been started with exporting the montioring, which by default happens on port 9153.
On my server a curl localhost:1149/metrics
now returns the metrics.
On the Prometheus side, this look like any other scraped job:
Marvel it this colorful dashboard, but again, I’m struggling to get to one qps:

-
I never go those ssh-tunnels to start reliably on boot. ↩︎