-
Notifications
You must be signed in to change notification settings - Fork 6
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(tracing): Only override the OTEL service name if it is not already set #224
Conversation
…y set in OTEL_RESOURCE_ATTRIBUTES or OTEL_SERVICE_NAME
src/kwaak_tracing.rs
Outdated
let resource_attributes = std::env::var("OTEL_RESOURCE_ATTRIBUTES") | ||
.unwrap_or_default() | ||
.split(',') | ||
.map(|s| s.split_once("=").expect("invalid OTEL_RESOURCE_ATTRIBUTES")) |
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.
So if you do default (empty string), this panics.
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.
oops
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.
Eh oh no, you're not correct. We first split on ,
to get the pairs. So if the variable is empty, the split won't yield any results so it would never get to the resource attribute splitter.
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.
Hmm you actually are correct, that is surprising..
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.
I guess it's not really surprising, if you have a list of one element of course it would not include the separator and yield the one result.
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.
I have my moments
## 🤖 New release * `kwaak`: 0.8.2 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.8.2] - 2025-02-09 ### 🚀 Features - Improve line edits and add line editing evaluation (#235) - Support custom constraints for an agent (#274) - Optionally hide top header in UI (#275) ### 🐛 Bug Fixes - *(tracing)* Only override the OTEL service name if it is not already set (#224) ### ⚙️ Miscellaneous Tasks - Fmt <!-- generated by git-cliff --> </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
Only override the OTEL service name if it is not already set in OTEL_RESOURCE_ATTRIBUTES or OTEL_SERVICE_NAME.