Skip to content

Commit

Permalink
Include transaction data in the trace context
Browse files Browse the repository at this point in the history
Closes #2363
  • Loading branch information
solnic committed Aug 8, 2024
1 parent e4571d9 commit 350079f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sentry-ruby/lib/sentry/span.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ def get_trace_context
description: @description,
op: @op,
status: @status,
origin: @origin
origin: @origin,
data: @data
}
end

Expand Down
3 changes: 3 additions & 0 deletions sentry-ruby/spec/sentry/span_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@
it "returns correct context data" do
context = subject.get_trace_context

subject.set_data(:foo, "bar")

expect(context[:op]).to eq("sql.query")
expect(context[:description]).to eq("SELECT * FROM users;")
expect(context[:status]).to eq("ok")
expect(context[:trace_id].length).to eq(32)
expect(context[:span_id].length).to eq(16)
expect(context[:origin]).to eq('manual')
expect(context[:data]).to eq(foo: "bar")
end
end

Expand Down

0 comments on commit 350079f

Please sign in to comment.