Skip to content

stat_sinks: add OTLP/HTTP exporter to OpenTelemetry metrics sink#43001

Merged
wbpcode merged 6 commits intoenvoyproxy:mainfrom
codefromthecrypt:stat-sinks-otlp-http
Feb 3, 2026
Merged

stat_sinks: add OTLP/HTTP exporter to OpenTelemetry metrics sink#43001
wbpcode merged 6 commits intoenvoyproxy:mainfrom
codefromthecrypt:stat-sinks-otlp-http

Conversation

@codefromthecrypt
Copy link
Copy Markdown
Contributor

@codefromthecrypt codefromthecrypt commented Jan 14, 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)

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)

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

Screenshot 2026-01-14 at 8 46 27 PM

@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #43001 was opened by codefromthecrypt.

see: more, trace.

@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #43001 was opened by codefromthecrypt.

see: more, trace.

@tyxia
Copy link
Copy Markdown
Member

tyxia commented Jan 15, 2026

assign to @yanavlasov and @wbpcode , since you reviewed the related PR (#42445) in the past

yanavlasov
yanavlasov previously approved these changes Jan 16, 2026
Copy link
Copy Markdown
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Will wait for API review.

/wait-any

@codefromthecrypt
Copy link
Copy Markdown
Contributor Author

@wbpcode you mind doing an api review?

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 <[email protected]>
@yanavlasov
Copy link
Copy Markdown
Contributor

@codefromthecrypt can you merge main to see if CI permafail will get resolved, please?

@yanavlasov
Copy link
Copy Markdown
Contributor

/wait

@codefromthecrypt
Copy link
Copy Markdown
Contributor Author

🤞

Copy link
Copy Markdown
Member

@wbpcode wbpcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm api

@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Jan 24, 2026

cc @yanavlasov ping for final check of code or merge :)

wbpcode
wbpcode previously approved these changes Jan 24, 2026
@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Jan 24, 2026

Seems no code change after last review of @yanavlasov , will merge this.

@wbpcode wbpcode enabled auto-merge (squash) January 24, 2026 07:49
@paul-r-gall
Copy link
Copy Markdown
Contributor

@codefromthecrypt please merge main and reupload.

@wbpcode
Copy link
Copy Markdown
Member

wbpcode commented Jan 28, 2026

pray for ci

@codefromthecrypt
Copy link
Copy Markdown
Contributor Author

@wbpcode was this supposed to auto-merge?

@wbpcode wbpcode disabled auto-merge February 2, 2026 01:42
Signed-off-by: wbpcode/wangbaiping <[email protected]>
@wbpcode wbpcode merged commit ff079e0 into envoyproxy:main Feb 3, 2026
26 checks passed
@codefromthecrypt codefromthecrypt deleted the stat-sinks-otlp-http branch February 4, 2026 01:01
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 <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: code <[email protected]>
Signed-off-by: wbpcode/wangbaiping <[email protected]>
Co-authored-by: code <[email protected]>
grnmeira pushed a commit to grnmeira/envoy that referenced this pull request Mar 20, 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 <[email protected]>
Signed-off-by: Adrian Cole <[email protected]>
Signed-off-by: code <[email protected]>
Signed-off-by: wbpcode/wangbaiping <[email protected]>
Co-authored-by: code <[email protected]>
Signed-off-by: Gustavo <[email protected]>
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.

6 participants