Skip to content

Include transaction data in the trace context #2365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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: 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
Loading