In Prometheus with blackbox exporter I have managed to configure 10+ URL for application availability, All of them are identified via their URL some of them are longer than the example shown below So Instead of display URL as an instance name how can I specify each with unique label.
For example
static_configs:
- targets:
- https://www.google.co.in/ # called as GoogleIndia
- https://www.google.co.uk/ # called as GoogleUK
- https://www.google.fr/ # called as GoogleFrance
Install [prometheus-node-exporter] package that includes function to get general resource on the System like CPU or Memory usage on the Node you'd like to add. Add setting on Prometheus Server Config. Access to the Prometheus Web UI and click [Status] - [Targets] to verify new nodes are listed.
The Prometheus Blackbox exporter allows endpoints exploration over several protocols, such as HTTP(S), DNS, TCP, and ICMP. This exporter generates multiple metrics on your configured targets, like general endpoint status, response time, redirect information, or certificate expiration dates.
To install a blackbox exporter dashboard: https://grafana.com/dashboards/7587, create a new dashboard, select import, provide the ID: 7587 , select the prometheus datasource and select save.
You can use metric_relabel_configs
to construct an instance
(or completely new) label based on the instance name you specified, as described in this blog post.
Or you can specify your targets like this, assigning them arbitrary labels in the process:
static_configs:
- targets: ['https://www.google.co.in/']
labels:
name: `GoogleIndia`
- targets: ['https://www.google.co.uk/']
labels:
name: `GoogleUK`
- targets: ['https://www.google.fr/']
labels:
name: `GoogleFrance`
It's more verbose, but also easier to understand and more powerful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With