Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add logs_body_key_attributes option for OpenTelemetry output plugin #1322

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ type OpenTelemetry struct {
// Log the response payload within the Fluent Bit log.
LogResponsePayload *bool `json:"logResponsePayload,omitempty"`
// This allows you to add custom labels to all metrics exposed through the OpenTelemetry exporter. You may have multiple of these fields.
AddLabel map[string]string `json:"addLabel,omitempty"`
*plugins.TLS `json:"tls,omitempty"`
AddLabel map[string]string `json:"addLabel,omitempty"`
// If true, remaining unmatched keys are added as attributes.
LogsBodyKeyAttributes *bool `json:"logsBodyKeyAttributes,omitempty"`
*plugins.TLS `json:"tls,omitempty"`
// Include fluentbit networking options for this output-plugin
*plugins.Networking `json:"networking,omitempty"`
}
Expand Down Expand Up @@ -91,6 +93,9 @@ func (o *OpenTelemetry) Params(sl plugins.SecretLoader) (*params.KVs, error) {
kvs.InsertStringMap(o.AddLabel, func(k, v string) (string, string) {
return "add_label", fmt.Sprintf(" %s %s", k, v)
})
if o.LogsBodyKeyAttributes != nil {
kvs.Insert("logs_body_key_attributes", fmt.Sprint(*o.LogsBodyKeyAttributes))
}
if o.TLS != nil {
tls, err := o.TLS.Params(sl)
if err != nil {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,9 @@ spec:
logResponsePayload:
description: Log the response payload within the Fluent Bit log.
type: boolean
logsBodyKeyAttributes:
description: If true, remaining unmatched keys are added as attributes.
type: boolean
logsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for logs, e.g: /v1/logs'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,9 @@ spec:
logResponsePayload:
description: Log the response payload within the Fluent Bit log.
type: boolean
logsBodyKeyAttributes:
description: If true, remaining unmatched keys are added as attributes.
type: boolean
logsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for logs, e.g: /v1/logs'
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,9 @@ spec:
logResponsePayload:
description: Log the response payload within the Fluent Bit log.
type: boolean
logsBodyKeyAttributes:
description: If true, remaining unmatched keys are added as attributes.
type: boolean
logsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for logs, e.g: /v1/logs'
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2856,6 +2856,9 @@ spec:
logResponsePayload:
description: Log the response payload within the Fluent Bit log.
type: boolean
logsBodyKeyAttributes:
description: If true, remaining unmatched keys are added as attributes.
type: boolean
logsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for logs, e.g: /v1/logs'
Expand Down
1 change: 1 addition & 0 deletions docs/plugins/fluentbit/output/open_telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The OpenTelemetry plugin allows you to take logs, metrics, and traces from Fluen
| tracesUri | Specify an optional HTTP URI for the target web server listening for traces, e.g: /v1/traces | string |
| header | Add a HTTP header key/value pair. Multiple headers can be set. | map[string]string |
| logResponsePayload | Log the response payload within the Fluent Bit log. | *bool |
| logsBodyKeyAttributes | Adds unmatched keys as attributes when true. | *bool |
| addLabel | This allows you to add custom labels to all metrics exposed through the OpenTelemetry exporter. You may have multiple of these fields. | map[string]string |
| tls | | *[plugins.TLS](../tls.md) |
| networking | Include fluentbit networking options for this output-plugin | *plugins.Networking |
6 changes: 6 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6793,6 +6793,9 @@ spec:
logResponsePayload:
description: Log the response payload within the Fluent Bit log.
type: boolean
logsBodyKeyAttributes:
description: If true, remaining unmatched keys are added as attributes.
type: boolean
logsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for logs, e.g: /v1/logs'
Expand Down Expand Up @@ -35349,6 +35352,9 @@ spec:
logResponsePayload:
description: Log the response payload within the Fluent Bit log.
type: boolean
logsBodyKeyAttributes:
description: If true, remaining unmatched keys are added as attributes.
type: boolean
logsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for logs, e.g: /v1/logs'
Expand Down
6 changes: 6 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6793,6 +6793,9 @@ spec:
logResponsePayload:
description: Log the response payload within the Fluent Bit log.
type: boolean
logsBodyKeyAttributes:
description: If true, remaining unmatched keys are added as attributes.
type: boolean
logsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for logs, e.g: /v1/logs'
Expand Down Expand Up @@ -35349,6 +35352,9 @@ spec:
logResponsePayload:
description: Log the response payload within the Fluent Bit log.
type: boolean
logsBodyKeyAttributes:
description: If true, remaining unmatched keys are added as attributes.
type: boolean
logsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for logs, e.g: /v1/logs'
Expand Down
Loading