-
Notifications
You must be signed in to change notification settings - Fork 579
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: error logged on empty OTEL_TRACES_SAMPLER_ARG #6511
base: main
Are you sure you want to change the base?
Fix: error logged on empty OTEL_TRACES_SAMPLER_ARG #6511
Conversation
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.
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
|
Thanks! Changelog entry added with 4d72fb9 |
We were noticing errors like: > time=2024-12-18T15:00:02.080Z level=ERROR source=/go/pkg/mod/go.opentelemetry.io/contrib/samplers/[email protected]/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.
4d72fb9
to
f77bd1e
Compare
We were noticing errors like:
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, andstrings.Split("", ",")
would return[]string{""}
since
""
does not contain=
an error is emitted.