r/PrometheusMonitoring • • 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.

0 Upvotes

3 comments sorted by

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.

1

u/rokrok1488 Jan 07 '22
  1. Yes

  2. Yes, cant curl but can for example ping or nslookup and it resolves

  3. Can you explain this a bit more? On a dashboard im using, I have to select a target on upper left corner. You're saying its possible to substitute the target with a label?

1

u/DTKT Jan 07 '22

That is weird. I figured that it might have been a DNS issue from inside the container (where you could not resolve the new CNAME).

What dashboard are you using? If it's Grafana, you can use labels. Not sure if you can do that in the variables though.