There exist security concerns using the prometheusexec receiver. All prometheus specific functionality should be supported in the "normal" prometheus (scraping) receiver, along with others.
We recommend you migrate your configuration to use the prometheus OpenTelemetry receiver.
The exact method of your migration will depend on why you needed to use the prometheus_exec
scraper in the first place.
The intended use case for the prometheus_exec
receiver was to leverage the rich existing community of prometheus exporters (not to be confused with the opentelemetry-collector-contrib prometheusexporter
). If this was your use case, we first recommend checking to see if there is a native open-telemetry collector receiver in core, contrib, or our splunk distribution.
If no equivalent receiver exists for a given prometheus exporter, or if you simply wish to continue using prometheus exporters, you will need to manually run the relevant prometheus exporter (list) on your own infrastructure. While the details of how you decide to deploy and manage your infrastructure is beyond the scope of this migration, we have provided an example configuration using the node exporter in examples/prometheusexec-migration
in this git repo.
If you needed to federate between a prometheus server and otel, you can enable federation on your prometheus server, you can see our prometheus-federation example under examples/prometheus-federation
in this git repository. Ensure your endpoint is accessible from your otel collector, and feel free to ask in the #otel-prometheus-wg, #otel-collector, or #prometheus slack channels for any help. You can also feel free to cut us an issue, or reach out to your support representative.
For more novel use cases such as running arbitrary code, this is no longer supported.
You may reuse the scrape_interval
and port
when migrating to the prometheus
opentelemetry receiver.
Assuming your endpoint is on localhost:8080
, your config may look something like this
receivers:
prometheus:
config:
scrape_configs:
- job_name: 'scrape-prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:8080']
For further configuration options, please see the documentation.