otel_serverpod 0.1.0-beta.1
otel_serverpod: ^0.1.0-beta.1 copied to clipboard
OpenTelemetry instrumentation for Serverpod. One call opens http.server semconv spans per endpoint method call (route = endpoint.method), db.* client spans for the database layer, and the standard htt [...]
Changelog #
0.1.0-beta.1 - 2026-08-04 #
Added #
OtelServerpod.install(pod)— one call installs, on the Serverpod 4.0 line:- W3C context extraction (
traceparent/tracestate/baggage) and onehttp.serverspan per endpoint method call, namedPOST endpoint.methodwithhttp.route = endpoint.methodand therpc.system.name/rpc.methodregistry attributes; http.server.request.duration(registry bucket advice) andhttp.server.active_requestsmetrics.
- W3C context extraction (
OtelServerpod.databaseInterceptor— pass to theServerpod(databaseInterceptor:)constructor parameter fordb.*client spans (find person,insert order, ...) anddb.client.operation.durationper typed database operation.db.query.textonly onunsafe*raw-SQL operations and only withcaptureDbStatements: true(privacy default OFF).OtelFutureCall— one-line-per-call tracedFutureCallbase class (extends OtelFutureCall, overrideruninstead ofinvoke).OtelServerpodSemantics— exported consts for every emitted name not in the rc.1 semconv enums.
Known limitations #
MethodStreamConnector(websocket method streams) passes through unwrapped — streaming works, stream spans are a tracked follow-up.- Dev-mode hot reload re-initializes Serverpod's connectors, dropping the endpoint span names until restart; middleware and metrics survive.
- Serverpod 3.4.x is not supported: the
databaseInterceptorconstructor parameter and the stableDatabasesurface this package wraps exist only on the 4.0 line (constraint>=4.0.0-beta.1 <4.1.0, capped because upstream reserves the right to break the Database API in minor bumps).