Skip to content

Commit

Permalink
Add time units
Browse files Browse the repository at this point in the history
  • Loading branch information
brentjr committed Oct 7, 2023
1 parent e108cb3 commit 7f2162a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ defmodule OpentelemetryOban.JobHandler do

defp set_measurements_attributes(%{duration: duration, queue_time: queue_time}) do
OpenTelemetry.Tracer.set_attributes(%{
:"messaging.oban.duration" => System.convert_time_unit(duration, :native, :microsecond),
:"messaging.oban.queue_time" =>
:"messaging.oban.duration_us" => System.convert_time_unit(duration, :native, :microsecond),
:"messaging.oban.queue_time_us" =>
System.convert_time_unit(queue_time, :nanosecond, :microsecond)
})
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ defmodule OpentelemetryObanTest do
"messaging.destination_kind": :queue,
"messaging.destination": "events",
"messaging.oban.attempt": 1,
"messaging.oban.duration": _duration,
"messaging.oban.duration_us": _duration,
"messaging.oban.inserted_at": _inserted_at,
"messaging.oban.job_id": _job_id,
"messaging.oban.max_attempts": 1,
"messaging.oban.priority": 0,
"messaging.oban.queue_time": _queue_time,
"messaging.oban.queue_time_us": _queue_time,
"messaging.oban.scheduled_at": _scheduled_at,
"messaging.oban.worker": "TestJob",
"messaging.operation": :process,
Expand All @@ -180,12 +180,12 @@ defmodule OpentelemetryObanTest do
"messaging.destination_kind": :queue,
"messaging.destination": "events",
"messaging.oban.attempt": 1,
"messaging.oban.duration": _duration,
"messaging.oban.duration_us": _duration,
"messaging.oban.inserted_at": _inserted_at,
"messaging.oban.job_id": _job_id,
"messaging.oban.max_attempts": 1,
"messaging.oban.priority": 0,
"messaging.oban.queue_time": _queue_time,
"messaging.oban.queue_time_us": _queue_time,
"messaging.oban.scheduled_at": _scheduled_at,
"messaging.oban.worker": "TestJobThatReturnsError",
"messaging.operation": :process,
Expand Down

0 comments on commit 7f2162a

Please sign in to comment.