-
Notifications
You must be signed in to change notification settings - Fork 210
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
[BUG] OTEL Logs source created has observed timestamp of 1970 #2268
Comments
Hi @derek-ho, It is not clear to me what the expected behaviour/outcome is. Could you update that section of the issue to clarify? Where has the timestamp of 1970 been observed? |
Sample document:
|
@graytaylor0 details on how this was created can be found here: opensearch-project/dashboards-observability#245 (comment). I didn't want to paste a huge block of text. I also asked the initial reporter of the other issue to also record here how he got the document such as language/ingest method, etc. |
Thanks for sharing that. Looks like that field is populated by OpenTelemetry and not by data prepper (https://opentelemetry.io/docs/reference/specification/logs/data-model/#field-observedtimestamp). Have you been able to confirm if the |
@MrSparc can you add some more details? |
With the tests I did, it doesn't seem to be populated by the Data-Prepper either. I changed the
This logs to stdout shows that same Unix epoch date start date in
That value 00:00:00 [UTC] on 1 January 1970, the beginning of the Unix epoch. Now, I don't know if this field should not be sent by OpenTelemetry, or if sent as now, this value should be considered equivalent to a NULL value for date type fields and not be taken into account in filters like in the OpenSearch Observability plugin... I'm going to ping this issue on the Slack otel-cpp channel to see if someone can help us to identifiy if this it's a lib implementation issue or if it's working as expected. |
This is a bug in the C++ OpenTelemetry (otel-cpp) that will be handled by this issue open-telemetry/opentelemetry-cpp#1984 |
@ArielGMachado we should be able to close this now, right? Seems like PR is merged |
@derek-ho yes, this issue was not Data-prepper related and PR to fix otel-cpp is merged. |
Great, thanks so much @ArielGMachado , @graytaylor0 closing this now |
Hey, for me this is still a valid issue. When sending data without 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". Below some details to my test setup:
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
Resulting OpenSearch doc:
|
Well, I'm not sure if DataPrepper should set these fields or if that is the responsibility of the SDK/collector that uses the OpenTelemetry instrumentation to create the trace/log event. If we think that this event was "collected" or "sent" by an OpenTelemetry instrumentation, I think it's the event source that is responsible for including the correct fields, like for example with the traceId. But perhaps I suggest you create another issue or contact the DataPreper staff through channels like Slack to get a better opinion. |
The spec says: "is the time when OpenTelemetry’s code observed the event measured by the clock of the OpenTelemetry code". I created => #5275 let's continue the discussion there (if needed.) |
Describe the bug
Observed Timestamp is set as 1970 01 01, should this take on time if not present?
This is messing up observability plugin, which assumes observedtimestamp as the default timestamp field
To Reproduce
opensearch-project/dashboards-observability#245 (comment)
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: