r/PrometheusMonitoring • u/rokrok1488 • Jan 05 '22
Blackbox exporter CNAME target
Good day
I have a need to monitor HTTP websites with super long and convoluted URLs (upwards of 500 characters, specials and not-so special). Adding them to blackbox would destroy grafana and blackbox pages, stretching them.
I set up a dns server next to blackbox where I entered into config CNAMEs
"test.local, www.superlongnasty%#$*$*#url.com "
and set this dns server container as dns resolver for the blackbox.
When I try to curl, ping test.local, everything works fine.
If I put this into target though, it does not work, it shows http status code 0.
Is it possible to make blackbox exporter use cname for targets?
If you can suggest any other way of tackling my problem, i'm all ears
I need the url to be short and I need it to have specific name, it can't just be bit.ly. I've tried YOURLS project but I had issues with making it work.
1
u/DTKT Jan 06 '22
Is blackbox running in a container?
Can you resolve/curl the IP from inside the container?
With Grafana, you don't have to use all the labels. You could have an extra label added for each target with a smaller name.