Skip to content

Commit

Permalink
Merge pull request #708 from JensLoe/master
Browse files Browse the repository at this point in the history
Add uri field for each telemetry type in opentelemetry plugin, remove old uri field
  • Loading branch information
benjaminhuo committed May 4, 2023
2 parents 41bd8fe + 75ce9ab commit c3e1dcb
Show file tree
Hide file tree
Showing 17 changed files with 2,199 additions and 246 deletions.
22 changes: 16 additions & 6 deletions apis/fluentbit/v1alpha2/plugins/output/open_telemetry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package output

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

// OpenTelemetry is An output plugin to submit Metrics to an OpenTelemetry endpoint, <br />
// allows taking metrics from Fluent Bit and submit them to an OpenTelemetry HTTP endpoint. <br />
// The OpenTelemetry plugin allows you to take logs, metrics, and traces from Fluent Bit and submit them to an OpenTelemetry HTTP endpoint. <br />
// **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/outputs/opentelemetry**
type OpenTelemetry struct {
// IP address or hostname of the target HTTP Server, default `127.0.0.1`
Expand All @@ -25,8 +25,12 @@ type OpenTelemetry struct {
// Specify an HTTP Proxy. The expected format of this value is http://HOST:PORT. Note that HTTPS is not currently supported.
// It is recommended not to set this and to configure the HTTP proxy environment variables instead as they support both HTTP and HTTPS.
Proxy string `json:"proxy,omitempty"`
// Specify an optional HTTP URI for the target web server, e.g: /something
Uri string `json:"uri,omitempty"`
// Specify an optional HTTP URI for the target web server listening for metrics, e.g: /v1/metrics
MetricsUri string `json:"metricsUri,omitempty"`
// Specify an optional HTTP URI for the target web server listening for logs, e.g: /v1/logs
LogsUri string `json:"logsUri,omitempty"`
// Specify an optional HTTP URI for the target web server listening for traces, e.g: /v1/traces
TracesUri string `json:"tracesUri,omitempty"`
// Add a HTTP header key/value pair. Multiple headers can be set.
Header map[string]string `json:"header,omitempty"`
// Log the response payload within the Fluent Bit log.
Expand Down Expand Up @@ -67,8 +71,14 @@ func (o *OpenTelemetry) Params(sl plugins.SecretLoader) (*params.KVs, error) {
if o.Proxy != "" {
kvs.Insert("proxy", o.Proxy)
}
if o.Uri != "" {
kvs.Insert("uri", o.Uri)
if o.MetricsUri != "" {
kvs.Insert("metrics_uri", o.MetricsUri)
}
if o.LogsUri != "" {
kvs.Insert("logs_uri", o.LogsUri)
}
if o.TracesUri != "" {
kvs.Insert("traces_uri", o.TracesUri)
}
kvs.InsertStringMap(o.Header, func(k, v string) (string, string) {
return "header", fmt.Sprintf(" %s %s", k, v)
Expand Down
5 changes: 5 additions & 0 deletions apis/fluentbit/v1alpha2/zz_generated.deepcopy.go

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 @@ -1039,6 +1039,205 @@ spec:
server, e.g: /something'
type: string
type: object
influxDB:
description: InfluxDB defines InfluxDB Output configuration.
properties:
autoTags:
description: Automatically tag keys where value is string.
type: boolean
bucket:
description: InfluxDB bucket name where records will be inserted
- if specified, database is ignored and v2 of API is used
type: string
database:
description: InfluxDB database name where records will be inserted.
type: string
host:
description: IP address or hostname of the target InfluxDB service.
format: ipv6
type: string
httpPassword:
description: Password for user defined in HTTP_User
properties:
valueFrom:
description: ValueSource defines how to find a value's key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
httpToken:
description: Authentication token used with InfluxDB v2 - if specified,
both HTTPUser and HTTPPasswd are ignored
properties:
valueFrom:
description: ValueSource defines how to find a value's key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
httpUser:
description: Optional username for HTTP Basic Authentication
properties:
valueFrom:
description: ValueSource defines how to find a value's key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its key
must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
org:
description: InfluxDB organization name where the bucket is (v2
only)
type: string
port:
description: TCP port of the target InfluxDB service.
format: int32
maximum: 65536
minimum: 0
type: integer
sequenceTag:
description: The name of the tag whose value is incremented for
the consecutive simultaneous events.
type: string
tagKeys:
description: List of keys that needs to be tagged
items:
type: string
type: array
tagListKey:
description: Key of the string array optionally contained within
each log record that contains tag keys for that record
type: string
tagsListEnabled:
description: Dynamically tag keys which are in the string array
at Tags_List_Key key.
type: boolean
tls:
description: Fluent Bit provides integrated support for Transport
Layer Security (TLS) and it predecessor Secure Sockets Layer
(SSL) respectively.
properties:
caFile:
description: Absolute path to CA certificate file
type: string
caPath:
description: Absolute path to scan for certificate files
type: string
crtFile:
description: Absolute path to Certificate file
type: string
debug:
description: 'Set TLS debug verbosity level. It accept the
following values: 0 (No debug), 1 (Error), 2 (State change),
3 (Informational) and 4 Verbose'
enum:
- 0
- 1
- 2
- 3
- 4
format: int32
type: integer
keyFile:
description: Absolute path to private Key file
type: string
keyPassword:
description: Optional password for tls.key_file file
properties:
valueFrom:
description: ValueSource defines how to find a value's
key.
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's
namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind,
uid?'
type: string
optional:
description: Specify whether the Secret or its
key must be defined
type: boolean
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
verify:
description: Force certificate validation
type: boolean
vhost:
description: Hostname to be used for TLS SNI extension
type: string
type: object
required:
- host
type: object
kafka:
description: Kafka defines Kafka Output configuration.
properties:
Expand Down Expand Up @@ -1663,6 +1862,14 @@ spec:
logResponsePayload:
description: Log the response payload within the Fluent Bit log.
type: boolean
logsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for logs, e.g: /v1/logs'
type: string
metricsUri:
description: 'Specify an optional HTTP URI for the target web
server listening for metrics, e.g: /v1/metrics'
type: string
port:
description: TCP port of the target OpenSearch instance, default
`80`
Expand Down Expand Up @@ -1744,9 +1951,9 @@ spec:
description: Hostname to be used for TLS SNI extension
type: string
type: object
uri:
tracesUri:
description: 'Specify an optional HTTP URI for the target web
server, e.g: /something'
server listening for traces, e.g: /v1/traces'
type: string
type: object
prometheusRemoteWrite:
Expand Down

0 comments on commit c3e1dcb

Please sign in to comment.