-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for endpoints in httpcheckreceiver (#37265)
#### 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]>
- Loading branch information
1 parent
c4abcb9
commit 27cab50
Showing
5 changed files
with
228 additions
and
31 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.chloggen/add-multiple-endpoints-support-httpcheckreceiver.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Use this changelog template to create an entry for release notes. | ||
|
||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: httpcheckreceiver | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: "Added support for specifying multiple endpoints in the `httpcheckreceiver` using the `endpoints` field. Users can now monitor multiple URLs with a single configuration block, improving flexibility and reducing redundancy." | ||
|
||
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. | ||
issues: [37121] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters