diff --git a/specification/logs/README.md b/specification/logs/README.md index 5980f25b7c2..f5eba863f8d 100644 --- a/specification/logs/README.md +++ b/specification/logs/README.md @@ -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 diff --git a/specification/logs/span-events-mapping.md b/specification/logs/span-events-mapping.md new file mode 100644 index 00000000000..31474646c27 --- /dev/null +++ b/specification/logs/span-events-mapping.md @@ -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: + + + +- `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. +- `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. \ No newline at end of file