[exporter/prometheusremotewriteexporter] fix config key collision: un-squash client config (issue 37332) #37588
+141
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Prometheus remote write HTTP client config is squashed into the exporter config hence causing a collision for
timeout
key.This PR fixes the issue (#37332) by putting the HTTP config under its own key
prw_client
(unsquashed) in a backward-compatible manner.Link to tracking issue
Fixes #37332
Testing
New test:
Test_NewPRWExporter_ClientConfig
Additional case for test:
TestLoadConfig
Documentation
My intention is to put the HTTP client config under its own key
prw_client
such that:prw_client
config section is specified, it takes precedence over the squashed versionprw_client
are preserved in a single place: seesetDefaultsPRWClientConfig
function