Skip to content

Commit

Permalink
Include transaction data in the trace context (#2365)
Browse files Browse the repository at this point in the history
  • Loading branch information
solnic committed Aug 8, 2024
1 parent e4571d9 commit 47c4458
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Support for tracing Faraday requests ([#2345](https://github.com/getsentry/sentry-ruby/pull/2345))
- Closes [#1795](https://github.com/getsentry/sentry-ruby/issues/1795)
- Please note that the Faraday instrumentation has some limitations in case of async requests: https://github.com/lostisland/faraday/issues/1381
- Transaction data are now included in the context ([#2365](https://github.com/getsentry/sentry-ruby/pull/2365))
- Closes [#2364](https://github.com/getsentry/sentry-ruby/issues/2363)

## 5.18.2

Expand Down
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 47c4458

Please sign in to comment.