diff --git a/sentry-rails/lib/sentry/rails/active_job.rb b/sentry-rails/lib/sentry/rails/active_job.rb index 46a798895..d5e137d6e 100644 --- a/sentry-rails/lib/sentry/rails/active_job.rb +++ b/sentry-rails/lib/sentry/rails/active_job.rb @@ -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 = { diff --git a/sentry-rails/spec/active_job/shared_examples/tracing/consumer_transaction.rb b/sentry-rails/spec/active_job/shared_examples/tracing/consumer_transaction.rb index 0c016f266..12222acaa 100644 --- a/sentry-rails/spec/active_job/shared_examples/tracing/consumer_transaction.rb +++ b/sentry-rails/spec/active_job/shared_examples/tracing/consumer_transaction.rb @@ -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 diff --git a/sentry-rails/spec/active_job/shared_examples/tracing/messaging_span_data.rb b/sentry-rails/spec/active_job/shared_examples/tracing/messaging_span_data.rb index 0cde13e51..8cbab029c 100644 --- a/sentry-rails/spec/active_job/shared_examples/tracing/messaging_span_data.rb +++ b/sentry-rails/spec/active_job/shared_examples/tracing/messaging_span_data.rb @@ -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 diff --git a/sentry-rails/spec/active_job/support/harness.rb b/sentry-rails/spec/active_job/support/harness.rb index a1b5e2b65..710492121 100644 --- a/sentry-rails/spec/active_job/support/harness.rb +++ b/sentry-rails/spec/active_job/support/harness.rb @@ -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") diff --git a/sentry-rails/spec/sentry/rails/active_job_hub_isolation_spec.rb b/sentry-rails/spec/sentry/rails/active_job_hub_isolation_spec.rb index cf6d0fef3..0f1bcf7e8 100644 --- a/sentry-rails/spec/sentry/rails/active_job_hub_isolation_spec.rb +++ b/sentry-rails/spec/sentry/rails/active_job_hub_isolation_spec.rb @@ -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 diff --git a/spec/features/active_job_tracing_spec.rb b/spec/features/active_job_tracing_spec.rb index 6fc1f8899..739b31e76 100644 --- a/spec/features/active_job_tracing_spec.rb +++ b/spec/features/active_job_tracing_spec.rb @@ -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 @@ -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")) @@ -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