forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix prometheusreceiver TA/scrape_config validation logic (open-teleme…
…try#30181) This PR is a fork from open-telemetry#30135 where the author did not respond to the comments. I applied all suggestions because as a maintainer is my responsibility to ensure we fix bugs and merge PRs. Thanks @Aneurysm9 for the first commit. --------- Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com> Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com> Co-authored-by: Anthony J Mirabella <a9@aneurysm9.com>
- Loading branch information
Showing
4 changed files
with
69 additions
and
10 deletions.
There are no files selected for viewing
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,6 @@ | ||
change_type: 'bug_fix' | ||
component: 'prometheusreceiver' | ||
note: Fix configuration validation to allow specification of Target Allocator configuration without providing scrape configurations | ||
issues: [30135] | ||
subtext: | ||
change_logs: [] |
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
19 changes: 19 additions & 0 deletions
19
...ver/prometheusreceiver/testdata/invalid-config-prometheus-non-existent-scrape-config.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,19 @@ | ||
prometheus: | ||
prometheus/withConfigAndTA: | ||
target_allocator: | ||
endpoint: http://localhost:8080 | ||
interval: 30s | ||
collector_id: collector-1 | ||
config: | ||
global: | ||
scrape_interval: 30s | ||
prometheus/withOnlyTA: | ||
target_allocator: | ||
endpoint: http://localhost:8080 | ||
interval: 30s | ||
collector_id: collector-1 | ||
prometheus/withOnlyScrape: | ||
config: | ||
scrape_configs: | ||
- job_name: 'demo' | ||
scrape_interval: 5s |