Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sentry-rails/lib/sentry/rails/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def already_supported_by_sentry_integration?
end

class SentryReporter
OP_NAME = "queue.active_job"
OP_NAME = "queue.process"
SPAN_ORIGIN = "auto.queue.active_job"

EVENT_HANDLERS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

expect(transaction.transaction).to eq(successful_job.name)
expect(transaction.transaction_info).to eq(source: :task)
expect(transaction.contexts.dig(:trace, :op)).to eq("queue.active_job")
expect(transaction.contexts.dig(:trace, :op)).to eq("queue.process")
expect(transaction.contexts.dig(:trace, :origin)).to eq("auto.queue.active_job")
expect(transaction.contexts.dig(:trace, :status)).to eq("ok")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def perform
retried_job.perform_later
drain

consumer_txns = transactions.select { |t| t.contexts.dig(:trace, :op) == "queue.active_job" }
consumer_txns = transactions.select { |t| t.contexts.dig(:trace, :op) == "queue.process" }
retry_counts = consumer_txns.map { |t| t.contexts.dig(:trace, :data, "messaging.message.retry.count") }
expect(retry_counts).to eq([0, 0, 1])
end
Expand Down
2 changes: 1 addition & 1 deletion sentry-rails/spec/active_job/support/harness.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def transactions
end

def consumer_transaction
transactions.find { |t| t.contexts.dig(:trace, :op) == "queue.active_job" }
transactions.find { |t| t.contexts.dig(:trace, :op) == "queue.process" }
end

def within_parent_transaction(name: "parent.test", op: "test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def perform
job_event = events.find { |e| e.is_a?(Sentry::ErrorEvent) && e.message == "from-job" }
request_event = events.find { |e| e.is_a?(Sentry::ErrorEvent) && e.message == "from-request-after" }
consumer_transaction = events.find do |e|
e.is_a?(Sentry::TransactionEvent) && e.contexts.dig(:trace, :op) == "queue.active_job"
e.is_a?(Sentry::TransactionEvent) && e.contexts.dig(:trace, :op) == "queue.process"
end

expect(job_event).not_to be_nil
Expand Down
6 changes: 3 additions & 3 deletions spec/features/active_job_tracing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The browser SDK's browserTracing integration propagates sentry-trace +
# baggage to the Rails request; the Rails AJ extension emits a
# queue.publish span on the http.server transaction at enqueue, and a
# queue.active_job consumer transaction when the :async pool runs the
# queue.process consumer transaction when the :async pool runs the
# job. All three rails-side artifacts must share one trace.
RSpec.describe "ActiveJob distributed tracing", type: :e2e do
it "links the browser fetch, the controller, the producer span, and the consumer transaction into one trace" do
Expand Down Expand Up @@ -43,7 +43,7 @@
# Consumer transaction continued the same trace and is parented on
# the publish span.
expect(job_txn.dig("contexts", "trace", "trace_id")).to eq(incoming_trace_id)
expect(job_txn.dig("contexts", "trace", "op")).to eq("queue.active_job")
expect(job_txn.dig("contexts", "trace", "op")).to eq("queue.process")
expect(job_txn.dig("contexts", "trace", "parent_span_id")).to eq(publish_span["span_id"])
expect(job_txn.dig("contexts", "trace", "data", "messaging.message.id"))
.to eq(publish_span.dig("data", "messaging.message.id"))
Expand Down Expand Up @@ -71,7 +71,7 @@ def wait_for_trace(timeout: 10)

trace_id = http_txn.dig("contexts", "trace", "trace_id")
job_txn = transactions.find do |t|
t.dig("contexts", "trace", "op") == "queue.active_job" &&
t.dig("contexts", "trace", "op") == "queue.process" &&
t.dig("contexts", "trace", "trace_id") == trace_id
end
return [http_txn, job_txn] if job_txn
Expand Down
Loading