-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
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. |
I think that is what we had decided in the last meeting, right? |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Looks like the promethues PR linked above was merged. Do we need to wait for a release of prometheus/prometheus? |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
**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>
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