diff --git a/docs/content/reference/static-configuration/cli-ref.md b/docs/content/reference/static-configuration/cli-ref.md index 99065ee63..136f8dc8e 100644 --- a/docs/content/reference/static-configuration/cli-ref.md +++ b/docs/content/reference/static-configuration/cli-ref.md @@ -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```) @@ -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```) @@ -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```) @@ -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```) diff --git a/docs/content/reference/static-configuration/env-ref.md b/docs/content/reference/static-configuration/env-ref.md index 5d8313abb..12636602c 100644 --- a/docs/content/reference/static-configuration/env-ref.md +++ b/docs/content/reference/static-configuration/env-ref.md @@ -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```) @@ -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```) @@ -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```) @@ -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```) diff --git a/pkg/tracing/opentelemetry/opentelemetry.go b/pkg/tracing/opentelemetry/opentelemetry.go index 3806ffcd4..35f1a5f6a 100644 --- a/pkg/tracing/opentelemetry/opentelemetry.go +++ b/pkg/tracing/opentelemetry/opentelemetry.go @@ -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. diff --git a/pkg/types/metrics.go b/pkg/types/metrics.go index cde08e189..b97ae9221 100644 --- a/pkg/types/metrics.go +++ b/pkg/types/metrics.go @@ -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"`