Merge ES default values to Sourcmeap configuration. #3355
Merged
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.
Motivation/summary
When configuring an Elasticsearch instance for Sourcemap usage, Elasticsearch default values should be merged with the custom config, to avoid having to configure all settings.
At the moment default values are not merged as soon as any of the
apm-server.rum.source_mapping.elasticsearch.*
options is configured, which is unexpected behavior and not aligned with how other configuration options are merged with default values.This PR changes the behavior to use default options where no dedicated configuration option is provided.
Checklist
- [ ] I have signed the Contributor License Agreement.make check-full
for static code checks and linting)- [ ] I have made corresponding changes to the documentationHow to test these changes
Configure
apm-server.rum.source_mapping.elasticsearch.*
without defining ahost
. It should be merged with the default host.Default values are
hosts: []string{"localhost:9200"}, protocol: "http", timeout: 5s
.Also configure with a different host than the default host and ensure it is applied.
Without these changes, the default values would not be set and an error would occur.
Related issues
fixes #3350