Skip to content

Commit

Permalink
Don't add attributes unless there is an annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Nov 5, 2024
1 parent 6b8b2ff commit 19c9298
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/traces/provider/async/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ def schedule(&block)
super do
Traces.trace_context = trace_context

attributes = {
"annotation" => self.annotation,
}
if annotation = self.annotation
attributes = {
"annotation" => annotation
}
end

Traces.trace('async.task', attributes: attributes) do
yield
Expand Down

0 comments on commit 19c9298

Please sign in to comment.