Prometheusexec Receiver
Overview
| Status | |
|---|---|
| Stability | deprecated |
| Supported pipeline types | metrics |
| Distributions | none |
prometheus_exec will take care of starting the
specified binaries with their equivalent Prometheus receiver. This receiver
also supports starting binaries with flags and environment variables,
retrying them with exponential backoff if they crash, string templating, and
random port assignments.
:information_source: If you do not need to spawn the binaries locally, please consider using the core Prometheus receiver or the Simple Prometheus receiver.
Configuration
For eachprometheus_exec defined in the configuration file, the specified
command will be run. The command should start a binary that exposes
Prometheus metrics and an equivalent Prometheus receiver will be instantiated
to scrape its metrics, if configured correctly.
The full list of settings exposed for this receiver are documented here
with detailed sample configurations here.
The following settings are required:
exec(no default): The string of the command to be run, with any flags needed. The format should be:directory/binary_to_run flag1 flag2.
env(no default): To use environment variables, under theenvkey should be a list of key (name) - value (value) pairs. They are case-sensitive. When running a command, these environment variables are added to the pre-existing environment variables the Collector is currently running with.scrape_interval(default =60s): How long the delay between scrapes done by the receiver is.port(no default): A number indicating the port the receiver should be scraping the binary’s metrics from.
port:
- If it is omitted, we will try to randomly generate a port for you, and retry until we find one that is free. Beware when using this, since you also need to indicate your binary to listen on that same port with the use of a flag and string templating inside the command, which is covered in 2.
-
All instances of
{{port}}in any string of any key for the enclosingprometheus_execwill be replaced with either the port value indicated or the randomly generated one if no port value is set with theportkey. String templating of{{port}}is supported inexec,custom_nameandenv.
Configuration
Example Configuration
Last generated: 2026-04-14