-
Notifications
You must be signed in to change notification settings - Fork 834
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
Demonstrate span-event-to-event, event-to-span-event bridging #6650
base: main
Are you sure you want to change the base?
Demonstrate span-event-to-event, event-to-span-event bridging #6650
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6650 +/- ##
============================================
- Coverage 90.05% 90.05% -0.01%
- Complexity 6275 6295 +20
============================================
Files 697 699 +2
Lines 18944 19030 +86
Branches 1858 1865 +7
============================================
+ Hits 17060 17137 +77
- Misses 1307 1314 +7
- Partials 577 579 +2 ☔ View full report in Codecov by Sentry. |
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.
Thanks @jack-berg!
So, this looks like doing bridging as data is recorded, which has advantages for those who can control the instrumentation sdk vs attempting to do this at the collector tier. If you can add this LogRecordProcessor first, we can adjust data.
Quick q and sorry if I should know this. Is there already code here to basically skip other processors when we've handled the event? e.g. not also record the same as a log event.
processedCounter.add(1, SPAN_NOT_RECORDING); | ||
return; | ||
} | ||
currentSpan.addEvent( |
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.
So, just speaking aloud. This works because the event api is involved directly (e.g. not intermediated through a queue or otherwise). So, it has access to whatever the current span is, which would match the trace and span id in the event, if someone added the span context.
In other words, we could if we wanted to, assert logRecordData.getSpanContext()
is the same as the current span context.
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.
Yes exactly. LogRecordProcessors
are called synchronously from the point where the log was emitted in the application. This means its important for them to be fast and non-blocking, but grants access to the current context, including the active span.
No there isn't code for that and I think its a gap in the log / event SDK design. Currently, there are two sources of data for the log SDK:
Couldn't find a spec issue for this so opened: open-telemetry/opentelemetry-specification#4189 |
thanks for the help, @jack-berg. the advice was spot-on and appreciate your opening an issue on the gap! |
A demonstration of how bridging between span events and events can work today. This is meant to illustrate what's possible without any changes, and to illustrate problems.
Some things to note:
event.name
has stricter requirements than span event names.event.name
can be easily mapped to span event name, but converting span event name toevent.name
requiring some prefixing to conform.severity
,severity_text
.Check out a few examples:
cc @open-telemetry/semconv-event-approvers