Repository navigation
Conversation
logs_body_key_attributes adds every record field left over after the body as an attribute, so fields already mapped to first-class OTLP fields, like TraceId or SeverityText, are sent twice. Turning the option off drops the fields that should stay attributes too. Add logs_body_key_attributes_exclude, a comma separated list of record keys that are skipped when the leftover fields are turned into attributes. Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
…exclude Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Docs PR: fluent/fluent-bit-docs#2848 |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
With
logs_body_key_attributes: on, every field left over after the body becomes an attribute, including the ones already mapped to first-class OTLP fields throughlogs_trace_id_message_key,logs_severity_text_message_keyand so on. SoTraceIdandSeverityTextend up both on the record and in its attributes. Turning the option off isn't a way out, since it also drops the fields people want as attributes.This adds
logs_body_key_attributes_exclude, a comma separated list of record keys that are skipped when the leftover fields are turned into attributes:Keys are matched by exact name against the top-level record keys. Nothing changes when the option isn't set.
Fixes #12735
Enter
[N/A]in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
I'll open the docs PR in fluent-bit-docs.
Backporting
Notes
I went with the exclude list from the issue rather than having the
logs_*_message_keyaccessors consume their keys, since that would change the output for everyone already usinglogs_body_key_attributes.test_out_opentelemetry_logs_body_key_attributes_excludein the out_opentelemetry integration scenario sends a record withTraceId,SeverityTextandthread, and checks the trace ID and severity are set on the record,threadis an attribute, and the two excluded keys aren't. I haven't run it or valgrind locally, I'm relying on CI.Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit