diff --git a/CHANGELOG.md b/CHANGELOG.md index 748e270406d..9c43ece34dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ release. - Add OTEL_LOGS_EXPORTER environment variable. ([#2196](https://github.com/open-telemetry/opentelemetry-specification/pull/2196)) +- Added ObservedTimestamp to the Log Data Model. + ([#2184](https://github.com/open-telemetry/opentelemetry-specification/pull/2184)) ### Resource diff --git a/specification/logs/data-model.md b/specification/logs/data-model.md index 81bc1e533cc..9e1fbe9b847 100644 --- a/specification/logs/data-model.md +++ b/specification/logs/data-model.md @@ -178,6 +178,7 @@ Here is the list of fields in a log record: Field Name |Description ---------------|-------------------------------------------- Timestamp |Time when the event occurred. +ObservedTimestamp|Time when the event was observed. TraceId |Request trace id. SpanId |Request span id. TraceFlags |W3C trace flag. @@ -197,6 +198,24 @@ Type: Timestamp, uint64 nanoseconds since Unix epoch. Description: Time when the event occurred measured by the origin clock. This field is optional, it may be missing if the timestamp is unknown. +### Field: `ObservedTimestamp` + +Type: Timestamp, uint64 nanoseconds since Unix epoch. + +Description: Time when the event was observed by the collection system. For +events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK) +this timestamp is typically set at the generation time and is equal to +Timestamp. For events originating externally and collected by OpenTelemetry +(e.g. using Collector) this is the time when OpenTelemetry's code observed the +event measured by the clock of the OpenTelemetry code. This field SHOULD be set +once the event is observed by OpenTelemetry. + +For converting OpenTelemetry log data to formats that support only one timestamp +or when receiving OpenTelemetry log data by recipients that support only one +timestamp internally the following logic is recommended: + +- Use `Timestamp` if it is present, otherwise use `ObservedTimestamp`. + ### Trace Context Fields #### Field: `TraceId`