Skip to content

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.
    • BaseAsyncGrpcServerInterceptor wrapped every RPC type in a coroutine; unary_stream and stream_stream handlers are now wrapped in an async generator
    • Added an overridable intercept_stream hook; the default runs intercept around 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 through context.write
  • Mid-stream error mapping - AsyncGrpcServerExceptionInterceptor and GrpcServerExceptionInterceptor now map errors raised while a stream is being consumed to gRPC statuses instead of UNKNOWN.
    • The sync interceptor guards any returned iterator, not only generators
  • Stream duration metrics - rpc.server.duration is 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.feature running 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.feature and otel.feature that serve real ArchiPy FastAPI apps with uvicorn and stream text/event-stream responses.
    • 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: pyjwt 2.15.1, boto3 and boto3-stubs 1.43.104, scylla-driver 3.29.12, types-grpcio 1.84.0.20260928.