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

[receiver/prometheus] feat: implement Prometheus API #32646

Closed
wants to merge 6 commits into from

Conversation

gracewehner
Copy link
Contributor

Description:
Add Prometheus API as an extension for debugging purposes to be able to see the targets, config, and service discovery for what the prometheus receiver is scraping. This uses the Prometheus API packages in order to duplicate less code. It follows the same design to host the server as the Prometheus UI web handler.

Link to tracking Issue:
Issue: open-telemetry/prometheus-interoperability-spec#63
Relevant PR discussions:

Testing:
Ran an otelcollector with prometheusreceiver and extension.
Added tests to ensure all expected paths in the API are working and all go routines are cleaned up

Documentation:
Added to READMEs for extension and prometheusreceiver

Verified

This commit was signed with the committer’s verified signature.
metcoder95 Carlos Fuentes

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@gracewehner
Copy link
Contributor Author

Thanks @Aneurysm9 and @dashpole, I have made the changes we discussed. Please let me know if I should revert this back to all being inside the prometheus receiver.

This PR is also dependent on prometheus/prometheus#13932 to be merged first.

@dashpole
Copy link
Contributor

dashpole commented May 8, 2024

Please let me know if I should revert this back to all being inside the prometheus receiver.

I think that is what we had decided in the last meeting, right?

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label May 23, 2024
@dashpole dashpole removed the Stale label May 23, 2024
@dashpole
Copy link
Contributor

Looks like the promethues PR linked above was merged. Do we need to wait for a release of prometheus/prometheus?

Copy link
Contributor

github-actions bot commented Jun 7, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 7, 2024
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Jun 22, 2024
@gracewehner gracewehner changed the title [extension/prometheusapiserverextension] feat: implement Prometheus API extension [receiver/prometheus] feat: implement Prometheus API Jul 2, 2024
atoulme pushed a commit that referenced this pull request Mar 12, 2025
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
This is a new PR instead of this one:
#32646
which has more relevant discussion.
This PR adds the Prometheus API server as part of the Prometheus
receiver if enabled through the receiver config.
It supports calling the `/config`, `/targets`, `/targets/metadata`,
`/scrape_pools`, and `/metrics` paths for more debugging information
about the underlying Prometheus scrape manager and discovery manager.

**Link to tracking Issue:** <Issue number if applicable>
open-telemetry/prometheus-interoperability-spec#63

**Testing:** 
Added tests for the prometheus receiver configuration, for each path
that the API supports, and for the server shutting down correctly. Also
tested out with running the opentelemetry-collector agent with the
prometheus receiver.


**Documentation:** 
Added to the prometheus receiver README about how to configure the
setting.

---------

Co-authored-by: David Ashpole <dashpole@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
receiver/prometheus Prometheus receiver Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants