-
-
Notifications
You must be signed in to change notification settings - Fork 165
feat(otel): capture span events #795
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,8 @@ use sentry_core::SentryTrace; | |
use sentry_core::{TransactionContext, TransactionOrSpan}; | ||
|
||
use crate::converters::{ | ||
convert_span_id, convert_span_kind, convert_span_status, convert_trace_id, convert_value, | ||
convert_event, convert_span_id, convert_span_kind, convert_span_status, convert_trace_id, | ||
convert_value, | ||
}; | ||
|
||
/// A mapping from Sentry span IDs to Sentry spans/transactions. | ||
|
@@ -152,14 +153,17 @@ impl SpanProcessor for SentrySpanProcessor { | |
return; | ||
}; | ||
|
||
// TODO: read OTEL span events and convert them to Sentry breadcrumbs/events | ||
|
||
sentry_span.set_data("otel.kind", convert_span_kind(data.span_kind)); | ||
for attribute in data.attributes { | ||
sentry_span.set_data(attribute.key.as_str(), convert_value(attribute.value)); | ||
} | ||
// TODO: read OTEL semantic convention span attributes and map them to the appropriate | ||
// Sentry span attributes/context values | ||
|
||
for event in data.events { | ||
sentry_core::capture_event(convert_event(&event)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its a bit weird that you only get these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is true, on the other hand you know exactly which span they are in and you have the timestamp, so it shouldn't be much of a problem. |
||
} | ||
|
||
sentry_span.set_status(convert_span_status(&data.status)); | ||
sentry_span.finish_with_timestamp(data.end_time); | ||
} | ||
|
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.
doesn’t an otel event have a level?
for
tracing
we have this code that does different things depending on the event level.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.
Unfortunately in Rust they just carry a message, timestamp and attributes.
It seems that there is some misalignment in OTEL itself when it comes to this.
In e.g. Java they carry exceptions, so it makes sense to create errors out of them. @sl0thentr0py I don't think I mentioned this before when discussing this.