Observability
@connectum/otel connects RPC telemetry and application instrumentation to OpenTelemetry. Instrumentation decides what signals to create; provider/exporter configuration decides where those signals go.
Minimal RPC instrumentation
import { createServer } from '@connectum/core';
import { createOtelInterceptor } from '@connectum/otel';
const server = createServer({
services: [routes],
interceptors: [
createOtelInterceptor(),
],
});Here routes is your service registration. Configure the provider and exporter as well.
Exclude health RPCs from this instrumentation
Use createOtelInterceptor({ filter: ({ service }) => !service.includes('grpc.health') }).
Choose the signal
Trace one call, measure many calls, or write correlated logs.
Instrumentation and configuration references
| Need | Canonical guide |
|---|---|
Server/client RPC spans, propagation, traced() or traceAll() | Tracing |
| Automatic RPC instruments and application meters | Metrics |
| Structured records and trace correlation | Logging |
| OTLP endpoints, exporters, resource metadata, provider lifecycle | Backends and configuration |
Focused guides explain task behavior. Exact option fields belong to generated interfaces such as OtelInterceptorOptions and ProviderOptions.
Exporter tables and provider configuration belong to Backends and configuration.
The project's Bun CI does not validate this telemetry integration; see runtime limitations.
Installation
Add OpenTelemetry integration
npm install @connectum/otelpnpm add --allow-build='!protobufjs' @connectum/otelbun add @connectum/otelOn pnpm 11 and later, explicitly decline the transitive protobufjs build script as above; otherwise installation ends with ERR_PNPM_IGNORED_BUILDS. OpenTelemetry APIs, SDKs and exporters are regular dependencies; @opentelemetry/api stays in >=1.9.0 <1.10.0. Protobuf and Connect are peers; see peer dependency compatibility. Installation alone does not initialize a provider or select an exporter; follow the backend guide before expecting telemetry.