Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do I need to install prometheus in my cluster in order to scrape metrics into Otel? #29301

Closed
mmoya91 opened this issue Nov 16, 2023 · 6 comments
Labels
question Further information is requested receiver/prometheus Prometheus receiver Stale

Comments

@mmoya91
Copy link

mmoya91 commented Nov 16, 2023

Hello, I have a python service that includes a prometheus client and /metrics endpoint for those metrics. That said, do I need to install prometheus in my cluster in order to scrape those metrics into the otel collector? I noticed documentation around setting up a prometheus receiver but not sure if that would involve standing up prometheus

@mmoya91 mmoya91 changed the title Do I need to install prometheus in my cluster? Do I need to install prometheus in my cluster in order to scrape metrics into Otel? Nov 16, 2023
@mx-psi mx-psi transferred this issue from open-telemetry/opentelemetry-collector Nov 16, 2023
@mx-psi mx-psi added question Further information is requested receiver/prometheus Prometheus receiver labels Nov 16, 2023
Copy link
Contributor

Pinging code owners for receiver/prometheus: @Aneurysm9 @dashpole. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@dashpole
Copy link
Contributor

No, you can just run the OpenTelemetry collector with the prometheus receiver if your goal is to scrape metrics from the application. But note that the OpenTelemetry collector is just for transforming and routing telemetry, not for storing telemetry. You still need to choose which backend to store telemetry in. The prometheus server (not the otel collector) scrapes and stores metrics.

@mmoya91
Copy link
Author

mmoya91 commented Nov 16, 2023

@dashpole thank you for your reply. We're ultimately looking to store metrics in datadog but some of our applications use prometheus metrics instead of fastapi metrics. For applications that use fastapi metrics, we're deploying Otel Collector as a sidecar. However, for services that use prometheus metrics, would we need to consider a StatefulSet as the deployment mode for the prometheus receiver or could we consider a sidecar deployment?

@dashpole
Copy link
Contributor

You can use the prometheus receiver in the collector as a sidecar without issues. You will want to use static_configs within the prometheus receiver configuration, e.g.

receivers:
    prometheus:
      config:
        scrape_configs:
          - job_name: 'otel-collector'
            scrape_interval: 5s
            static_configs:
              - targets: ['0.0.0.0:8888']

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Jan 16, 2024
@dashpole
Copy link
Contributor

Closing. If you still have questions, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested receiver/prometheus Prometheus receiver Stale
Projects
None yet
Development

No branches or pull requests

3 participants