Skip to content
Open
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
12 changes: 6 additions & 6 deletions apis/fluentbit/v1alpha2/clusteroutput_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ func TestLokiOutputWithStructuredMetadata_Load(t *testing.T) {
"trace_id": "${record['trace_id']}",
},
StructuredMetadataKeys: []string{
"level",
"caller",
"$kubernetes['labels']",
"$kubernetes['annotations']",
},
},
},
Expand All @@ -462,7 +462,7 @@ func TestLokiOutputWithStructuredMetadata_Load(t *testing.T) {
port 3100
labels environment=production,job=fluentbit
structured_metadata container=${record['kubernetes']['container_name']},pod=${record['kubernetes']['pod_name']},trace_id=${record['trace_id']}
structured_metadata_keys level,caller
structured_metadata_map_keys $kubernetes['labels'],$kubernetes['annotations']
`

result, err := outputs.Load(sl)
Expand Down Expand Up @@ -497,8 +497,8 @@ func TestLokiOutputWithStructuredMetadata_LoadAsYaml(t *testing.T) {
"trace_id": "${record['trace_id']}",
},
StructuredMetadataKeys: []string{
"level",
"caller",
"$kubernetes['labels']",
"$kubernetes['annotations']",
},
},
},
Expand All @@ -515,7 +515,7 @@ func TestLokiOutputWithStructuredMetadata_LoadAsYaml(t *testing.T) {
port: 3100
labels: environment=production,job=fluentbit
structured_metadata: container=${record['kubernetes']['container_name']},pod=${record['kubernetes']['pod_name']},trace_id=${record['trace_id']}
structured_metadata_keys: level,caller
structured_metadata_map_keys: $kubernetes['labels'],$kubernetes['annotations']
`

result, err := outputs.LoadAsYaml(sl, 0)
Expand Down
7 changes: 4 additions & 3 deletions apis/fluentbit/v1alpha2/plugins/output/loki_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ type Loki struct {
// This is used for high cardinality data that isn't suited for using labels.
// Only supported in Loki 3.0+ with schema v13 and TSDB storage.
StructuredMetadata map[string]string `json:"structuredMetadata,omitempty"`
// Optional list of record keys that will be placed as structured metadata.
// This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys.
// Optional list of record keys whose values are maps, written as structured_metadata_map_keys.
// Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']).
// Requires Fluent Bit 4.0+.
StructuredMetadataKeys []string `json:"structuredMetadataKeys,omitempty"`
*plugins.TLS `json:"tls,omitempty"`
// Include fluentbit networking options for this output-plugin
Expand Down Expand Up @@ -164,7 +165,7 @@ func (l *Loki) Params(sl plugins.SecretLoader) (*params.KVs, error) {
}

if len(l.StructuredMetadataKeys) > 0 {
kvs.Insert("structured_metadata_keys", strings.Join(l.StructuredMetadataKeys, ","))
kvs.Insert("structured_metadata_map_keys", strings.Join(l.StructuredMetadataKeys, ","))
}

return kvs, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2778,8 +2778,9 @@ spec:
type: object
structuredMetadataKeys:
description: |-
Optional list of record keys that will be placed as structured metadata.
This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys.
Optional list of record keys whose values are maps, written as structured_metadata_map_keys.
Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']).
Requires Fluent Bit 4.0+.
items:
type: string
type: array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2778,8 +2778,9 @@ spec:
type: object
structuredMetadataKeys:
description: |-
Optional list of record keys that will be placed as structured metadata.
This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys.
Optional list of record keys whose values are maps, written as structured_metadata_map_keys.
Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']).
Requires Fluent Bit 4.0+.
items:
type: string
type: array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2776,8 +2776,9 @@ spec:
type: object
structuredMetadataKeys:
description: |-
Optional list of record keys that will be placed as structured metadata.
This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys.
Optional list of record keys whose values are maps, written as structured_metadata_map_keys.
Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']).
Requires Fluent Bit 4.0+.
items:
type: string
type: array
Expand Down
5 changes: 3 additions & 2 deletions charts/fluent-operator/crds/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2776,8 +2776,9 @@ spec:
type: object
structuredMetadataKeys:
description: |-
Optional list of record keys that will be placed as structured metadata.
This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys.
Optional list of record keys whose values are maps, written as structured_metadata_map_keys.
Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']).
Requires Fluent Bit 4.0+.
items:
type: string
type: array
Expand Down
5 changes: 3 additions & 2 deletions config/crd/bases/fluentbit.fluent.io_clusteroutputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2777,8 +2777,9 @@ spec:
type: object
structuredMetadataKeys:
description: |-
Optional list of record keys that will be placed as structured metadata.
This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys.
Optional list of record keys whose values are maps, written as structured_metadata_map_keys.
Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']).
Requires Fluent Bit 4.0+.
items:
type: string
type: array
Expand Down
5 changes: 3 additions & 2 deletions config/crd/bases/fluentbit.fluent.io_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2777,8 +2777,9 @@ spec:
type: object
structuredMetadataKeys:
description: |-
Optional list of record keys that will be placed as structured metadata.
This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys.
Optional list of record keys whose values are maps, written as structured_metadata_map_keys.
Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']).
Requires Fluent Bit 4.0+.
items:
type: string
type: array
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/fluentbit/output/loki.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The loki output plugin, allows to ingest your records into a Loki service. <br /
| autoKubernetesLabels | If set to true, it will add all Kubernetes labels to the Stream labels. | string |
| tenantIDKey | Specify the name of the key from the original record that contains the Tenant ID. The value of the key is set as X-Scope-OrgID of HTTP header. It is useful to set Tenant ID dynamically. | string |
| structuredMetadata | Stream structured metadata for API request. It can be multiple comma separated key=value pairs. This is used for high cardinality data that isn't suited for using labels. Only supported in Loki 3.0+ with schema v13 and TSDB storage. | map[string]string |
| structuredMetadataKeys | Optional list of record keys that will be placed as structured metadata. This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys. | []string |
| structuredMetadataKeys | Optional list of record keys whose values are maps, written as structured_metadata_map_keys. Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']). Requires Fluent Bit 4.0+. | []string |
| tls | | *[plugins.TLS](../tls.md) |
| networking | Include fluentbit networking options for this output-plugin | *[plugins.Networking](../net.md) |
| totalLimitSize | Limit the maximum number of Chunks in the filesystem for the current output logical destination. | string |
Expand Down
10 changes: 6 additions & 4 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7054,8 +7054,9 @@ spec:
type: object
structuredMetadataKeys:
description: |-
Optional list of record keys that will be placed as structured metadata.
This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys.
Optional list of record keys whose values are maps, written as structured_metadata_map_keys.
Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']).
Requires Fluent Bit 4.0+.
items:
type: string
type: array
Expand Down Expand Up @@ -38835,8 +38836,9 @@ spec:
type: object
structuredMetadataKeys:
description: |-
Optional list of record keys that will be placed as structured metadata.
This allows using record accessor patterns (e.g. $kubernetes['pod_name']) to reference record keys.
Optional list of record keys whose values are maps, written as structured_metadata_map_keys.
Every key/value pair of those maps is added as structured metadata (e.g. $kubernetes['labels']).
Requires Fluent Bit 4.0+.
items:
type: string
type: array
Expand Down
Loading