You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using default otel exporter in our java and node js applications. Can you please provide us ways to achieve this? we don't want to use gRPC or create a custom exporter. How can we switch between HTTP1 and HTTP2 protocols when using default otel exporters?
Please suggest options for both Java and node.js
Below is our understanding wrt to using HTTP2 with default exporter, please check
JAVA
OpenTelemetry does not provide an automatic runtime toggle between HTTP/1.1 and HTTP/2.
It does provide a way to switch between http/protobuf and grpc, which is effectively how you switch between HTTP/1.1 and HTTP/2 (because gRPC uses HTTP/2).
If you're using default exporters, switching protocols generally means changing the exporter protocol (http/protobuf ↔ grpc).
we can't create our custom HTTP client and set it explicitly in default OTEL exporter.
Node.js
JavaScript (Node.js) doesn’t auto-switch protocols at runtime — you explicitly choose the protocol via the exporter you use (http or grpc).
If you use @opentelemetry/exporter-trace-otlp-http → you're using HTTP/1.1 by default.
If you use @opentelemetry/exporter-trace-otlp-grpc → you're using HTTP/2 (because gRPC requires HTTP/2).
In JS, the "default exporter" is usually OTLP/HTTP, especially in examples or SDK auto-instrumentation.
To use gRPC (i.e., HTTP/2), you need to:
Manually install the gRPC exporter package:
npm install @opentelemetry/exporter-trace-otlp-grpc
And manually wire it up in your code.
So in JS, switching from HTTP/1.1 to HTTP/2 is not just changing a config value — it requires using a different package/exporter.
The text was updated successfully, but these errors were encountered:
I576510
changed the title
How to switch between HTTP 1 and HTTP2 protocols when using default otel exporters
How to switch between HTTP1 and HTTP2 protocols when using default otel exporters
Apr 14, 2025
Hi Team,
We are using default otel exporter in our java and node js applications. Can you please provide us ways to achieve this? we don't want to use gRPC or create a custom exporter. How can we switch between HTTP1 and HTTP2 protocols when using default otel exporters?
Please suggest options for both Java and node.js
Below is our understanding wrt to using HTTP2 with default exporter, please check
JAVA
Node.js
JavaScript (Node.js) doesn’t auto-switch protocols at runtime — you explicitly choose the protocol via the exporter you use (http or grpc).
If you use @opentelemetry/exporter-trace-otlp-http → you're using HTTP/1.1 by default.
If you use @opentelemetry/exporter-trace-otlp-grpc → you're using HTTP/2 (because gRPC requires HTTP/2).
In JS, the "default exporter" is usually OTLP/HTTP, especially in examples or SDK auto-instrumentation.
To use gRPC (i.e., HTTP/2), you need to:
Manually install the gRPC exporter package:
npm install @opentelemetry/exporter-trace-otlp-grpc
And manually wire it up in your code.
So in JS, switching from HTTP/1.1 to HTTP/2 is not just changing a config value — it requires using a different package/exporter.
The text was updated successfully, but these errors were encountered: