Skip to content

Commit

Permalink
Add block and transient attributes to trace.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 29, 2025
1 parent db2c6ca commit 21527ca
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/traces/provider/async/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ def schedule(&block)
trace_context = Traces.trace_context
end

attributes = {
"block" => block,
"transient" => self.transient?,
}

super do
Traces.trace_context = trace_context

if annotation = self.annotation
attributes = {
"annotation" => annotation
}
attributes["annotation"] = annotation
end

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

0 comments on commit 21527ca

Please sign in to comment.