-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Emit transaction.data
inside contexts.trace.data
#3873
Comments
Span.Data should end up on on sentry-dotnet/src/Sentry/SpanTracer.cs Line 88 in 3f63cb6
So we might want to add an |
Another thought, since we have:
We could have |
@aritchie maybe a good first thing if you're willing to take a stab at this? |
@bruno-garcia @bitsandfoxes in the issue description we've got:
That seems a bit redundant. You'd end up with both From @cleptric 's comment here:
It seems like what we should be doing is keeping the Just double checking this as it's how @aritchie implemented it in his PR (which makes sense to me). |
I don't agree. The |
So I had a chat to @bruno-garcia. He said we should basically mimic what they've done in the Java SDK. I think in that PR they don't actually touch the Transaction - it's mainly a modification to spans (which is weird, given the title of the PR... but anyway). @aritchie apologies for the fuzzy initial requirements... I think we have to circle back on this one though as, presently, what we've done in this PR is a bit different to what they've done in the JavaSDK. |
@jamescrosswell This seemed to be the cleanest way to do this without introducing breaking changes. If I don't make changes to the SentryTransaction, it will serialize to the extras at the moment. |
If I'm following what they're doing in the Java code correctly... although they're storing this in SpanContext.data (during a trace) it gets copied across to the transaction.contexts.data when the trace gets turned into a Transaction that gets captured and sent to Sentry. So far so good. However they've also retained some separate Extra data: This is a bit hard to see, since it looks like they removed it from the test here: ![]() But further down in the file there are still references to it: ![]() So, if I'm getting this right, we're supposed to leave the Extra stuff where it is on the Transaction. This makes sense because Extra is a property that exists on all Sentry events (like Messages and Exceptions, not just Transactions). We simply need to add a Data field to the Transaction.Context.Trace. For spans, I'm less sure. Would need to dig into the Java SDK further. It's possible they were already using that SpanContext on Spans and so, with that PR, they're implicitly adding a Span.Data field as well (but they didn't have to fiddle with the Span class itself to achieve this - came for free from the SpanContext in that case). |
@jamescrosswell So they don't want data MOVED from SentryTransaction, just another data collection added to the trace? Spans already had data in place. No change was required there. |
@jamescrosswell Spans does have the Extras but serializes to data. Do you want to refactor all of the calls to SetData/Data? |
Relates to getsentry/team-sdks#95
See getsentry/team-sdks#95 (comment) for more details.
Current Behavior
extra
todata
in our SDKSentryTransaction
, the extra data gets written toextra
. TheITransactionTracer
inherits fromIHasExtra
so this makes sense.sentry-dotnet/src/Sentry/SentryTransaction.cs
Line 404 in 7024f37
Problem
The current inheritance structure prevents us from correctly mapping:
contexts.trace.data
span.data
Proposed Solution
Instead of modifying the inheritance structure for transactions and spans (which would be hacky), we should:
SetData
methods to bothTransactionTracer
andSpanTracer
SetExtra
functionalityTechnical Details
contexts.trace.data
sentry-dotnet/src/Sentry/SentryTransaction.cs
Line 398 in 7024f37
span.data
The text was updated successfully, but these errors were encountered: