-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Component(s)
pkg/stanza, receiver/filelog
Is your feature request related to a problem? Please describe.
Reopen #34053: "When sending logs to an intermediate service such as Kafka, there are times when unicity and order of messages are not 100% guaranteed."
Describe the solution you'd like
It would be useful to be able to insert the offset of each log record as an attribute, to be able to guarantee order and unicity of logs when sending them to an intermediate service before the backend.
A config parameter such as include_file_offset seems appropriate
Describe alternatives you've considered
Currently, there exists the include_file_record_number
attribute but it is not exactly similar to a file offset. Log collection backends that want to move from filebeat to OpenTelemetry in particular could have issues if they use filebeat's file offset to detect duplicate, out of order and missing logs.
One solution is to recreate file offset using record number and length, but as of right now I don't think this is possible in the collector since you would also need the previous record's offset to get the current one.
This would obviously be doable on the backend side but including it directly into the record makes the transition from filebeat to OpenTelemetry almost transparent which is optimal
Additional context
No response