Fix: error logged on empty OTEL_TRACES_SAMPLER_ARG - #6511
Merged
dmathieu merged 2 commits intoJan 6, 2025
Conversation
MrAlias
reviewed
Dec 19, 2024
MrAlias
reviewed
Dec 19, 2024
MrAlias
left a comment
Contributor
There was a problem hiding this comment.
Overall, this looks good. Thank you for adding tests to cover your issue. The last remaining thing is a changelog entry for the fix your adding needs to be included.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6511 +/- ##
=======================================
- Coverage 68.5% 68.5% -0.1%
=======================================
Files 200 200
Lines 16768 16772 +4
=======================================
+ Hits 11493 11494 +1
- Misses 4931 4933 +2
- Partials 344 345 +1
|
Contributor
Author
Thanks! Changelog entry added with 4d72fb9 |
MrAlias
approved these changes
Dec 19, 2024
We were noticing errors like:
> time=2024-12-18T15:00:02.080Z level=ERROR
source=/go/pkg/mod/go.opentelemetry.io/contrib/samplers/jaegerremote@v0.27.0/sampler_remote_options.go:112
msg="env variable parsing failure" err="argument is not of type
'<key>=<value>'"
In applications using the Jaeger sampler but had not set the
`OTEL_TRACES_SAMPLER_ARG` environment variable. The issue was:
* `os.Getenv` would return `""` when this var was not set, and
* `strings.Split("", ",")` would return `[]string{""}`
since `""` does not contain `=` an error is emitted.
matthewhughes934
force-pushed
the
fix-empty-env-var-error
branch
from
December 19, 2024 18:01
4d72fb9 to
f77bd1e
Compare
dmathieu
approved these changes
Jan 6, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We were noticing errors like:
In applications using the Jaeger sampler but had not set the
OTEL_TRACES_SAMPLER_ARGenvironment variable. The issue was:os.Getenvwould return""when this var was not set, andstrings.Split("", ",")would return[]string{""}since
""does not contain=an error is emitted.