4.2.0 — 2026-02-21¶
← 4.3.0 | 4.1.0 → | ↑ 4.x series
Added¶
Helpers - Interceptors¶
- Metric Interceptors - Enhanced Prometheus metrics collection across frameworks
- Implemented
FastAPIMetricInterceptorfor HTTP request metrics with path template support - Added
ACTIVE_REQUESTSgauge metric to both sync and async gRPC interceptors - Implemented path template caching in FastAPI interceptor for improved performance
- Added comprehensive metrics for request duration, status codes, and concurrency tracking
- Implemented
Helpers - Utils¶
- Prometheus Server Management - Added server deduplication functionality
- Implemented
_is_prometheus_server_running()helper to detect existing Prometheus servers - Prevents duplicate Prometheus server starts across FastAPI and gRPC applications
- Checks port availability before starting Prometheus HTTP server
- Added
prometheus_utilsmodule withis_prometheus_server_running()andstart_prometheus_server_if_needed()helpers for shared Prometheus server management across adapters
- Implemented
Adapters - Temporal¶
-
Prometheus Metrics Integration - Added Temporal metrics collection with Prometheus
- Implemented
TemporalRuntimeManagersingleton for managing Runtime instances with telemetry - Integrated Runtime with PrometheusConfig into TemporalAdapter client and Worker
- Added
ENABLE_METRICSandMETRICS_PORTconfiguration options toTemporalConfig - Temporal SDK metrics now exported to Prometheus when metrics are enabled
- Metrics include workflow operations, activity executions, and task queue operations
- Implemented
-
BDD Test Coverage - Added comprehensive Behave tests for Temporal adapter
- Implemented persistent event loop per scenario to keep workers alive across steps
- Added test workflows and activities for various scenarios (greeting, signal/query, timeout, retry)
- Integrated Temporal container support with dev mode SQLite backend
- Fixed workflow execution to use
run_asynchelper for proper async handling - Added BDD tests for Temporal metrics collection scenarios
Changed¶
Configs¶
- Prometheus Configuration - Added Prometheus configuration to BaseConfig
- Added
PROMETHEUS.IS_ENABLEDflag for enabling/disabling Prometheus metrics globally - Added
PROMETHEUS.SERVER_PORTconfiguration for Prometheus HTTP server port - Updated
.env.testwith Prometheus configuration for testing - Added Temporal metrics configuration (
TEMPORAL.ENABLE_METRICS,TEMPORAL.METRICS_PORT)
- Added
Adapters - StarRocks¶
- Async Driver Migration - Improved async database driver support
- Switched async driver from
aiomysqltoasyncmyfor better StarRocks compatibility - Added
autocommit=Falsein connect_args for both sync and async sessions to ensure proper transaction support - Implemented
_get_connect_args()in sync session manager with configurableconnect_timeout - Updated async
_get_connect_args()withconnect_timeout(asyncmy only supports connect_timeout) - Added
CONNECT_TIMEOUTdefault (10s) toStarRocksSQLAlchemyConfigfor MySQL protocol requirement - Upgraded StarRocks test container image from 4.0.4 to 4.0.6
- Added automatic test database creation in
StarRocksTestContainer - Added
asyncmy>=0.2.11dependency to starrocks-async extra
- Switched async driver from
Adapters - ScyllaDB¶
- Docker Support - Enhanced ScyllaDB adapter for containerized environments
- Added address translator for Docker/NAT environments
- Configured connection pool limits per host
- Updated test containers and config template
Tests¶
-
Test Structure Improvements - Enhanced test organization and coverage
- Converted Redis tests to scenario outlines for both mock and container testing
- Unified metric interceptor tests with scenario outlines
- Support for FastAPI, gRPC, and AsyncgRPC in parameterized tests
- Removed duplicate test scenarios
-
Container Optimization - Improved test container configuration
- Optimized Elasticsearch test container memory limits to prevent OOM kills
- Refactored container tag validation logic in
ContainerManager
Fixed¶
Adapters - Redis¶
- Type Safety - Fixed Redis adapter type handling
- Added type check for unexpected awaitable results from sync Redis client in
spop()method - Prevents async/sync mismatch errors in Redis operations
- Added type check for unexpected awaitable results from sync Redis client in
Type Safety¶
- Ty Compliance - Resolved all 418 type checker errors
- Replaced
**kwargs: objectwith**kwargs: Anyacross adapters - Added
NoReturntype hints to exception handlers - Updated to Pydantic v2 validator signatures
- Modernized enums to use
StrEnum - Added type casts and None checks for improved type safety
- All linting checks now pass with zero errors
- Replaced
Chore¶
Dependencies¶
- Core Dependencies - Updated dependency constraints to match uv.lock versions
- Updated dependency lock file (pydantic-settings, redis, sentry-sdk, typer, uvicorn, virtualenv, pymdown-extensions)
- Aligned version constraints across all extras and groups
- Ensured consistency between pyproject.toml and uv.lock