Skip to content
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 span events to events mapping #4023

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions specification/logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ standard output.
* [Logs Data Model](./data-model.md)
* [Event API](./event-api.md)
* [Trace Context in non-OTLP Log Formats](../compatibility/logging_trace_context.md)
* [Span Events to Events mapping](./span-events-mapping.md)

## References

Expand Down
21 changes: 21 additions & 0 deletions specification/logs/span-events-mapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Span Event to Event Mapping

**Status**: [Experimental](../document-status.md)

[Span Events](../trace/api.md#add-events) represent an event attached to a span and has a different structure than [Events](./event-api.md).

Applications or telemetry consumers MAY transform Span Events to Events inside their span processing pipeline using the mappings defined in the document.

Event API properties:

<!-- TODO add link to semantic conventions once https://github.com/open-telemetry/semantic-conventions/pull/954 is merged -->

- `Name` SHOULD match the Span Event name
- `Timestamp` SHOULD match Span Event timestamp
- `Context` SHOULD match the context of the span the Span Event is attached to.
- `SeverityNumber` - no mapping, not set. <!-- TODO define mapping in the semconv -->
- `Payload` SHOULD be set to the object deserialized from JSON string provided in the Span Event `event.data` attribute (if any). If deserialization fails with an error, the original string value of the `event.data` attribute SHOULD be used.
- `Attributes` SHOULD match Span Event attributes except those that were used to populate other event properties (`event.data`).

The `EventLogger` used to report mapped Events SHOULD have the same instrumentation scope properties as the
Span the original Span Event is attached to.
Loading