You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sending data without observedTimeUnixNano and timeUnixNano fields directly to Data Prepper, it will create Documents in OpenSearch including the time and observedTime field set to epoch 0 (Jan 1 1970).
This makes logs very hard to find, sometimes users are under the expression that the logs weren't ingested at all, since they would only check a recent time.
Based on the spec of the observedTime field, it "is the time when OpenTelemetry’s code observed the event measured by the clock of the OpenTelemetry code", so Data Prepper should set it to the current time.
Based on the spec of the time field, setting it to epoch 0 seems wrong. Either the field should be dropped (because it is optional) or set to the value of observedTime. The latter would make sense, since the spec mentions: "Use Timestamp if it is present, otherwise use ObservedTimestamp".
To Reproduce
First, create a "otel-log-without-time.json" file, e.g.:
The OpenSearch document should have the observedTime set to the current time when it was ingested.
Optionally, it could be considered to set the time to the observedTime, in case it does not exist. This allows to always use the time field in an OpenSearch index pattern as time field.
Alternatively, users could achieve this behavior with a Data Prepper processor.
Screenshots
=> In case no time field is contained. In this case the logs-otel-v1-* index pattern uses time as time field. All respective logs are at epoch 0 and therefore hard to find.
Environment (please complete the following information):
DP version: 2.9.0
The text was updated successfully, but these errors were encountered:
Describe the bug
Copied content from my comment.
When sending data without observedTimeUnixNano and timeUnixNano fields directly to Data Prepper, it will create Documents in OpenSearch including the time and observedTime field set to epoch 0 (Jan 1 1970).
This makes logs very hard to find, sometimes users are under the expression that the logs weren't ingested at all, since they would only check a recent time.
Based on the spec of the observedTime field, it "is the time when OpenTelemetry’s code observed the event measured by the clock of the OpenTelemetry code", so Data Prepper should set it to the current time.
Based on the spec of the time field, setting it to epoch 0 seems wrong. Either the field should be dropped (because it is optional) or set to the value of observedTime. The latter would make sense, since the spec mentions: "Use Timestamp if it is present, otherwise use ObservedTimestamp".
To Reproduce
First, create a "otel-log-without-time.json" file, e.g.:
Second, sent it via grpcurl to Data Prepper, e.g.:
Data Prepper log pipeline looks sth. like this (highlighting that the
proto_reflection_service
is enabled for grpcurl):Resulting OpenSearch doc:
Expected behavior
The OpenSearch document should have the
observedTime
set to the current time when it was ingested.Optionally, it could be considered to set the
time
to theobservedTime
, in case it does not exist. This allows to always use thetime
field in an OpenSearch index pattern as time field.Alternatively, users could achieve this behavior with a Data Prepper processor.
Screenshots
=> In case no time field is contained. In this case the
logs-otel-v1-*
index pattern usestime
as time field. All respective logs are at epoch 0 and therefore hard to find.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: