Skip to content

access_log: add OTLP/HTTP exporter to OpenTelemetry access logger#42445

Merged
wbpcode merged 2 commits into
envoyproxy:mainfrom
codefromthecrypt:otlp-http-access-logs
Jan 10, 2026
Merged

access_log: add OTLP/HTTP exporter to OpenTelemetry access logger#42445
wbpcode merged 2 commits into
envoyproxy:mainfrom
codefromthecrypt:otlp-http-access-logs

test-refactor-and-fix

2143126
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Mobile/CC succeeded Jan 8, 2026 in 5m 17s

Mobile/CC (success)

Check has finished

Details

Check run finished (success ✔️)

The check run can be viewed here:

Mobile/CC (pr/42445/main@2143126)

Check started by

Request (pr/42445/main@2143126)

codefromthecrypt @codefromthecrypt 2143126 #42445 merge main@ac2b565

access_log: add OTLP/HTTP exporter to OpenTelemetry access logger

Commit Message: access_log: add OTLP/HTTP exporter to OpenTelemetry access logger

Additional Description: Adds HTTP transport support to the OpenTelemetry access logger, complementing #29207 (OTLP/HTTP tracing). This enables direct OTLP log export to backends that only accept HTTP (Dynatrace, Datadog, Logfire), without requiring an intermediate collector sidecar.

Also refactors the config to match the tracer pattern:

  • Add top-level http_service field for OTLP/HTTP transport
  • Add top-level grpc_service and log_name fields
  • Deprecate common_config field (still functional for backward compatibility)
  • Extract shared utilities (otlp_log_utils) for HTTP and gRPC implementations

Risk Level: Low (new optional feature, backward compatible)

Testing: Unit tests, integration test, manual testing with OTel collector

Docs Changes: Proto documentation updated

Release Notes: Added

Fixes #26352 (access logs portion)

Example Configuration (OTLP/HTTP with resource_attributes)

access_log:
- name: envoy.access_loggers.open_telemetry
  typed_config:
    "@type": type.googleapis.com/envoy.extensions.access_loggers.open_telemetry.v3.OpenTelemetryAccessLogConfig
    http_service:
      http_uri:
        uri: "http://localhost:4318/v1/logs"
        cluster: otel_collector
        timeout: 1s
    log_name: envoy_access_log
    resource_attributes:
      values:
      - key: "service.name"
        value:
          string_value: "my-service"
    body:
      string_value: "%REQ(:METHOD)% %REQ(:PATH)% %RESPONSE_CODE%"

Example Configuration (OTLP/gRPC - top-level field)

access_log:
- name: envoy.access_loggers.open_telemetry
  typed_config:
    "@type": type.googleapis.com/envoy.extensions.access_loggers.open_telemetry.v3.OpenTelemetryAccessLogConfig
    grpc_service:
      envoy_grpc:
        cluster_name: otel_collector
    log_name: envoy_access_log
    body:
      string_value: "%REQ(:METHOD)% %REQ(:PATH)% %RESPONSE_CODE%"

Screenshots
Screenshot 2025-12-17 at 12 24 10 PM
Screenshot 2025-12-17 at 12 23 51 PM

Environment

Request variables

Key Value
ref 6314ffc
sha 2143126
pr 42445
base-sha ac2b565
actor codefromthecrypt @codefromthecrypt
message access_log: add OTLP/HTTP exporter to OpenTelemetry access logger...
started 1767909464.751212
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default docker.io/envoyproxy/envoy-build:e0b4993c78551c1638ac00cf21d36313fe35d81d
mobile docker.io/envoyproxy/envoy-build:mobile-e0b4993c78551c1638ac00cf21d36313fe35d81d
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 37
patch 0
dev true