Bleemeo agent could query a Prometheus exporter for custom metrics.
To configure Prometheus metrics, you just need to add the following to your Bleemeo
agent configuration (
- url: "http://localhost:8080/metrics"
- url: "file:///var/run/custom_file.txt"
- url: "http://localhost:8088/metrics"
Restart your agent to apply the new configuration.
As you can see, Bleemeo agent support fetching metrics from an HTTP server but also from a file. Reading from a file is useful if your application don't have an HTTP server or if you generate your metrics from a cron. The content of the file is the Prometheus text format, which is the same as HTTP exporter.
Remember that you need to allow the custom metrics you want using
allow_metrics. See Filtering page for more details.
If your application is running in Docker, you can use Docker labels to configure Bleemeo agent to gather your custom metrics. The following labels are known:
prometheus.io/scrape: if true, Bleemeo agent will gather metrics from this container. You probably need to set
prometheus.io/port: configure the port where your application export its Prometheus metrics. The default is 9201.
prometheus.io/path: configure the path where your application export its Prometheus metrics. The default is "/metrics".
glouton.allow_metrics: set the allowed list of metrics. It's a coma separated list. The default is the global allow-list from configuration file.
glouton.deny_metrics: set the denied list of metrics. It's a coma separated list. The default is the global deny-list from configuration file.
For example, running a container with the following labels:
docker run --label prometheus.io/scrape=true --label prometheus.io/port=8080 \
--label "glouton.allow_metrics=business_counter,application_prefix_*" \
--label "glouton.deny_metrics=application_prefix_ignore_me" \
Will configure Bleemeo agent to gather metrics on
business_counter and all metrics starting with
application_prefix_ignore_me which is denied.
The number of custom metrics is limited, so you should only send metrics that are important to you.