Skip to content

Commit 8ecf48b

Browse files
authored
Merge pull request #1255 from smallc2009/add-tag-from-uri
add tag and tag_from_uri for opentelemetry input plugin
2 parents 4f02f21 + 721681a commit 8ecf48b

File tree

7 files changed

+45
-0
lines changed

7 files changed

+45
-0
lines changed

apis/fluentbit/v1alpha2/plugins/input/open_telemetry_types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ type OpenTelemetry struct {
3131
BufferChunkSize string `json:"bufferChunkSize,omitempty"`
3232
//It allows to set successful response code. 200, 201 and 204 are supported(default 201).
3333
SuccessfulResponseCode *int32 `json:"successfulResponseCode,omitempty"`
34+
// opentelemetry uses the tag value for incoming metrics.
35+
Tag string `json:"tag,omitempty"`
36+
// If true, tag will be created from uri. e.g. v1_metrics from /v1/metrics
37+
TagFromURI *bool `json:"tagFromURI,omitempty"`
3438
}
3539

3640
func (_ *OpenTelemetry) Name() string {
@@ -61,5 +65,11 @@ func (ot *OpenTelemetry) Params(_ plugins.SecretLoader) (*params.KVs, error) {
6165
if ot.SuccessfulResponseCode != nil {
6266
kvs.Insert("successful_response_code", fmt.Sprint(*ot.SuccessfulResponseCode))
6367
}
68+
if ot.Tag != "" {
69+
kvs.Insert("tag", ot.Tag)
70+
}
71+
if ot.TagFromURI != nil {
72+
kvs.Insert("tag_from_uri", fmt.Sprint(*ot.TagFromURI))
73+
}
6474
return kvs, nil
6575
}

apis/fluentbit/v1alpha2/plugins/input/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,13 @@ spec:
428428
and 204 are supported(default 201).
429429
format: int32
430430
type: integer
431+
tag:
432+
description: opentelemetry uses the tag value for incoming metrics.
433+
type: string
434+
tagFromURI:
435+
description: If true, tag will be created from uri. e.g. v1_metrics
436+
from /v1/metrics
437+
type: boolean
431438
tagKey:
432439
description: Specify the key name to overwrite a tag. If set,
433440
the tag will be overwritten by a value of the key.

config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,13 @@ spec:
428428
and 204 are supported(default 201).
429429
format: int32
430430
type: integer
431+
tag:
432+
description: opentelemetry uses the tag value for incoming metrics.
433+
type: string
434+
tagFromURI:
435+
description: If true, tag will be created from uri. e.g. v1_metrics
436+
from /v1/metrics
437+
type: boolean
431438
tagKey:
432439
description: Specify the key name to overwrite a tag. If set,
433440
the tag will be overwritten by a value of the key.

docs/plugins/fluentbit/input/open_telemetry.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ The OpenTelemetry plugin allows you to ingest telemetry data as per the OTLP spe
1212
| bufferMaxSize | Specify the maximum buffer size in KB to receive a JSON message(default 4M). | string |
1313
| bufferChunkSize | This sets the chunk size for incoming incoming JSON messages. These chunks are then stored/managed in the space available by buffer_max_size(default 512K). | string |
1414
| successfulResponseCode | It allows to set successful response code. 200, 201 and 204 are supported(default 201). | *int32 |
15+
| tag | opentelemetry uses the tag value for incoming metrics. | string |
16+
| tagFromURI | If true, tag will be created from uri. e.g. v1_metrics from /v1/metrics | *bool |

manifests/setup/fluent-operator-crd.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,13 @@ spec:
23962396
and 204 are supported(default 201).
23972397
format: int32
23982398
type: integer
2399+
tag:
2400+
description: opentelemetry uses the tag value for incoming metrics.
2401+
type: string
2402+
tagFromURI:
2403+
description: If true, tag will be created from uri. e.g. v1_metrics
2404+
from /v1/metrics
2405+
type: boolean
23992406
tagKey:
24002407
description: Specify the key name to overwrite a tag. If set,
24012408
the tag will be overwritten by a value of the key.

manifests/setup/setup.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,6 +2396,13 @@ spec:
23962396
and 204 are supported(default 201).
23972397
format: int32
23982398
type: integer
2399+
tag:
2400+
description: opentelemetry uses the tag value for incoming metrics.
2401+
type: string
2402+
tagFromURI:
2403+
description: If true, tag will be created from uri. e.g. v1_metrics
2404+
from /v1/metrics
2405+
type: boolean
23992406
tagKey:
24002407
description: Specify the key name to overwrite a tag. If set,
24012408
the tag will be overwritten by a value of the key.

0 commit comments

Comments
 (0)