opentelemetry tracer: add OTLP/HTTP exporter#29207
Merged
wbpcode merged 49 commits intoenvoyproxy:mainfrom Oct 18, 2023
Merged
Conversation
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>
Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>
|
Hi @joaopgrassi, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
|
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
joaopgrassi
commented
Aug 23, 2023
joaopgrassi
commented
Aug 23, 2023
joaopgrassi
commented
Aug 23, 2023
joaopgrassi
commented
Aug 23, 2023
Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>
Member
|
@AlexanderEllis @htuch @adisuissa seems this is wating on further review/feedback /wait-any |
wbpcode
requested changes
Oct 17, 2023
Member
wbpcode
left a comment
There was a problem hiding this comment.
Thanks. Some new comments are added.
Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>
Contributor
Author
|
@wbpcode tried addressing the "copy" of headers. Please let me know what you think! thank you 🙌 |
wbpcode
reviewed
Oct 18, 2023
test/extensions/tracers/opentelemetry/http_trace_exporter_test.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Joao Grassi <joao.grassi@dynatrace.com>
This was referenced Nov 13, 2023
codefromthecrypt
added a commit
to codefromthecrypt/envoy
that referenced
this pull request
Dec 7, 2025
Adds HTTP transport support to the OpenTelemetry access logger, complementing envoyproxy#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. Changes: - Add http_service field for OTLP/HTTP transport configuration - Add top-level grpc_service, log_name, buffer_flush_interval, buffer_size_bytes, filter_state_objects_to_log, and custom_tags fields to match tracer config pattern - Add field_migrate.oneof_promotion annotations for future oneof migration - Add helper functions getLogName() and getGrpcService() with fallback to common_config - Add transport validation (exactly one transport must be configured) - Deprecate common_config field (still functional for backward compatibility) - Extract shared utilities (otlp_log_utils) from duplicated HTTP/gRPC code Fixes envoyproxy#26352 (access logs portion) Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
added a commit
to codefromthecrypt/envoy
that referenced
this pull request
Dec 7, 2025
Adds HTTP transport support to the OpenTelemetry access logger, complementing envoyproxy#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. Changes: - Add http_service field for OTLP/HTTP transport configuration - Add top-level grpc_service, log_name, buffer_flush_interval, buffer_size_bytes, filter_state_objects_to_log, and custom_tags fields to match tracer config pattern - Add field_migrate.oneof_promotion annotations for future oneof migration - Add helper functions getLogName() and getGrpcService() with fallback to common_config - Add transport validation (exactly one transport must be configured) - Deprecate common_config field (still functional for backward compatibility) - Extract shared utilities (otlp_log_utils) from duplicated HTTP/gRPC code Fixes envoyproxy#26352 (access logs portion) Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
added a commit
to codefromthecrypt/envoy
that referenced
this pull request
Dec 7, 2025
Adds HTTP transport support to the OpenTelemetry access logger, complementing envoyproxy#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. Changes: - Add http_service field for OTLP/HTTP transport configuration - Add top-level grpc_service, log_name, buffer_flush_interval, buffer_size_bytes, filter_state_objects_to_log, and custom_tags fields to match tracer config pattern - Add field_migrate.oneof_promotion annotations for future oneof migration - Add helper functions getLogName() and getGrpcService() with fallback to common_config - Add transport validation (exactly one transport must be configured) - Deprecate common_config field (still functional for backward compatibility) - Extract shared utilities (otlp_log_utils) from duplicated HTTP/gRPC code Fixes envoyproxy#26352 (access logs portion) Signed-off-by: Adrian Cole <adrian@tetrate.io>
wbpcode
pushed a commit
that referenced
this pull request
Jan 10, 2026
…2445) **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)** ```yaml 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)** ```yaml 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** <img width="1620" height="756" alt="Screenshot 2025-12-17 at 12 24 10 PM" src="https://github.com/user-attachments/assets/17422675-615b-45b0-a55f-143926c169b8" /> <img width="1625" height="729" alt="Screenshot 2025-12-17 at 12 23 51 PM" src="https://github.com/user-attachments/assets/4ac1d906-c77c-44a8-a4f3-aabd5f3771d6" /> --------- Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
added a commit
to codefromthecrypt/envoy
that referenced
this pull request
Jan 14, 2026
Adds HTTP transport support to the OpenTelemetry metrics sink, complementing envoyproxy#42445 (OTLP/HTTP access logs) and envoyproxy#29207 (OTLP/HTTP tracing. This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. - Add field to oneof - Create abstract base class - Rename to EOF ) Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
added a commit
to codefromthecrypt/envoy
that referenced
this pull request
Jan 14, 2026
Adds HTTP transport support to the OpenTelemetry metrics sink, complementing envoyproxy#42445 (OTLP/HTTP access logs) and envoyproxy#29207 (OTLP/HTTP tracing. This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. - Add field to oneof - Create abstract base class - Rename to EOF ) Signed-off-by: Adrian Cole <adrian@tetrate.io>
codefromthecrypt
added a commit
to codefromthecrypt/envoy
that referenced
this pull request
Jan 20, 2026
Adds HTTP transport support to the OpenTelemetry metrics sink, complementing envoyproxy#42445 (OTLP/HTTP access logs) and envoyproxy#29207 (OTLP/HTTP tracing. This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. - Add field to oneof - Create abstract base class - Rename to EOF ) Signed-off-by: Adrian Cole <adrian@tetrate.io>
wbpcode
added a commit
that referenced
this pull request
Feb 3, 2026
) **Additional Description**: Adds HTTP transport support to the OpenTelemetry metrics sink, complementing #42445 (OTLP/HTTP access logs) and #29207 (OTLP/HTTP tracing). This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. Also refactors the exporter to use an abstract base class: - Add `http_service` field to `protocol_specifier` oneof for OTLP/HTTP transport - Create abstract `OtlpMetricsExporter` base class - Rename `OpenTelemetryGrpcSink` to `OpenTelemetrySink` with generic exporter **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 **Example Configuration (OTLP/HTTP)** ```yaml stats_sinks: - name: envoy.stat_sinks.open_telemetry typed_config: "@type": type.googleapis.com/envoy.extensions.stat_sinks.open_telemetry.v3.SinkConfig http_service: http_uri: uri: "http://localhost:4318/v1/metrics" cluster: otel_collector timeout: 1s report_counters_as_deltas: true report_histograms_as_deltas: true emit_tags_as_attributes: true use_tag_extracted_name: true ``` **Example Configuration (OTLP/gRPC - unchanged)** ```yaml stats_sinks: - name: envoy.stat_sinks.open_telemetry typed_config: "@type": type.googleapis.com/envoy.extensions.stat_sinks.open_telemetry.v3.SinkConfig grpc_service: envoy_grpc: cluster_name: otel_collector report_counters_as_deltas: true ``` Screenshot of metrics from http transport in otel-tui <img width="1288" height="734" alt="Screenshot 2026-01-14 at 8 46 27 PM" src="https://github.com/user-attachments/assets/49d57f12-61a4-4b0d-9dbc-8b9ad3339554" /> --------- Signed-off-by: Adrian Cole <adrian@tetrate.io> Signed-off-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com> Signed-off-by: code <wbphub@gmail.com> Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com> Co-authored-by: code <wbphub@gmail.com>
shane-yuan
pushed a commit
to shane-yuan/envoy
that referenced
this pull request
Feb 11, 2026
…oyproxy#43001) **Additional Description**: Adds HTTP transport support to the OpenTelemetry metrics sink, complementing envoyproxy#42445 (OTLP/HTTP access logs) and envoyproxy#29207 (OTLP/HTTP tracing). This enables direct OTLP metrics export to backends that only accept HTTP (Dynatrace, Datadog, Elastic), without requiring an intermediate collector sidecar. Also refactors the exporter to use an abstract base class: - Add `http_service` field to `protocol_specifier` oneof for OTLP/HTTP transport - Create abstract `OtlpMetricsExporter` base class - Rename `OpenTelemetryGrpcSink` to `OpenTelemetrySink` with generic exporter **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 **Example Configuration (OTLP/HTTP)** ```yaml stats_sinks: - name: envoy.stat_sinks.open_telemetry typed_config: "@type": type.googleapis.com/envoy.extensions.stat_sinks.open_telemetry.v3.SinkConfig http_service: http_uri: uri: "http://localhost:4318/v1/metrics" cluster: otel_collector timeout: 1s report_counters_as_deltas: true report_histograms_as_deltas: true emit_tags_as_attributes: true use_tag_extracted_name: true ``` **Example Configuration (OTLP/gRPC - unchanged)** ```yaml stats_sinks: - name: envoy.stat_sinks.open_telemetry typed_config: "@type": type.googleapis.com/envoy.extensions.stat_sinks.open_telemetry.v3.SinkConfig grpc_service: envoy_grpc: cluster_name: otel_collector report_counters_as_deltas: true ``` Screenshot of metrics from http transport in otel-tui <img width="1288" height="734" alt="Screenshot 2026-01-14 at 8 46 27 PM" src="https://github.com/user-attachments/assets/49d57f12-61a4-4b0d-9dbc-8b9ad3339554" /> --------- Signed-off-by: Adrian Cole <adrian@tetrate.io> Signed-off-by: Adrian Cole <64215+codefromthecrypt@users.noreply.github.com> Signed-off-by: code <wbphub@gmail.com> Signed-off-by: wbpcode/wangbaiping <wbphub@gmail.com> Co-authored-by: code <wbphub@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message:
Add OTLP/HTTP exporter to OpenTelemetry Tracer
Co-authored-by: Alex Ellis ellisonjtk@gmail.com
Additional Description: This PR refactors the OpenTelemetry tracer, allowing it to export OTLP data via HTTP. It refactors the existing gRPC exporter into a general exporter, so the functionality can be shared between the gRPC and the new HTTP exporters. The HTTP exporter is relatively simple: it accesses the thread local cluster for the configured cluster, then sends the OTLP request.
Risk Level: Low (new, optional functionality for existing tracing extension)
Testing: Unit test and manual tests performed, exporting spans to a local OTel collector and a public/external back-end via OTLP/HTTP. Also performed tests exporting to a local OTel collector via gRPC to ensure the existing feature is unaffected.
Fixes #26352
Note: This is a continuation of #28454 as previously discussed and agreed with @AlexanderEllis and @htuch.
For posterity, here's how a "full" configuration looks like: