Skip to content
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

add tag and tag_from_uri for opentelemetry input plugin #1255

Merged
merged 1 commit into from
Jul 24, 2024
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
10 changes: 10 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/input/open_telemetry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ type OpenTelemetry struct {
BufferChunkSize string `json:"bufferChunkSize,omitempty"`
//It allows to set successful response code. 200, 201 and 204 are supported(default 201).
SuccessfulResponseCode *int32 `json:"successfulResponseCode,omitempty"`
// opentelemetry uses the tag value for incoming metrics.
Tag string `json:"tag,omitempty"`
// If true, tag will be created from uri. e.g. v1_metrics from /v1/metrics
TagFromURI *bool `json:"tagFromURI,omitempty"`
}

func (_ *OpenTelemetry) Name() string {
Expand Down Expand Up @@ -61,5 +65,11 @@ func (ot *OpenTelemetry) Params(_ plugins.SecretLoader) (*params.KVs, error) {
if ot.SuccessfulResponseCode != nil {
kvs.Insert("successful_response_code", fmt.Sprint(*ot.SuccessfulResponseCode))
}
if ot.Tag != "" {
kvs.Insert("tag", ot.Tag)
}
if ot.TagFromURI != nil {
kvs.Insert("tag_from_uri", fmt.Sprint(*ot.TagFromURI))
}
return kvs, nil
}

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 @@ -423,6 +423,13 @@ spec:
and 204 are supported(default 201).
format: int32
type: integer
tag:
description: opentelemetry uses the tag value for incoming metrics.
type: string
tagFromURI:
description: If true, tag will be created from uri. e.g. v1_metrics
from /v1/metrics
type: boolean
tagKey:
description: Specify the key name to overwrite a tag. If set,
the tag will be overwritten by a value of the key.
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,13 @@ spec:
and 204 are supported(default 201).
format: int32
type: integer
tag:
description: opentelemetry uses the tag value for incoming metrics.
type: string
tagFromURI:
description: If true, tag will be created from uri. e.g. v1_metrics
from /v1/metrics
type: boolean
tagKey:
description: Specify the key name to overwrite a tag. If set,
the tag will be overwritten by a value of the key.
Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/fluentbit/input/open_telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ The OpenTelemetry plugin allows you to ingest telemetry data as per the OTLP spe
| bufferMaxSize | Specify the maximum buffer size in KB to receive a JSON message(default 4M). | string |
| 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 |
| successfulResponseCode | It allows to set successful response code. 200, 201 and 204 are supported(default 201). | *int32 |
| tag | opentelemetry uses the tag value for incoming metrics. | string |
| tagFromURI | If true, tag will be created from uri. e.g. v1_metrics from /v1/metrics | *bool |
7 changes: 7 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2370,6 +2370,13 @@ spec:
and 204 are supported(default 201).
format: int32
type: integer
tag:
description: opentelemetry uses the tag value for incoming metrics.
type: string
tagFromURI:
description: If true, tag will be created from uri. e.g. v1_metrics
from /v1/metrics
type: boolean
tagKey:
description: Specify the key name to overwrite a tag. If set,
the tag will be overwritten by a value of the key.
Expand Down
7 changes: 7 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2370,6 +2370,13 @@ spec:
and 204 are supported(default 201).
format: int32
type: integer
tag:
description: opentelemetry uses the tag value for incoming metrics.
type: string
tagFromURI:
description: If true, tag will be created from uri. e.g. v1_metrics
from /v1/metrics
type: boolean
tagKey:
description: Specify the key name to overwrite a tag. If set,
the tag will be overwritten by a value of the key.
Expand Down
Loading