-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Enhance httpcheckreceiver to Support Nested "endpoints" Under targets #37121
Labels
enhancement
New feature or request
needs triage
New item requiring triage
receiver/httpcheck
HTTP Check receiver
Comments
VenuEmmadi
added
enhancement
New feature or request
needs triage
New item requiring triage
labels
Jan 9, 2025
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hi @codeboten |
codeboten
pushed a commit
that referenced
this issue
Jan 24, 2025
#### Description This PR enhances the `httpcheckreceiver` by adding support for multiple endpoints (`endpoints`). Users can now specify a list of endpoints in addition to a single `endpoint` for each target. This improves flexibility and reduces redundancy when monitoring multiple similar endpoints. Additional changes include: - Updates to `config.go` to handle `endpoints`. - Updates to `scraper.go` to iterate over and scrape all specified endpoints. - Added unit tests for the new functionality in `config_test.go` and `scraper_test.go`. - Updated documentation (`README.md`) to reflect the changes. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to Tracking Issue Fixes #37121 <!-- Describe what testing was performed and which tests were added. --> #### Testing - All existing and new tests pass. - Tested the `httpcheckreceiver` manually using the following configuration: ```yaml receivers: httpcheck: collection_interval: 30s targets: - method: "GET" endpoints: - "https://opentelemetry.io" - method: "GET" endpoints: - "http://localhost:8080/hello" - "http://localhost:8080/hello" headers: Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqYXZhaW51c2UiLCJleHAiOjE3MzcwMzMzMTcsImlhdCI6MTczNzAxNTMxN30.qNb_hckvlqfWmnnaw2xP9ie2AKGO6ljzGxcMotoFZg3CwcYSTGu7VE6ERsvX_nHlcZOYZHgPc7_9WSBlCZ9M_w" - method: "GET" endpoint: "http://localhost:8080/hello" headers: Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqYXZhaW51c2UiLCJleHAiOjE3MzcwMzMzMTcsImlhdCI6MTczNzAxNTMxN30.qNb_hckvlqfWmnnaw2xP9ie2AKGO6ljzGxcMotoFZg3CwcYSTGu7VE6ERsvX_nHlcZOYZHgPc7_9WSBlCZ9M_w" processors: batch: send_batch_max_size: 1000 send_batch_size: 100 timeout: 10s exporters: debug: verbosity: detailed service: pipelines: metrics: receivers: [httpcheck] processors: [batch] exporters: [debug] ``` #### **Documentation** Describe any documentation changes or additions: ```markdown <!-- Describe the documentation added. --> #### Documentation - Updated the `README.md` to include examples for `endpoints`. - Verified `documentation.md` for metric output consistency. --------- Co-authored-by: Antoine Toulme <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
needs triage
New item requiring triage
receiver/httpcheck
HTTP Check receiver
Component(s)
receiver/httpcheck
Is your feature request related to a problem? Please describe.
We propose an enhancement to the httpcheckreceiver configuration to allow endpoints to be nested under targets. This change introduces flexibility for users by enabling the definition of multiple endpoints per target while maintaining support for a single endpoint.
Describe the solution you'd like
Proposed Changes
Describe alternatives you've considered
Code should support below "endpoints" list and method is common for all.
Additional context
I would like to take this task.
The text was updated successfully, but these errors were encountered: