Skip to content

Commit ec8dc87

Browse files
committed
fix: Set attributes directly on span.
1 parent 99f26b0 commit ec8dc87

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/jobs/application_job.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ class ApplicationJob < ActiveJob::Base
99
rescue_from(Exception) do |error|
1010
span = OpenTelemetry::Trace.current_span
1111
span.status = OpenTelemetry::Trace::Status.error(error.message)
12-
span.record_exception(
13-
error,
14-
attributes: {"job.class" => self.class.name, "job.id" => job_id}
15-
)
12+
span.set_attribute("job.class", self.class.name)
13+
span.set_attribute("job.id", job_id)
14+
span.record_exception(error)
1615

1716
Rails.logger.error(
1817
"Job failed",

0 commit comments

Comments
 (0)