-
Notifications
You must be signed in to change notification settings - Fork 889
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
Decide if we need log record ID field #597
Comments
ULIDs may be a good fit for purpose: https://github.com/ulid/spec (but we probably should only recommend, not mandate them if we decide to use them). |
This was discussed in the Log SIG today, where the consensus was that we do not need to make a decision on this prior to declaring the log data model stable. |
I think ULID would be very helpful to have as we could retain order of messages that way |
We can define a semantic convention for an attribute with ULID value. |
Copying over my use cases from the duplicate issue #2989:
Based on the conversation during the SIG call, I understand that there are a few questions that need to be answered:
I probably miss something, but it should be possible to do (1). If I understand it correctly, there are 2 cases where a LogRecord gets created: by calling the Logs API or at the collector, when a log line gets ingested:
For (2) I don't know enough about different algorithms to compute unique IDs, what does ULID provide? Finally (3) is a "nice-to-have" but probably not needed, the existing ID could be stored separately |
I believe it needs to be optional since we must be able to represent external log records and not all log sources have an equivalent field. Yes, we can generate one when converting from external source to Otel, but I think it the id is a lot less useful in that case since we can't guarantee we don't read an external log record twice and assign it different ids, which defeats the purpose.
I think global uniqueness is more valuable and is not very difficult to implement (generating a 128 bit UUID or ULID should be enough?).
If we go for global uniqueness these won't work. AFAIK, windows events generate host-uniquie ids. These can still be recorded as windows-event-specific id attribute in addition to the global log record id.
Correct.
I think this is also correct with the caveat that if you use the Collector to read some external log source and happen to do it twice ("I have two observability tools where I ingest my log records" may be interpreted this way) then the same log record will get assigned different ids. I think this is ok and it is a likely usage of a Collector.
ULIDs are like UUIDs, they are 128 bit, with the added benefits of (from Otel's perspective):
|
For deduplication yes, it will loose it's value, but for the other use cases (e.g. linking across backends) it still would be good to have some certainty that the ID is available, although it still works with an optional ID created at the SDK/collector. Let me take some time to write a proposal for the semantic convention, so we have something tangible to discuss. |
I created #3047 for this |
Fixes #597 ## Changes - Add a section for "generic attributes" to the log semconv - Add an attribute `log_record.id` making use of ULID as discussed in #597 Some additional notes: - I kept the PR small, so I left out some other potential attributes, e.g. something for pre-existing ID (like windows event logs) or for storing the used logging/eventing system or even something like a "signature" that might be worth discussing, etc. - I followed the structure of "generic attributes" from the spans semconv - I took some of the existing wording from #597 & open-telemetry/oteps#97 (comment) to describe the field --------- Signed-off-by: svrnm <neumanns@cisco.com> Co-authored-by: Joao Grassi <joao@joaograssi.com> Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com> Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
Fixes open-telemetry#597 ## Changes - Add a section for "generic attributes" to the log semconv - Add an attribute `log_record.id` making use of ULID as discussed in open-telemetry#597 Some additional notes: - I kept the PR small, so I left out some other potential attributes, e.g. something for pre-existing ID (like windows event logs) or for storing the used logging/eventing system or even something like a "signature" that might be worth discussing, etc. - I followed the structure of "generic attributes" from the spans semconv - I took some of the existing wording from open-telemetry#597 & open-telemetry/oteps#97 (comment) to describe the field --------- Signed-off-by: svrnm <neumanns@cisco.com> Co-authored-by: Joao Grassi <joao@joaograssi.com> Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com> Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
See discussion here open-telemetry/oteps#97 (comment)
Log Data model currently does not contain a field that identifies the log record, however having such field may be desirable.
We need to decide if we want such a field and if yes how it will be represented.
This can be added to the Data Model as an optional field, which will ensure we are not breaking the data model.
The text was updated successfully, but these errors were encountered: