diff --git a/milter/entrypoint.sh b/milter/entrypoint.sh index 3bf9c43..8fed8f3 100644 --- a/milter/entrypoint.sh +++ b/milter/entrypoint.sh @@ -149,11 +149,19 @@ fi if [ "${OTEL_TRACING_ENABLED:-false}" = "true" ]; then export OTEL_SERVICE_NAME="${OTEL_SERVICE_NAME:-milter}" export OTEL_EXPORTER_OTLP_ENDPOINT="${OTEL_EXPORTER_OTLP_ENDPOINT:-http://localhost:4318}" + # The Dockerfile installs only the HTTP variant of the OTLP exporter + # (opentelemetry-exporter-otlp-proto-http). The OTel spec defaults + # the protocol to grpc, which makes opentelemetry-instrument try + # to load a gRPC exporter that isn't installed and raise: + # "Requested component 'otlp_proto_grpc' not found in entry + # point 'opentelemetry_traces_exporter'" + # Pin the protocol so the right exporter is selected. + export OTEL_EXPORTER_OTLP_PROTOCOL="${OTEL_EXPORTER_OTLP_PROTOCOL:-http/protobuf}" # tracecontext + baggage are the W3C-standard propagators; matches what # ddtrace emits when DD_TRACE_PROPAGATION_STYLE includes tracecontext, so # cross-service trace continuity holds regardless of which SDK is active. export OTEL_PROPAGATORS="${OTEL_PROPAGATORS:-tracecontext,baggage}" - echo "OpenTelemetry tracing enabled (service=${OTEL_SERVICE_NAME}, endpoint=${OTEL_EXPORTER_OTLP_ENDPOINT})" + echo "OpenTelemetry tracing enabled (service=${OTEL_SERVICE_NAME}, endpoint=${OTEL_EXPORTER_OTLP_ENDPOINT}, protocol=${OTEL_EXPORTER_OTLP_PROTOCOL})" fi # Start the milter in background (MUST be running before Postfix starts).