-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[summerospp]add fluentbit opentelemetry plugin (#890)
* [summerospp]add fluentbit opentelemetry plugin Signed-off-by: 刘帅军 <liudonglan@liudonglandeMacBook-Pro.local> * [summerospp]add fluentbit opentelemetry plugin Signed-off-by: 刘帅军 <liudonglan@192.168.2.101> * [summerospp]add fluentbit opentelemetry plugin Signed-off-by: 刘帅军 <liudonglan@192.168.2.101> * Delete .DS_Store Signed-off-by: SjLiu <139106424+sjliu1@users.noreply.github.com> --------- Signed-off-by: 刘帅军 <liudonglan@liudonglandeMacBook-Pro.local> Signed-off-by: 刘帅军 <liudonglan@192.168.2.101> Signed-off-by: Elon Cheng <dehaocheng@kubesphere.io> Signed-off-by: SjLiu <139106424+sjliu1@users.noreply.github.com> Co-authored-by: 刘帅军 <liudonglan@liudonglandeMacBook-Pro.local> Co-authored-by: 刘帅军 <liudonglan@192.168.2.101> Co-authored-by: Elon Cheng <dehaocheng@kubesphere.io>
- Loading branch information
1 parent
3c42ca7
commit 9f220bc
Showing
19 changed files
with
338 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
apis/fluentbit/v1alpha2/plugins/input/open_telemetry_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package input | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins" | ||
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins/params" | ||
) | ||
|
||
// +kubebuilder:object:generate:=true | ||
|
||
// The OpenTelemetry plugin allows you to ingest telemetry data as per the OTLP specification, <br /> | ||
// from various OpenTelemetry exporters, the OpenTelemetry Collector, or Fluent Bit's OpenTelemetry output plugin. <br /> | ||
// **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/opentelemetry** | ||
type OpenTelemetry struct { | ||
// The address to listen on,default 0.0.0.0 | ||
Listen string `json:"listen,omitempty"` | ||
// The port for Fluent Bit to listen on.default 4318. | ||
// +kubebuilder:validation:Minimum:=1 | ||
// +kubebuilder:validation:Maximum:=65535 | ||
Port *int32 `json:"port,omitempty"` | ||
// Specify the key name to overwrite a tag. If set, the tag will be overwritten by a value of the key. | ||
Tagkey string `json:"tagKey,omitempty"` | ||
// Route trace data as a log message(default false). | ||
RawTraces *bool `json:"rawTraces,omitempty"` | ||
// Specify the maximum buffer size in KB to receive a JSON message(default 4M). | ||
// +kubebuilder:validation:Pattern:="^\\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$" | ||
BufferMaxSize string `json:"bufferMaxSize,omitempty"` | ||
// 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). | ||
// +kubebuilder:validation:Pattern:="^\\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$" | ||
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"` | ||
} | ||
|
||
func (_ *OpenTelemetry) Name() string { | ||
return "opentelemetry" | ||
} | ||
|
||
// implement Section() method | ||
func (ot *OpenTelemetry) Params(_ plugins.SecretLoader) (*params.KVs, error) { | ||
kvs := params.NewKVs() | ||
if ot.Listen != "" { | ||
kvs.Insert("listen", ot.Listen) | ||
} | ||
if ot.Port != nil { | ||
kvs.Insert("port", fmt.Sprint(*ot.Port)) | ||
} | ||
if ot.Tagkey != "" { | ||
kvs.Insert("tag_key", ot.Tagkey) | ||
} | ||
if ot.RawTraces != nil { | ||
kvs.Insert("raw_traces", fmt.Sprint(*ot.RawTraces)) | ||
} | ||
if ot.BufferMaxSize != "" { | ||
kvs.Insert("buffer_max_size", ot.BufferMaxSize) | ||
} | ||
if ot.BufferChunkSize != "" { | ||
kvs.Insert("buffer_chunk_size", ot.BufferChunkSize) | ||
} | ||
if ot.SuccessfulResponseCode != nil { | ||
kvs.Insert("successful_response_code", fmt.Sprint(*ot.SuccessfulResponseCode)) | ||
} | ||
return kvs, nil | ||
} |
30 changes: 30 additions & 0 deletions
30
apis/fluentbit/v1alpha2/plugins/input/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Forward | ||
|
||
Forward defines the in_forward Input plugin that listens to TCP socket to recieve the event stream. **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/forward** | ||
|
||
|
||
| Field | Description | Scheme | | ||
| ----- | ----------- | ------ | | ||
| port | Port for forward plugin instance. | *int32 | | ||
| listen | Listener network interface. | string | | ||
| tag | in_forward uses the tag value for incoming logs. If not set it uses tag from incoming log. | string | | ||
| tagPrefix | Adds the prefix to incoming event's tag | string | | ||
| unixPath | Specify the path to unix socket to recieve a forward message. If set, Listen and port are ignnored. | string | | ||
| unixPerm | Set the permission of unix socket file. | string | | ||
| bufferMaxSize | Specify maximum buffer memory size used to recieve a forward message. The value must be according to the Unit Size specification. | string | | ||
| bufferchunkSize | Set the initial buffer size to store incoming data. This value is used too to increase buffer size as required. The value must be according to the Unit Size specification. | string | | ||
| threaded | Threaded mechanism allows input plugin to run in a separate thread which helps to desaturate the main pipeline. | string | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# OpenTelemetry | ||
|
||
The OpenTelemetry plugin allows you to ingest telemetry data as per the OTLP specification, <br /> from various OpenTelemetry exporters, the OpenTelemetry Collector, or Fluent Bit's OpenTelemetry output plugin. <br /> **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/opentelemetry** | ||
|
||
|
||
| Field | Description | Scheme | | ||
| ----- | ----------- | ------ | | ||
| listen | The address to listen on,default 0.0.0.0 | string | | ||
| port | The port for Fluent Bit to listen on.default 4318. | *int32 | | ||
| tagKey | Specify the key name to overwrite a tag. If set, the tag will be overwritten by a value of the key. | string | | ||
| rawTraces | Route trace data as a log message(default false). | *bool | | ||
| 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# PrometheusExporter | ||
|
||
PrometheusExporter An output plugin to expose Prometheus Metrics. <br /> The prometheus exporter allows you to take metrics from Fluent Bit and expose them such that a Prometheus instance can scrape them. <br /> **Important Note: The prometheus exporter only works with metric plugins, such as Node Exporter Metrics** <br /> **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/outputs/prometheus-exporter** | ||
|
||
|
||
| Field | Description | Scheme | | ||
| ----- | ----------- | ------ | | ||
| host | IP address or hostname of the target HTTP Server, default: 0.0.0.0 | string | | ||
| port | This is the port Fluent Bit will bind to when hosting prometheus metrics. | *int32 | | ||
| addLabels | This allows you to add custom labels to all metrics exposed through the prometheus exporter. You may have multiple of these fields | map[string]string | |
Oops, something went wrong.