-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ConfigProvider): Modify config merge to do replace instead of up…
…date for Specific tags for Remotely managed collectors (#1604) * Update provider.go * Update provider.go * Create utils.go * Create go.mod * Update provider.go * link util with providers * refactor * build err * pkg/configprovider/opampprovider/go.mod * Update pkg/configprovider/opampprovider/provider.go Co-authored-by: Dominik Rosiek <[email protected]> * check while key path while removing fields+ add test cases * Update pkg/configprovider/providerutil/utils.go Co-authored-by: Dominik Rosiek <[email protected]> * Review changes * Update utils.go * Create 1604.changed.txt * Delete .changelog/.changelog directory * Add files via upload * Update utils.go * Add makefile * Rename Makefile.txt to Makefile * add mod file for providerUtil * goimports refactror * goimports refactor * refactor UT * Update .changelog/1604.changed.txt Co-authored-by: Dominik Rosiek <[email protected]> * Rename 1604.changed.txt to 1604.breaking.txt * Update upgrading.md- breaking changes for config merge flow change * Update upgrading.md(review changes) * Update docs/upgrading.md Co-authored-by: Dominik Rosiek <[email protected]> * Update utils.go * Update upgrading.md * Update utils.go * Update utils.go * Update utils.go * Update upgrading.md * Update opamp_agent.go * Update opamp_agent.go * Simulate en error to see how agent behaves * Update opamp_agent.go * Update opamp_agent.go * Update opamp_agent.go * Update opamp_agent.go * Update components.go * Update go.mod * Update go.sum * Update opamp_agent.go * Update components.go * Update go.sum * Update go.mod * Update opamp_agent.go * Update opamp_agent.go * Update opamp_agent.go * Update opamp_agent.go * Update opamp_agent.go * Update opamp_agent.go * Update go.sum * Update opamp_agent.go * Update upgrading.md * Update upgrading.md * enable tag edit config merge flow change only for remotely managed collectors * Update provider.go * Update provider.go * Update upgrading.md * Update and rename 1604.breaking.txt to 1604.changed.txt * Update provider.go * Update components.go * Update components.go * Create srcconf.yaml * Create mergeconf.yaml * Update srcconf.yaml * Update srcconf.yaml * Update mergeconf.yaml * Update srcconf.yaml * Update mergeconf.yaml * Update srcconf.yaml * Update mergeconf.yaml * Update provider_test.go * Update provider_test.go * Update provider_test.go * Update provider_test.go * Rename srcconf.yaml to a_srcconf.yaml * Update provider_test.go * Update provider_test.go * Update provider_test.go * Update opamp_agent.go * Update opamp_agent.go * Update config.go * Update factory.go * Update opamp_agent.go * Update opamp_agent.go * add disable flag for tag edit in opamp provider * . * Create configMergeDisabled.yaml * Update provider_test.go * Update provider_test.go * Update provider_test.go * Update provider.go * Update provider_test.go * Update provider_test.go * Create configMergeEnabled.yaml * Update provider_test.go * Update provider_test.go * Update configMergeDisabled.yaml * Update opamp_agent.go * Rename configMergeDisabled.yaml to config_new_merge_disabled.yaml * Rename configMergeEnabled.yaml to config_new_merge_enabled.yaml * Update provider_test.go * Update config_new_merge_disabled.yaml * Update README.md * Update provider_test.go * Update provider.go * Update config.go * Update README.md * Update config.go * Update provider.go * Update provider.go * Update provider_test.go * Update config_new_merge_disabled.yaml * Update README.md * Update config.go * Update opamp_agent.go * Update README.md * Update pkg/extension/opampextension/README.md Co-authored-by: Raj Nishtala <[email protected]> * Update utils.go * modify UT for collector_fields test * Update mergeconf.yaml * Update mergeconf.yaml --------- Co-authored-by: Dominik Rosiek <[email protected]> Co-authored-by: Raj Nishtala <[email protected]>
- Loading branch information
1 parent
cb8c543
commit 7b1d067
Showing
21 changed files
with
395 additions
and
11 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 @@ | ||
feat(ConfigProvider)!: Modify config merge to do replace instead of update for Specific tags for Remotely managed collectors |
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
8 changes: 8 additions & 0 deletions
8
pkg/configprovider/globprovider/testdata/mergefunc/a_srcconf.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,8 @@ | ||
extensions: | ||
sumologic: | ||
childKey: "value" | ||
collector_fields: | ||
cluster: "cluster-1" | ||
collector_fields1: | ||
cluster: "cluster-1" | ||
processor: "someprocessor" |
7 changes: 7 additions & 0 deletions
7
pkg/configprovider/globprovider/testdata/mergefunc/mergeconf.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,7 @@ | ||
extensions: | ||
sumologic: | ||
childKey: "value" | ||
collector_fields: | ||
zone: "eu" | ||
collector_fields1: | ||
zone: "eu" |
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
5 changes: 5 additions & 0 deletions
5
pkg/configprovider/opampprovider/testdata/config_new_merge_disabled.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,5 @@ | ||
extensions: | ||
opamp: | ||
endpoint: "wss://example.com/v1/opamp" | ||
remote_configuration_directory: ../globprovider/testdata/mergefunc | ||
disable_tag_replacement: true |
4 changes: 4 additions & 0 deletions
4
pkg/configprovider/opampprovider/testdata/config_new_merge_enabled.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,4 @@ | ||
extensions: | ||
opamp: | ||
endpoint: "wss://example.com/v1/opamp" | ||
remote_configuration_directory: ../globprovider/testdata/mergefunc |
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 @@ | ||
include ../../Makefile.Common |
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,24 @@ | ||
module github.com/SumoLogic/sumologic-otel-collector/pkg/configprovider/providerutil | ||
|
||
go 1.21.0 | ||
|
||
toolchain go1.22.3 | ||
|
||
require ( | ||
github.com/stretchr/testify v1.9.0 | ||
go.opentelemetry.io/collector/confmap v0.102.1 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect | ||
github.com/knadh/koanf/maps v0.1.1 // indirect | ||
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect | ||
github.com/knadh/koanf/v2 v2.1.1 // indirect | ||
github.com/mitchellh/copystructure v1.2.0 // indirect | ||
github.com/mitchellh/reflectwalk v1.0.2 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
go.uber.org/multierr v1.11.0 // indirect | ||
go.uber.org/zap v1.27.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
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,30 @@ | ||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= | ||
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= | ||
github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= | ||
github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= | ||
github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= | ||
github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= | ||
github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= | ||
github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= | ||
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= | ||
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= | ||
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= | ||
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= | ||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= | ||
go.opentelemetry.io/collector/confmap v0.102.1 h1:wZuH+d/P11Suz8wbp+xQCJ0BPE9m5pybtUe74c+rU7E= | ||
go.opentelemetry.io/collector/confmap v0.102.1/go.mod h1:KgpS7UxH5rkd69CzAzlY2I1heH8Z7eNCZlHmwQBMxNg= | ||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= | ||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= | ||
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= | ||
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= | ||
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= | ||
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
Oops, something went wrong.