5.5.2 — 2026-09-29¶
← 5.6.0 | 5.5.1 → | ↑ 5.x series
Fixed¶
Helpers - gRPC Interceptors¶
- Streaming RPCs with OpenTelemetry - Response-streaming RPCs failed under the async server with
'async for' requires an object with __aiter__ method, got coroutine.BaseAsyncGrpcServerInterceptorwrapped every RPC type in a coroutine;unary_streamandstream_streamhandlers are now wrapped in an async generator- Added an overridable
intercept_streamhook; the default runsinterceptaround handler invocation and relays the stream, so existing subclasses keep working - Added
iterate_stream_result, which handles async-generator handlers and coroutine-style handlers that push responses throughcontext.write
- Mid-stream error mapping -
AsyncGrpcServerExceptionInterceptorandGrpcServerExceptionInterceptornow map errors raised while a stream is being consumed to gRPC statuses instead ofUNKNOWN.- The sync interceptor guards any returned iterator, not only generators
- Stream duration metrics -
rpc.server.durationis now recorded when a stream finishes, with the status of any mid-stream error.- The sync metrics interceptor previously recorded duration as soon as the stream was created
- Added
AsyncGrpcServerOtelMetricsInterceptor.intercept_stream
Tests¶
Tests - gRPC¶
- Streaming interceptor scenarios - Added BDD scenarios in
otel.featurerunning a real local gRPC server, sync and async, with the exception, metrics, and full (contrib OTel, metrics, exception) interceptor stacks.- Unary, server-streaming, client-streaming, and bidirectional RPCs
- Mid-stream error mapping, coroutine-style stream handlers, and sync plain-iterator handlers
- Stream duration datapoints and status
Tests - FastAPI¶
- Server-sent events scenarios - Added BDD scenarios in
app_utils.featureandotel.featurethat serve real ArchiPy FastAPI apps with uvicorn and streamtext/event-streamresponses.- Event delivery, incremental flushing (also with GZip enabled), and events kept after a mid-stream failure
- Client disconnect, concurrent clients, CORS, TrustedHost, and pre-stream error mapping
- OpenTelemetry server spans and HTTP server duration metrics for streamed responses
Dependencies¶
- Dependency floors - Raised lower bounds to the locked versions:
pyjwt2.15.1,boto3andboto3-stubs1.43.104,scylla-driver3.29.12,types-grpcio1.84.0.20260928.