-
Notifications
You must be signed in to change notification settings - Fork 104
feat(otlp): Derive a sentry.description
attribute for V2 spans
#4832
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
feat(otlp): Derive a sentry.description
attribute for V2 spans
#4832
Conversation
If an HTTP method is available, use it
relay-spans/src/v2_to_v1.rs
Outdated
let is_cache_op = attributes | ||
.get("sentry.op") | ||
.and_then(|attr| attr.value()) | ||
.and_then(|attr_val| attr_val.value.value.value()) | ||
.and_then(|v| v.as_str()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern is starting to show up a lot. Maybe worth adding a method like dig
to Attributes
to pull this data out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #4838.
@AbhiPrasad I borrowed more logic from the JavaScript SDK for this, but also made some changes to comply better to what I was seeing in the recent OTel semantic conventions. Could you take a quick look and see if it looks reasonable? My understanding is that I don't have to match the SDKs 1:1, is that fair? |
relay-spans/src/v2_to_v1.rs
Outdated
let is_cache_op = attributes | ||
.get("sentry.op") | ||
.and_then(|attr| attr.value()) | ||
.and_then(|attr_val| attr_val.value.value.value()) | ||
.and_then(|v| v.as_str()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #4838.
Co-authored-by: Sebastian Zivota <[email protected]>
Co-authored-by: Sebastian Zivota <[email protected]>
Co-authored-by: Sebastian Zivota <[email protected]>
Co-authored-by: Sebastian Zivota <[email protected]>
Allow the inferring function to return `None`, and remove checks from parent. Also add a test for this.
…on-for-otlp-spans
@loewenheim thanks for the review! I followed pretty much all of your suggestions
There are just a few things left:
|
@gggritso In the test case I was referring to, you're changing the kind from |
@loewenheim yep, IMO it makes it a more realistic test. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still some to_string
left in v2_to_v1.rs
, otherwise LGTM!
#4839 has been merged, that should simplify some things. |
@loewenheim great! I fixed all the |
Very similar to #4796, but for the
span.description
attribute. Supports Span Field Transition.V2 spans probably will still have a description, but OTLP spans will not. To make the transition easier, and to create a better experience in the span waterfall, this PR derives a description for HTTP and database spans based on the logic that exists in the JavaScript SDK. It's slightly different from the SDK logic, but not in any important way, from what I can tell.
sentry.description
attributedescription
field, generate a description and put it in thesentry.description
attributename
field, since it's similar in purposeI also removed the little bit of current
description
processing, since it all lives near theop
processing now.