-
Notifications
You must be signed in to change notification settings - Fork 393
WIP: baggage span tags #4716
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
base: master
Are you sure you want to change the base?
WIP: baggage span tags #4716
Conversation
👋 Hey @DataDog/ruby-guild, please fill "Change log entry" section in the pull request description. If changes need to be present in CHANGELOG.md you can state it this way **Change log entry**
Yes. A brief summary to be placed into the CHANGELOG.md (possible answers Yes/Yep/Yeah) Or you can opt out like that **Change log entry**
None. (possible answers No/Nope/None) Visited at: 2025-06-05 15:22:27 UTC |
Datadog ReportBranch report: ❌ 22 Failed (0 Known Flaky), 222 Passed, 0 Skipped, 8.22s Total Time ❌ Failed Tests (22)
|
return if baggage_hash.nil? || baggage_hash.empty? | ||
|
||
# Fetch configuration: which keys to tag | ||
raw_config = ENV[ENV_BAGGAGE_SPAN_TAGS] # is this how I get the configuration? |
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.
You receive the value for baggage_span_tags
in the initialize
method of this class, so it doesn't have to be resolve every time. The caller then will provide the value.
if raw_config.nil? | ||
# Default list: "user.id,session.id,account.id" | ||
Set.new(%w[user.id session.id account.id]) | ||
elsif raw_config.strip == '' | ||
# Explicitly disabled | ||
return | ||
elsif raw_config.strip == '*' | ||
# Wildcard: allow all keys | ||
:all | ||
else | ||
Set.new(raw_config.split(',').map(&:strip)) | ||
end |
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.
This kind of configuration processing should be done at the setting side, so it only needs to be done once. Take a look at after_set
to see how you can manipulate the setting at declaration time:
o.after_set do |styles| |
What does this PR do?
Motivation:
Change log entry
Additional Notes:
How to test the change?