-
Notifications
You must be signed in to change notification settings - Fork 933
Open
Labels
sig-issueA specific SIG should look into this before discussing at the specA specific SIG should look into this before discussing at the specspec:logsRelated to the specification/logs directoryRelated to the specification/logs directory
Description
The long term vision for events is to leverage log based events instead of span events.
There are different (not mutually-exclusive) migration strategies we could use:
- Producers may switch to logs API gradually following Span Events API deprecation
- SDK may start converting span events to log-based events (based on the opt-in feature flag)
- OTel (or vendors) may provide SDK and collector processors that perform conversion
- Backends can handle span events and log-based events in a similar way on the ingestion side
...
span event -> log event conversion is as trivial as:
| Span event property | Log event property |
|---|---|
| Name | EventName |
| Timestamp (if provided) | Timestamp |
| Attributes | Attributes |
| Span context | Span context |
| Severity: not provided | |
| Body: not provided |
With the only challenge being getting access to Logs SDK pipeline from Trace SDK
log events -> span events is more complicated.
The motivation to define this conversion is to support
- backends such as Jaeger that support traces and not logs
- provide backward compatibility for other possible cases
| Log event property | Span event property |
|---|---|
| EventName | Name if EventName is provided, define convention otherwise - e.g. otel.log |
| Timestamp (if provided) | Timestamp |
| Observed timestamp (if Timestamp not provided) | Timestamp |
| Attributes (standard) | Attributes |
| Attributes (extended) | Drop, flatten, or serialize extended attributes |
| Span context | Attach to current span or drop if there is no current span. |
| Severity Number (if provided) | Define semantic convention (log.record.severity.number) |
| Severity Text (if provided) | Define semantic convention (log.record.severity.text) |
| Body | Drop, flatten, or serialize to log.record.body |
We should document translation rules to have consistency across languages. Implementation would remain optional and done as a part of contrib repos, but this might change depending on the migration path.
Related:
- Add event processors to the Event SDK #4196
- Add LogRecordProcessor to record event log records as span events opentelemetry-java-contrib#1551
- https://github.com/open-telemetry/opentelemetry-dotnet-contrib/tree/main/src/OpenTelemetry.Extensions#attachlogstoactivityevent - .NET logs -> span events processor
Metadata
Metadata
Assignees
Labels
sig-issueA specific SIG should look into this before discussing at the specA specific SIG should look into this before discussing at the specspec:logsRelated to the specification/logs directoryRelated to the specification/logs directory
Type
Projects
Status
No status