Skip to content

Added the ability to set Use_Tag_For_Meta on fluentbit kubernetes filter #1565

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

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
5 changes: 5 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/filter/kubernetes_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ type Kubernetes struct {
NamespaceMetadataOnly *bool `json:"namespaceMetadataOnly,omitempty"`
// Include Kubernetes owner references in the extra metadata.
OwnerReferences *bool `json:"ownerReferences,omitempty"`
// If true, Kubernetes metadata (e.g., pod_name, container_name, namespace_name etc) will be extracted from the tag itself.
UseTagForMeta *bool `json:"useTagForMeta,omitempty"`
}

func (_ *Kubernetes) Name() string {
Expand Down Expand Up @@ -222,6 +224,9 @@ func (k *Kubernetes) Params(_ plugins.SecretLoader) (*params.KVs, error) {
if k.OwnerReferences != nil {
kvs.Insert("Owner_References", fmt.Sprint(*k.OwnerReferences))
}
if k.UseTagForMeta != nil {
kvs.Insert("Use_Tag_For_Meta", fmt.Sprint(*k.UseTagForMeta))
}
return kvs, 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 @@ -317,6 +317,11 @@ spec:
instead of calling Kube Server API to enhance the log.
This could mitigate the Kube API heavy traffic issue for large cluster.
type: boolean
useTagForMeta:
description: If true, Kubernetes metadata (e.g., pod_name,
container_name, namespace_name etc) will be extracted
from the tag itself.
type: boolean
type: object
logToMetrics:
description: LogToMetrics defines a Log to Metrics Filter configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ spec:
instead of calling Kube Server API to enhance the log.
This could mitigate the Kube API heavy traffic issue for large cluster.
type: boolean
useTagForMeta:
description: If true, Kubernetes metadata (e.g., pod_name,
container_name, namespace_name etc) will be extracted
from the tag itself.
type: boolean
type: object
logToMetrics:
description: LogToMetrics defines a Log to Metrics Filter configuration.
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusterfilters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ spec:
instead of calling Kube Server API to enhance the log.
This could mitigate the Kube API heavy traffic issue for large cluster.
type: boolean
useTagForMeta:
description: If true, Kubernetes metadata (e.g., pod_name,
container_name, namespace_name etc) will be extracted
from the tag itself.
type: boolean
type: object
logToMetrics:
description: LogToMetrics defines a Log to Metrics Filter configuration.
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ spec:
instead of calling Kube Server API to enhance the log.
This could mitigate the Kube API heavy traffic issue for large cluster.
type: boolean
useTagForMeta:
description: If true, Kubernetes metadata (e.g., pod_name,
container_name, namespace_name etc) will be extracted
from the tag itself.
type: boolean
type: object
logToMetrics:
description: LogToMetrics defines a Log to Metrics Filter configuration.
Expand Down
1 change: 1 addition & 0 deletions docs/plugins/fluentbit/filter/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ Kubernetes filter allows to enrich your log files with Kubernetes metadata. <br
| namespaceAnnotations | Include Kubernetes namespace resource annotations in the extra metadata. | *bool |
| namespaceMetadataOnly | Include Kubernetes namespace metadata only and no pod metadata. If this is set, the values of Labels and Annotations are ignored. | *bool |
| ownerReferences | Include Kubernetes owner references in the extra metadata. | *bool |
| useTagForMeta | If true, Kubernetes metadata (e.g., pod_name, container_name, namespace_name etc) will be extracted from the tag itself. | *bool |
10 changes: 10 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ spec:
instead of calling Kube Server API to enhance the log.
This could mitigate the Kube API heavy traffic issue for large cluster.
type: boolean
useTagForMeta:
description: If true, Kubernetes metadata (e.g., pod_name,
container_name, namespace_name etc) will be extracted
from the tag itself.
type: boolean
type: object
logToMetrics:
description: LogToMetrics defines a Log to Metrics Filter configuration.
Expand Down Expand Up @@ -15053,6 +15058,11 @@ spec:
instead of calling Kube Server API to enhance the log.
This could mitigate the Kube API heavy traffic issue for large cluster.
type: boolean
useTagForMeta:
description: If true, Kubernetes metadata (e.g., pod_name,
container_name, namespace_name etc) will be extracted
from the tag itself.
type: boolean
type: object
logToMetrics:
description: LogToMetrics defines a Log to Metrics Filter configuration.
Expand Down
10 changes: 10 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ spec:
instead of calling Kube Server API to enhance the log.
This could mitigate the Kube API heavy traffic issue for large cluster.
type: boolean
useTagForMeta:
description: If true, Kubernetes metadata (e.g., pod_name,
container_name, namespace_name etc) will be extracted
from the tag itself.
type: boolean
type: object
logToMetrics:
description: LogToMetrics defines a Log to Metrics Filter configuration.
Expand Down Expand Up @@ -15053,6 +15058,11 @@ spec:
instead of calling Kube Server API to enhance the log.
This could mitigate the Kube API heavy traffic issue for large cluster.
type: boolean
useTagForMeta:
description: If true, Kubernetes metadata (e.g., pod_name,
container_name, namespace_name etc) will be extracted
from the tag itself.
type: boolean
type: object
logToMetrics:
description: LogToMetrics defines a Log to Metrics Filter configuration.
Expand Down
Loading