-
Notifications
You must be signed in to change notification settings - Fork 5.2k
access_log: add OTLP/HTTP exporter to OpenTelemetry access logger #42445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
access_log: add OTLP/HTTP exporter to OpenTelemetry access logger #42445
Conversation
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
8831406 to
3664f4e
Compare
|
moving to draft as I noticed an inconsistency in how grpc access log worked wrt service names vs all other signals, and accidentally promoted that to a normalized practice across http when I should fix that goof |
a50beca to
7adc68b
Compare
| resource_detectors: | ||
| - name: envoy.tracers.opentelemetry.resource_detectors.environment | ||
| typed_config: | ||
| "@type": type.googleapis.com/envoy.extensions.tracers.opentelemetry.resource_detectors.v3.EnvironmentResourceDetectorConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok this now uses the current practice with is resource detectors, not a one-off, even though the one-off in grpc+accesslog is retained for deprecation
e8271a1 to
0e06aa1
Compare
0e06aa1 to
964e660
Compare
Adds HTTP transport support to the OpenTelemetry access logger, complementing 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 and grpc_service fields - Add top-level log_name, buffer_flush_interval, buffer_size_bytes, filter_state_objects_to_log, and custom_tags fields - Add top-level resource_detectors field for dynamic resource attributes - Deprecate common_config field (still functional for backward compat) - Extract shared utilities (otlp_log_utils) from duplicated code Risk Level: Low (new optional feature, backward compatible) Testing: Unit tests, integration test, manual testing with OTel collector Fixes envoyproxy#26352 (access logs portion) Signed-off-by: Adrian Cole <[email protected]>
964e660 to
f4105d1
Compare
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:
http_serviceandgrpc_servicefieldslog_name,buffer_flush_interval,buffer_size_bytes,filter_state_objects_to_log, andcustom_tagsfieldsresource_detectorsfield for dynamic resource attributes (e.g., environment detector)common_configfield (still functional for backward compatibility)otlp_log_utils) from duplicated code between HTTP and gRPC implementationsRisk 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_detectors)
Example Configuration (OTLP/gRPC - after this PR is similar to tracing)
FAQ
Why add
resource_detectorsinstead of propagatingresource_attributes?The
resource_attributesfield in the oldcommon_configwas a one-off pattern that no other signal uses. By adoptingresource_detectors, access logs now follow the same configuration style as tracing and metrics:How do I set service.name consistently across all signals?
Use the
OTEL_RESOURCE_ATTRIBUTESenvironment variable with the environment resource detector:Then configure all signals to use the environment detector:
This is the OTel-standard way to configure resource attributes and eliminates the need to duplicate
service.namein multiple config sections.Screenshots
Example was added and here are screen shots proving not just access logs are there, but linked to the right trace:

