-
Notifications
You must be signed in to change notification settings - Fork 896
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
Add event processors to the Event SDK #4196
Conversation
Co-authored-by: Trask Stalnaker <[email protected]>
|
||
**Returns:** | ||
|
||
* `next` - an Enum with two values, STOP and CONTINUE. |
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.
For logs,traces, a different approach is used where the next processor(s) are always called. Filtering there would require one to make wrapping processors.
I think this approach makes it easier to do filtering. Wondering if there were some discussions comparing the approaches for their pros/cons? The PR description only says "list of EventProcessors, to match the way that the tracing and logging providers are configured."
Is there a prototype for this? |
* `loggingProvider` - the `LoggingProvider` to use when emitting `LogRecord`s. | ||
TODO need new Logging Provider SDK method | ||
|
||
#### Span event processor |
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.
maybe this should be a log processor instead, so that it will apply also to events emitted directly via language-specific loggers?
The TC discussed and think we should agree / resolve open-telemetry/oteps#265 before proceeding with this, since the outcome may change the strategy of the spec and cause churn. |
Makes sense, I've marked this PR as draft for the time being. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
This PR changes the
EventProvider
SDK constructor to take a list ofEventProcessors
, to match the way that the tracing and logging providers are configured.The three types of event processors included in this PR cover the features requested durning the August 23rd meeting of the Event SIG.
The log processor and the span event processor can be composed together:
Alternatively, a language-specific logging processor could be used to send events directly to another logging system:
Log bridge processor
This processor passes the event's
LogRecord
to the Log SDK.Span event processor
This processor converts the event's
LogRecord
into aSpanEvent
on the current span. If there is no current span, this is a no-op.If the event's
LogRecord
has a body, it MUST be json-serialized to aSpanEvent
attribute named
event.body
.Event processors for language-specific logging libraries
These processors turn the Event API into "sugar" for popular logging libraries by sending the events directly to that 3rd-party logger's API. This is helpful for users who want to ensure that the
LogRecords
created via the Event API are processed in the same pipeline as their application logs.For example, in Python the default logging library is very popular. A
PythonLoggerProcessor
would allow users to turn events directly into python logs. Any further processing is managed through the python logging system, including sending it to the LogBridge API if they want to record their logs in Otel.