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
[pkg/stanza] TimeParser
unmarshaling ignores original configuration
#32169
Labels
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Agreed that this can be considered a bug. |
I believe #31802 addresses this bug. |
djaglowski
pushed a commit
that referenced
this issue
Apr 20, 2024
**Description:** Fix unmarshaling of TimeParser to conserve initial settings before unmarshaling. **Link to tracking Issue:** Fixes #32169 **Testing:** Added the test from the issue. For @mx-psi I could not make it so we would apply #31802 (comment) because `TimeParser` is reused on all operators, and therefore it becomes contentious to patch all over the place.
LokeshOpsramp
pushed a commit
to opsramp/opentelemetry-collector-contrib
that referenced
this issue
May 5, 2024
**Description:** Fix unmarshaling of TimeParser to conserve initial settings before unmarshaling. **Link to tracking Issue:** Fixes open-telemetry#32169 **Testing:** Added the test from the issue. For @mx-psi I could not make it so we would apply open-telemetry#31802 (comment) because `TimeParser` is reused on all operators, and therefore it becomes contentious to patch all over the place.
rimitchell
pushed a commit
to rimitchell/opentelemetry-collector-contrib
that referenced
this issue
May 8, 2024
**Description:** Fix unmarshaling of TimeParser to conserve initial settings before unmarshaling. **Link to tracking Issue:** Fixes open-telemetry#32169 **Testing:** Added the test from the issue. For @mx-psi I could not make it so we would apply open-telemetry#31802 (comment) because `TimeParser` is reused on all operators, and therefore it becomes contentious to patch all over the place.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Component(s)
pkg/stanza
What happened?
Description
The
TimeParser
struct seems to ignore the original configuration if the struct was initialized with something other than the default values:opentelemetry-collector-contrib/pkg/stanza/operator/helper/time.go
Lines 49 to 57 in b25b78a
Steps to Reproduce
This test reproduces it
Expected Result
All assertions pass
Actual Result
The last assertion fails
Collector version
Tested as of b25b78a
Environment information
No response
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
I think
NewTimeParser
should be part of the default configuration of time parser instead of this, and we should do the 'set to nil' trick from https://github.com/open-telemetry/opentelemetry-collector/blob/c72092e00151ce8e4cfef32c73b3a80d54076278/receiver/otlpreceiver/config.go#L68-L70 if we want to only set default config if the key exists.The text was updated successfully, but these errors were encountered: