Skip to content

Commit

Permalink
fix: allow empty otlp config
Browse files Browse the repository at this point in the history
  • Loading branch information
rtribotte committed May 16, 2024
1 parent e68e647 commit 9d55e33
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
12 changes: 12 additions & 0 deletions docs/content/reference/static-configuration/cli-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ Enable metrics on services. (Default: ```true```)
`--metrics.otlp.explicitboundaries`:
Boundaries for latency metrics. (Default: ```0.005000, 0.010000, 0.025000, 0.050000, 0.075000, 0.100000, 0.250000, 0.500000, 0.750000, 1.000000, 2.500000, 5.000000, 7.500000, 10.000000```)

`--metrics.otlp.grpc`:
gRPC configuration for the OpenTelemetry collector. (Default: ```false```)

`--metrics.otlp.grpc.endpoint`:
Sets the gRPC endpoint (host:port) of the collector. (Default: ```localhost:4317```)

Expand All @@ -360,6 +363,9 @@ TLS insecure skip verify (Default: ```false```)
`--metrics.otlp.grpc.tls.key`:
TLS key

`--metrics.otlp.http`:
HTTP configuration for the OpenTelemetry collector. (Default: ```false```)

`--metrics.otlp.http.endpoint`:
Sets the HTTP endpoint (scheme://host:port/path) of the collector. (Default: ```https://localhost:4318```)

Expand Down Expand Up @@ -1056,6 +1062,9 @@ Defines additional attributes (key:value) on all spans.
`--tracing.otlp`:
Settings for OpenTelemetry. (Default: ```false```)

`--tracing.otlp.grpc`:
gRPC configuration for the OpenTelemetry collector. (Default: ```false```)

`--tracing.otlp.grpc.endpoint`:
Sets the gRPC endpoint (host:port) of the collector. (Default: ```localhost:4317```)

Expand All @@ -1077,6 +1086,9 @@ TLS insecure skip verify (Default: ```false```)
`--tracing.otlp.grpc.tls.key`:
TLS key

`--tracing.otlp.http`:
HTTP configuration for the OpenTelemetry collector. (Default: ```false```)

`--tracing.otlp.http.endpoint`:
Sets the HTTP endpoint (scheme://host:port/path) of the collector. (Default: ```https://localhost:4318```)

Expand Down
12 changes: 12 additions & 0 deletions docs/content/reference/static-configuration/env-ref.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ Enable metrics on services. (Default: ```true```)
`TRAEFIK_METRICS_OTLP_EXPLICITBOUNDARIES`:
Boundaries for latency metrics. (Default: ```0.005000, 0.010000, 0.025000, 0.050000, 0.075000, 0.100000, 0.250000, 0.500000, 0.750000, 1.000000, 2.500000, 5.000000, 7.500000, 10.000000```)

`TRAEFIK_METRICS_OTLP_GRPC`:
gRPC configuration for the OpenTelemetry collector. (Default: ```false```)

`TRAEFIK_METRICS_OTLP_GRPC_ENDPOINT`:
Sets the gRPC endpoint (host:port) of the collector. (Default: ```localhost:4317```)

Expand All @@ -360,6 +363,9 @@ TLS insecure skip verify (Default: ```false```)
`TRAEFIK_METRICS_OTLP_GRPC_TLS_KEY`:
TLS key

`TRAEFIK_METRICS_OTLP_HTTP`:
HTTP configuration for the OpenTelemetry collector. (Default: ```false```)

`TRAEFIK_METRICS_OTLP_HTTP_ENDPOINT`:
Sets the HTTP endpoint (scheme://host:port/path) of the collector. (Default: ```https://localhost:4318```)

Expand Down Expand Up @@ -1056,6 +1062,9 @@ Defines additional attributes (key:value) on all spans.
`TRAEFIK_TRACING_OTLP`:
Settings for OpenTelemetry. (Default: ```false```)

`TRAEFIK_TRACING_OTLP_GRPC`:
gRPC configuration for the OpenTelemetry collector. (Default: ```false```)

`TRAEFIK_TRACING_OTLP_GRPC_ENDPOINT`:
Sets the gRPC endpoint (host:port) of the collector. (Default: ```localhost:4317```)

Expand All @@ -1077,6 +1086,9 @@ TLS insecure skip verify (Default: ```false```)
`TRAEFIK_TRACING_OTLP_GRPC_TLS_KEY`:
TLS key

`TRAEFIK_TRACING_OTLP_HTTP`:
HTTP configuration for the OpenTelemetry collector. (Default: ```false```)

`TRAEFIK_TRACING_OTLP_HTTP_ENDPOINT`:
Sets the HTTP endpoint (scheme://host:port/path) of the collector. (Default: ```https://localhost:4318```)

Expand Down
4 changes: 2 additions & 2 deletions pkg/tracing/opentelemetry/opentelemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

// Config provides configuration settings for the open-telemetry tracer.
type Config struct {
GRPC *types.OtelGRPC `description:"gRPC configuration for the OpenTelemetry collector." json:"grpc,omitempty" toml:"grpc,omitempty" yaml:"grpc,omitempty" export:"true"`
HTTP *types.OtelHTTP `description:"HTTP configuration for the OpenTelemetry collector." json:"http,omitempty" toml:"http,omitempty" yaml:"http,omitempty" export:"true"`
GRPC *types.OtelGRPC `description:"gRPC configuration for the OpenTelemetry collector." json:"grpc,omitempty" toml:"grpc,omitempty" yaml:"grpc,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`
HTTP *types.OtelHTTP `description:"HTTP configuration for the OpenTelemetry collector." json:"http,omitempty" toml:"http,omitempty" yaml:"http,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`
}

// SetDefaults sets the default values.
Expand Down
4 changes: 2 additions & 2 deletions pkg/types/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ func (i *InfluxDB2) SetDefaults() {

// OTLP contains specific configuration used by the OpenTelemetry Metrics exporter.
type OTLP struct {
GRPC *OtelGRPC `description:"gRPC configuration for the OpenTelemetry collector." json:"grpc,omitempty" toml:"grpc,omitempty" yaml:"grpc,omitempty" export:"true"`
HTTP *OtelHTTP `description:"HTTP configuration for the OpenTelemetry collector." json:"http,omitempty" toml:"http,omitempty" yaml:"http,omitempty" export:"true"`
GRPC *OtelGRPC `description:"gRPC configuration for the OpenTelemetry collector." json:"grpc,omitempty" toml:"grpc,omitempty" yaml:"grpc,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`
HTTP *OtelHTTP `description:"HTTP configuration for the OpenTelemetry collector." json:"http,omitempty" toml:"http,omitempty" yaml:"http,omitempty" label:"allowEmpty" file:"allowEmpty" export:"true"`

AddEntryPointsLabels bool `description:"Enable metrics on entry points." json:"addEntryPointsLabels,omitempty" toml:"addEntryPointsLabels,omitempty" yaml:"addEntryPointsLabels,omitempty" export:"true"`
AddRoutersLabels bool `description:"Enable metrics on routers." json:"addRoutersLabels,omitempty" toml:"addRoutersLabels,omitempty" yaml:"addRoutersLabels,omitempty" export:"true"`
Expand Down

0 comments on commit 9d55e33

Please sign in to comment.