Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 3.54 KB

migrating-from-prometheus-exec-to-prometheus.md

File metadata and controls

39 lines (27 loc) · 3.54 KB

Removal of deprecated prometheusexec receiever

Why is this happening?

There exist security concerns using the promethusexec receiver. All prometheus specific functionality should be supported in the "normal" prometheus (scraping) receiver, along with others.

If I'm using the prometheusexec receiver, what should I do?

We recommend you migrate your configuration to use the prometheus opentelemetry receiver.

Natively your metrics for scraping

The exact method of your migration will depend on why you needed to use the prometheus_exec scraper in the first place.

Prometheus exporters

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 reccomend checking to see if there is a native open-telemetry collector receiver in core, contrib, or our splunk distribution.

If no equivalent reciever 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.

Non-standard usage

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.

Moving configuration to the prometheus receiver

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.