Skip to content
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
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ spec:
spec:
exporters:
# OTLP HTTP exporter settings
otlphttp:
otlp_http:
enabled: true
endpoint: "https://opentelemetry-receiver.example.org"
```
Expand All @@ -106,7 +106,7 @@ spec:
spec:
exporters:
# OTLP HTTP exporter settings
otlphttp:
otlp_http:
enabled: true
endpoint: "https://opentelemetry-receiver.example.org"
token:
Expand Down Expand Up @@ -144,6 +144,41 @@ the example above to the extension, you should first create the respective
secrets in the shoot project namespace, which can then be referenced via
[Gardener Referenced Resources](https://gardener.cloud/docs/gardener/extensions/referenced-resources/#referenced-resources).

This example snippet enables the extension to forward the signals of the
control-plane components to a remote collector using the [OTLP gRPC exporter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlpexporter).

``` yaml
extensions:
- type: otelcol
providerConfig:
apiVersion: otelcol.extensions.gardener.cloud/v1alpha1
kind: CollectorConfig
spec:
# Exporters settings
exporters:
# OTLP gRPC exporter settings
otlp_grpc:
enabled: true
endpoint: "https://opentelemetry-receiver.default.svc.cluster.local:4317"
token:
resourceRef:
name: otelcol-bearer-token
dataKey: token
tls:
ca:
resourceRef:
name: otelcol-tls
dataKey: ca.crt
cert:
resourceRef:
name: otelcol-tls
dataKey: client.crt
key:
resourceRef:
name: otelcol-tls
dataKey: client.key
```

For additional configuration settings, which can be provided to the extension,
please make sure to check the
[OTel Extension API spec documentation](./docs/api-reference/otelcol.extensions.gardener.cloud.md).
Expand Down
3 changes: 1 addition & 2 deletions cmd/extension/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
ctrllog "sigs.k8s.io/controller-runtime/pkg/log"

managercmd "github.com/gardener/gardener-extension-otelcol/cmd/extension/internal/manager"
"github.com/gardener/gardener-extension-otelcol/pkg/version"
)

Expand All @@ -22,7 +21,7 @@ func main() {
EnableShellCompletion: true,
Usage: "Gardener Extension for OpenTelemetry Collector",
Commands: []*cli.Command{
managercmd.New(),
NewManagerCommand(),
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: Apache-2.0

package manager
package main

import (
"context"
Expand Down Expand Up @@ -123,8 +123,8 @@ func getFlags(ctx context.Context) *flags {
return conf
}

// New creates a new [cli.Command] for running the controller manager.
func New() *cli.Command {
// NewManagerCommand creates a new [cli.Command] for running the controller manager.
func NewManagerCommand() *cli.Command {
flags := flags{
gardenletFeatureGates: make(map[featuregate.Feature]bool),
}
Expand Down
41 changes: 37 additions & 4 deletions docs/api-reference/otelcol.extensions.gardener.cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ _Appears in:_

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `otlphttp` _[OTLPHTTPExporterConfig](#otlphttpexporterconfig)_ | HTTPExporter provides the OTLP HTTP Exporter settings. | | |
| `otlp_grpc` _[OTLPGRPCExporterConfig](#otlpgrpcexporterconfig)_ | OTLPGRPCExporter provides the OTLP gRPC Exporter settings. | | |
| `otlp_http` _[OTLPHTTPExporterConfig](#otlphttpexporterconfig)_ | HTTPExporter provides the OTLP HTTP Exporter settings. | | |
| `debug` _[DebugExporterConfig](#debugexporterconfig)_ | DebugExporter provides the settings for the debug exporter. | | |


Expand Down Expand Up @@ -98,6 +99,7 @@ Compression specifies the compression used by the collector.


_Appears in:_
- [OTLPGRPCExporterConfig](#otlpgrpcexporterconfig)
- [OTLPHTTPExporterConfig](#otlphttpexporterconfig)

| Field | Description |
Expand Down Expand Up @@ -228,6 +230,34 @@ _Appears in:_
| `detailed` | MetricsVerbosityLevelDetailed configures the collector with the most<br />verbose level, which includes dimensions and views.<br /> |


#### OTLPGRPCExporterConfig



OTLPGRPCExporterConfig provides the OTLP gRPC Exporter config settings.

See [OTLP gRPC Exporter] for more details.

[OTLP gRPC Exporter]: https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/otlpexporter



_Appears in:_
- [CollectorExportersConfig](#collectorexportersconfig)

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `enabled` _boolean_ | Enabled specifies whether the OTLP gRPC exporter is enabled or not. | | |
| `endpoint` _string_ | Endpoint specifies the gRPC endpoint to which signals will be exported.<br />Check the link below for more details about the format of this field.<br />https://github.com/grpc/grpc/blob/master/doc/naming.md | | |
| `tls` _[TLSConfig](#tlsconfig)_ | TLS specifies the TLS configuration settings for the exporter. | | |
| `token` _[ResourceReference](#resourcereference)_ | Token references a bearer token for authentication. | | |
| `timeout` _[Duration](#duration)_ | Timeout specifies the time to wait per individual attempt to send<br />data to the backend. | | |
| `read_buffer_size` _integer_ | ReadBufferSize specifies the ReadBufferSize for the gRPC<br />client. Default value is [DefaultGRPCExporterClientReadBufferSize]. | | |
| `write_buffer_size` _integer_ | WriteBufferSize specifies the WriteBufferSize for the gRPC<br />client. Default value is [DefaultGRPCExporterClientWriteBufferSize]. | | |
| `retry_on_failure` _[RetryOnFailureConfig](#retryonfailureconfig)_ | RetryOnFailure specifies the retry policy of the exporter. | | |
| `compression` _[Compression](#compression)_ | Compression specifies the compression to use. The default value is<br />[CompressionGzip]. | | |


#### OTLPHTTPExporterConfig


Expand All @@ -253,9 +283,9 @@ _Appears in:_
| `profiles_endpoint` _string_ | ProfilesEndpoint specifies the target URL to send profile data to, e.g. https://example.com:4318/v1development/profiles.<br />When this setting is present the endpoint setting is ignored for<br />profile data. | | |
| `tls` _[TLSConfig](#tlsconfig)_ | TLS specifies the TLS configuration settings for the exporter. | | |
| `token` _[ResourceReference](#resourcereference)_ | Token references a bearer token for authentication. | | |
| `timeout` _[Duration](#duration)_ | Timeout specifies the HTTP request time limit. Default value is<br />[DefaultExporterClientTimeout]. | | |
| `read_buffer_size` _integer_ | ReadBufferSize specifies the ReadBufferSize for the HTTP<br />client. Default value is [DefaultExporterClientReadBufferSize]. | | |
| `write_buffer_size` _integer_ | WriteBufferSize specifies the WriteBufferSize for the HTTP<br />client. Default value is [DefaultExporterClientWriteBufferSize]. | | |
| `timeout` _[Duration](#duration)_ | Timeout specifies the HTTP request time limit. Default value is<br />[DefaultHTTPExporterClientTimeout]. | | |
| `read_buffer_size` _integer_ | ReadBufferSize specifies the ReadBufferSize for the HTTP<br />client. Default value is [DefaultHTTPExporterClientReadBufferSize]. | | |
| `write_buffer_size` _integer_ | WriteBufferSize specifies the WriteBufferSize for the HTTP<br />client. Default value is [DefaultHTTPExporterClientWriteBufferSize]. | | |
| `encoding` _[MessageEncoding](#messageencoding)_ | Encoding specifies the encoding to use for the messages. The default<br />value is [MessageEncodingProto]. | | |
| `retry_on_failure` _[RetryOnFailureConfig](#retryonfailureconfig)_ | RetryOnFailure specifies the retry policy of the exporter. | | |
| `compression` _[Compression](#compression)_ | Compression specifies the compression to use. The default value is<br />[CompressionGzip]. | | |
Expand All @@ -270,6 +300,7 @@ ResourceReference references data from a Secret.


_Appears in:_
- [OTLPGRPCExporterConfig](#otlpgrpcexporterconfig)
- [OTLPHTTPExporterConfig](#otlphttpexporterconfig)
- [TLSConfig](#tlsconfig)

Expand Down Expand Up @@ -304,6 +335,7 @@ RetryOnFailureConfig provides the retry policy for an exporter.


_Appears in:_
- [OTLPGRPCExporterConfig](#otlpgrpcexporterconfig)
- [OTLPHTTPExporterConfig](#otlphttpexporterconfig)

| Field | Description | Default | Validation |
Expand All @@ -324,6 +356,7 @@ TLSConfig provides the TLS settings used by exporters.


_Appears in:_
- [OTLPGRPCExporterConfig](#otlpgrpcexporterconfig)
- [OTLPHTTPExporterConfig](#otlphttpexporterconfig)

| Field | Description | Default | Validation |
Expand Down
25 changes: 20 additions & 5 deletions examples/opentelemetry-receiver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ data:
protocols:
http:
include_metadata: true
endpoint: 0.0.0.0:55690
compression_algorithms: ["", "gzip"]
endpoint: 0.0.0.0:4318
# Enable TLS with client certificate verification
tls:
cert_file: /etc/otel/tls/tls.crt
Expand All @@ -173,6 +172,17 @@ data:
# Enable authentication for HTTP endpoint
auth:
authenticator: bearertokenauth/server
grpc:
include_metadata: true
endpoint: 0.0.0.0:4317
# Enable TLS with client certificate verification
tls:
cert_file: /etc/otel/tls/tls.crt
key_file: /etc/otel/tls/tls.key
client_ca_file: /etc/otel/tls/ca.crt
# Enable authentication for gRPC endpoint
auth:
authenticator: bearertokenauth/server

exporters:
debug:
Expand Down Expand Up @@ -207,9 +217,14 @@ metadata:
namespace: default
spec:
ports:
- port: 8443
- name: otlp-grpc
port: 4317
protocol: TCP
targetPort: 4317
- name: otlp-http
port: 4318
protocol: TCP
targetPort: 55690
targetPort: 4318
selector:
app.kubernetes.io/component: opentelemetry-receiver
type: ClusterIP
Expand Down Expand Up @@ -242,7 +257,7 @@ spec:
secretKeyRef:
name: opentelemetry-receiver-auth
key: bearertoken
image: otel/opentelemetry-collector-contrib:0.141.0
image: otel/opentelemetry-collector-contrib:0.144.0
imagePullPolicy: IfNotPresent
name: otc-container
resources:
Expand Down
26 changes: 24 additions & 2 deletions examples/shoot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,31 @@ spec:
verbosity: basic # basic, normal or detailed

# OTLP HTTP exporter settings
otlphttp:
otlp_http:
enabled: true
endpoint: "https://opentelemetry-receiver.default.svc.cluster.local:8443"
endpoint: "https://opentelemetry-receiver.default.svc.cluster.local:4318"
token:
resourceRef:
name: otelcol-bearer-token
dataKey: token
tls:
ca:
resourceRef:
name: otelcol-tls
dataKey: ca.crt
cert:
resourceRef:
name: otelcol-tls
dataKey: client.crt
key:
resourceRef:
name: otelcol-tls
dataKey: client.key

# OTLP gRPC exporter settings
otlp_grpc:
enabled: true
endpoint: "https://opentelemetry-receiver.default.svc.cluster.local:4317"
token:
resourceRef:
name: otelcol-bearer-token
Expand Down
Loading