Skip to content

Conversation

PraveenJeffriAndroidDeveloper
Copy link

@PraveenJeffriAndroidDeveloper PraveenJeffriAndroidDeveloper commented Sep 2, 2025

This PR documents the logs_body_key_attributes option for the OpenTelemetry output plugin.
It allows placing the JSON body content inside attributes of the OTEL LogRecord.
This feature is mentioned in issues (fluent/fluent-bit#10445), but not in the docs.

Signed-off-by: PraveenJeffriAndroidDeveloper <praveenjeffri@gmail.com>
Copy link
Contributor

@esmerel esmerel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor stylistic suggestion, otherwise lgtm, thanks!

| `logs_span_id_metadata_key` | Specify a `SpanId` key` to look up in the metadata. | `$SpanId` |
| `logs_trace_id_metadata_key` | Specify a `TraceId` key to look up in the metadata. | `$TraceId` |
| `logs_attributes_metadata_key` | Specify an `Attributes` key to look up in the metadata. | `$Attributes` |
| `logs_body_key_attributes` | When enabled (`true`), Fluent Bit will place all parsed JSON fields (except the one mapped by `logs_body_key`) inside the `attributes` section of the OpenTelemetry `LogRecord`. This is useful if you want structured key/value pairs as attributes, while still mapping a specific field (defined by `logs_body_key`) to the `body`. | `false` |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `logs_body_key_attributes` | When enabled (`true`), Fluent Bit will place all parsed JSON fields (except the one mapped by `logs_body_key`) inside the `attributes` section of the OpenTelemetry `LogRecord`. This is useful if you want structured key/value pairs as attributes, while still mapping a specific field (defined by `logs_body_key`) to the `body`. | `false` |
| `logs_body_key_attributes` | When enabled (`true`), Fluent Bit places all parsed JSON fields (except the one mapped by `logs_body_key`) inside the `attributes` section of the OpenTelemetry `LogRecord`. Use to create structured key/value pairs as attributes, while still mapping a specific field (defined by `logs_body_key`) to the `body`. | `false` |

Just trying to make it a little more active and avoid "useful". Looks good to me though!

@fluent/fluent-bit-maintainers should review for technical accuracy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants