-
Notifications
You must be signed in to change notification settings - Fork 888
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
Define the shape of a event by encapsulating the payload in event.data. #2926
Conversation
0d1492e
to
ba9b2d0
Compare
ba9b2d0
to
86f3b6d
Compare
I think that log events should also support representing the payload of application requests. For example, in order for a user to collect the response body of an outgoing HTTP request, saving it as part of a span is problematic since the body could be read after the span representing the request is closed (many times it's also read asynchronously). Using a I'm also in favor of using the log |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
not stale |
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. |
ca15822
to
354a1f8
Compare
3f5f92d
to
838c04f
Compare
The problems that this solves are too abstract for me support at this time. In particular, it's not clear how downstream validation of Based off discussions in the 2/22/23 log sig, this change seems important to the client instrumentation working group. If this inclusion is in fact blocking progress, can a demo be given which shows concrete situations where including event data as top level attributes fails? |
I have attempted to not restrict or define how (or if) downstream validation would occur as some vendors will and some wont. And others may choose to provide validation as a development (non-production) client side validation tool.
Simplistically, It doesn't. If someone wants to construct a "Custom" event which only uses top-level attributes they could, as part of this specification definition I'm saying they SHOULDN'T because of the chance of collisions and to simplify how back-end systems can identify, process and store "Events". (Which can also be viewed as a specific Structured Log records). There are additional reasons why specifying that event detail is passed in a single attribute (Which I'll include below -- I explicitly left out of the spec detail). This is also the one of the primary reasons for choosing to send "events" via Logs as it IS the only signal that supports nested attributes. Otherwise, we could have just continued to hack zero-length Span's with span Event (which has additional issues)
Because many of the RUM events are defined by scraping and passing data based on existing W3C standards (at least for browser events), these names are fixed and as they evolve additional names WILL (and have) be added. The only way to avoid the collisions would be to prefix EVERY field which has performance, memory and payload considerations (all of which are major issues for client runtimes, whether a browser, mobile device, IOT or embedded into "SMART Tv's". (Yes, I've supported this) Why use a single attributeWithout encapsulating the event payload into a single nested attribute, the following (or combination) would need to occur, whether to avoid collisions or not.
I've mentioned payload size before, but let me restate here, during the "Page/Application unload" (user navigates to another page, closes the browser, switches tabs and on mobile devices turns the device (screen) off - forcing the app to hibernation (and potentially never wake up)), so at this point any SDK should attempt to send all observability content (as it may not have any persistence capability or even a chance to re-hydrate and send (eg. classic examples of this are crashes). During this "unload" state modern browsers have a restricted set of API's to allow the "delivery" of any network requests, both of these have a MAXIMUM payload of 64kb (of total outstanding (unsent) requests -- you can't just send multiple 64kb payloads you can send 1 total or several which add up to 64kb), and while there is currently an experimental compression API (it's not supported on Firefox) and it appears that it can't be supported by the primary sending API (because we can't include headers informing the receiver that the HTTP request is compressed (gzipped)), likewise on unsupported browsers including the additional client side code (which increases the page load time) also doesn't help, because you still can't add the additional header telling the receiver that the payload is compressed.... |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Not stale |
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. |
Waiting for outcome of #3406 |
…entations. This document serves more for the purpose as a schema for the events than the semantic conventions as supported in Otel today. Related PRs open-telemetry/opentelemetry-specification#2926
Changes
This PR extends the event specification to define the "shape" of an event by encapsulating the payload (content) of the event in the
event.data
attribute.This defines how events with a payload should be defined, this enables support for downstream systems to handle both known known domain-specific events (identified by
event.domain
andevent.name
) and any other arbitrary new or vender specific events.Downstream systems can safely assume that when a Log record contains the
event.domain
,event.name
andevent.data
that the Log record represents an event and can then perform any validation or storage (routing) changes that the vender may require.This provides support not only for events being defined by the RUM Sig, but also includes support for the mapping of CloudEvents, which can be defined by a later PR.
Possible CloudEvents mapping Example:
data
)With Cloud Events Context Attributes (Required and optional) being mapped to top level OpenTelemetry Attributes of the same name
There was a discussion around using the "Body" of a log message as the transport for the payload instead of defining an
event.data
, however, while the Logs is intended to be the primary transport mechanism events the definition of an event is not limited to Logs only. This allows for an event to be transmitted as a span event (which doesn't have a "Body") and also supports direct logical mapping for CloudEvents.