-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix --set flag #2162
Fix --set flag #2162
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2162 +/- ##
==========================================
- Coverage 91.97% 91.94% -0.03%
==========================================
Files 271 272 +1
Lines 15653 15675 +22
==========================================
+ Hits 14397 14413 +16
- Misses 854 857 +3
- Partials 402 405 +3
Continue to review full report at Codecov.
|
@pavolloffay can you review please? |
Here is the revert #1905 and the original PR https://github.com/open-telemetry/opentelemetry-collector/pull/1640/files |
@joe-elliott could you highlight what fixed the issue? |
@pavolloffay By iterating through all keys and only calling I also attempted other changes like |
To continue this conversation. If your file looks like this:
If you load this with viper and run
If you run
Viper does not enumerate keys that are empty objects but it will enumerate nil keys. By calling @pavolloffay thoughts? |
@jpkrohling do you mind taking a look? |
@joe-elliott these ^^^^ are very nice explanations. Would you be able to add them as comments to the relevant parts of the code? Perhaps drop the "previously" part and keep the part that describes how it works now and most importantly why it works correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. There are a couple of minor improvements that could be made, but those can be safely ignored...
@@ -17,7 +17,7 @@ processors: | |||
batch: | |||
|
|||
extensions: | |||
health_check: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understood, it's still OK to have nil here instead of empty. If that's the case, keep this as nil, as a proof that this change didn't break compat with previous versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, nil is fine here as well as empty object. The problem is that empty object was not working and was not being tested for. With these changes this file now tests both empty object and nil object:
...
extensions:
health_check: {} <- empty object test
pprof: <- nil test
...
I believe I've addressed all comments and improved the in code comments regarding the behavior of viper and why we are setting the root keys. I am getting a failed contribtest:
Could this be due to changes I made? should I dig into this? |
Unlikely that your change could cause this. Looks like a bug in TestNewLogsExporter. |
@joe-elliott please rebase from latest master. |
…y#1640)" (open-telemetry#1905)" This reverts commit 2efdb28.
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Co-authored-by: Juraci Paixão Kröhling <[email protected]> Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Signed-off-by: Joe Elliott <[email protected]>
Rebased but now getting a build error on contrib:
|
This is expected, ignore it. |
* Deprecate Array attribute in favor of *Slice types * Use new attr types in Jaeger exporter * Use slice attr types in otlpmetric * Use slice attr types in otlptrace * Use slice attr types in zipkin exporter * Remove array attr test from deprectated oteltest func * Use StringSlice for cmd arg resource attr * Add changes to the changelog * Remove use of deprecated Array func
Description:
Re-adds the --set parameter in a way that works with
{}
being used in configs.Link to tracking Issue:
Fixes #1907
Testing:
The original tests were added along with the addition of the following:
This failed the previous tests, but now passes.
Documentation: