TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/middleapi/orpc/llms.txt
Use this file to discover all available pages before exploring further.
@orpc/otel package provides OpenTelemetry integration for oRPC. It uses the standard InstrumentationBase pattern from @opentelemetry/instrumentation, making it compatible with any OpenTelemetry SDK setup.
Installation
ORPCInstrumentation
The main instrumentation class. Extend from InstrumentationBase and integrates with the OpenTelemetry SDK’s registerInstrumentations pattern.
Constructor
ORPCInstrumentationConfig extends the standard InstrumentationConfig from @opentelemetry/instrumentation, which includes:
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Whether the instrumentation is active |
enable()
Activates oRPC’s global OpenTelemetry integration, setting up the tracer, context propagation, and trace API:
setGlobalOtelConfig() with the active tracer and propagation APIs from @opentelemetry/api.
disable()
Deactivates the integration:
Setup
With Node.js SDK (recommended)
Manual setup
ORPCInstrumentation must be registered before your oRPC server or client code runs. The instrumentation hooks into oRPC’s global configuration at enable time.What gets traced
Once instrumentation is enabled, oRPC automatically creates spans for:- Procedure execution — each procedure call creates a span named after the procedure path
- Middleware pipeline — middleware execution is traced as child spans
- Context propagation — trace context is propagated across requests using the W3C Trace Context standard
Span attributes
Spans include standard attributes such as:| Attribute | Value |
|---|---|
rpc.system | 'orpc' |
rpc.method | Procedure path (e.g. planet.list) |
rpc.grpc.status_code | Status code on error |
error.type | Error code on failure |
Example: full observability setup
Compatibility
ORPCInstrumentation works with any OpenTelemetry-compatible backend:
- Jaeger
- Zipkin
- Grafana Tempo
- Honeycomb
- Datadog
- Any OTLP-compatible collector
