Skip to content

fix(observability): translate OTEL_EXPORTER_OTLP_PROTOCOL to the transport enum#8

Merged
casc84ab merged 1 commit into
mainfrom
fix/otlp-protocol-transport-translation
Jul 16, 2026
Merged

fix(observability): translate OTEL_EXPORTER_OTLP_PROTOCOL to the transport enum#8
casc84ab merged 1 commit into
mainfrom
fix/otlp-protocol-transport-translation

Conversation

@casc84ab

Copy link
Copy Markdown
Contributor

Problem

The bundled application-firefly-observability.yml bound OTEL_EXPORTER_OTLP_PROTOCOL directly to Spring's management.otlp.tracing.transport enum. The OpenTelemetry spec values are grpc | http/protobuf | http/json, but the Spring enum only accepts GRPC | HTTP. Setting the spec-correct http/protobuf therefore failed to bind and crashed context initialization across every service consuming the framework.

Fix

FireflyObservabilityEnvironmentPostProcessor now owns the translation:

  • Any http/* protocol → transport HTTP; grpcGRPC.
  • When HTTP is selected without an explicit endpoint, the default moves off the gRPC :4317 port to :4318/v1/traces. An explicit OTEL_EXPORTER_OTLP_(TRACES_)ENDPOINT always wins.
  • No-op when the protocol var is unset (the YAML grpc default stands).

The YAML now carries a static grpc default instead of the raw spec value, so no invalid value ever reaches the enum binder.

Tests

5 new cases in FireflyObservabilityEnvironmentPostProcessorTest (http/protobuf, http/json, grpc, unset, explicit-endpoint-wins). Full class green (12/12).

…sport enum

The bundled defaults bound OTEL_EXPORTER_OTLP_PROTOCOL straight to Spring's
management.otlp.tracing.transport enum. The OTel spec values are
grpc | http/protobuf | http/json, but the enum only accepts GRPC | HTTP, so the
spec-correct http/protobuf failed to bind and crashed context initialization.

FireflyObservabilityEnvironmentPostProcessor now normalizes any http/* protocol
to the HTTP transport and, when HTTP is selected without an explicit endpoint,
moves the default off the gRPC :4317 port to :4318/v1/traces (an explicit
OTEL_EXPORTER_OTLP_(TRACES_)ENDPOINT always wins). The YAML now carries a static
grpc default instead of the raw spec value.
@casc84ab
casc84ab merged commit 4f8d8c0 into main Jul 16, 2026
1 check passed
@casc84ab
casc84ab deleted the fix/otlp-protocol-transport-translation branch July 16, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant