5.22.0 — 2026-10-27¶
← 5.23.0 | 5.21.2 → | ↑ 5.x series
Added¶
Helpers - Pydantic AI Instrumentation¶
- Pydantic AI Auto-Instrumentation - Pydantic AI agents now export their traces and metrics through ArchiPy's OpenTelemetry providers.
OtelUtilsinitialization callsAgent.instrument_allwith ArchiPy's tracer and meter providers whenpydantic-ai-slimis installed- Agent runs (
invoke_agent <name>), model requests (chat <model>) and tool calls (execute_tool <name>) become spans, and token usage becomes thegen_ai.client.token.usagemetric - Delegated agents are traced under the calling tool, and agents run inside FastAPI or gRPC requests join the request trace
- Settings an application installed itself with
Agent.instrument_allare left alone - In Elastic APM an agent run inside a request is a span of the request transaction; an agent run outside a request is a root span, which APM types as
unknown
Configs - Pydantic AI¶
- PydanticAIConfig - Added the
BaseConfig.PYDANTIC_AIsection that controls the instrumentation.INSTRUMENTATION_ENABLED(defaulttrue) turns the instrumentation offINSTRUMENTATION_INCLUDE_CONTENT(defaulttrue) keeps prompts, model output and tool arguments and results in span attributes; turn it off when they hold personal or secret dataINSTRUMENTATION_INCLUDE_BINARY_CONTENT(defaultfalse) keeps images, audio and documents in span attributesINSTRUMENTATION_INCLUDE_MODEL_REQUEST_PARAMETERS(defaulttrue),INSTRUMENTATION_VERSION(default6, or5) andINSTRUMENTATION_USE_AGGREGATED_USAGE_ATTRIBUTE_NAMES(defaulttrue) map to the matchingInstrumentationSettingsoptions
Tests¶
Tests - Pydantic AI¶
- Pydantic AI Telemetry Scenarios - Added
features/pydantic_ai_otel.featurewith 22 scenarios against the real OpenTelemetry Collector and Elastic APM Server containers.- Agent, model request and tool spans, the token usage metric, delegated, concurrent and sequential agents, and agents inside FastAPI and gRPC requests
- The configuration switches, and Elastic APM Server both directly and through the collector
- Added the feature to the
telemetryCI group
Tests - Elastic APM¶
- APM Scenarios in Separate Features - Moved the Elastic APM scenarios of every adapter into their own
<feature>_apm.featurefiles (Elasticsearch, email, Kafka, Keycloak, MinIO, Redis, ScyllaDB, Temporal, Vault and the SQL atomic transactions), so a feature that does not need the telemetry stack no longer starts it. - APM Search Helper - The Elastic APM test container treats a 503 from the search as "no events yet" and skips stored documents that carry no
processorfield, instead of failing on them.
Tests - Keycloak¶
- Keycloak Feature Split - Split the Keycloak adapter and auth guard scenarios into smaller features (authentication flows and mappers, clients and tokens, management, tokens and organizations, FastAPI guards, gRPC guards, cache and Envoy guards) so each runs in its own CI group.
- Split Hostnames and Envoy - The Keycloak tests run with split hostnames and through Envoy.
- Test Fixes - Whole hosts are compared in the client node step, the audience is built from the realm issuer, the container probe keeps going while the health endpoint answers an HTTP error, and the adapter steps import
KeycloakConfig.
Tests - SQLAlchemy¶
- Atomic Transactions Per Database - Split
features/atomic_transactions.featureinto one feature per database (PostgreSQL, MySQL, SQLite and StarRocks), each with an APM feature of its own, and moved Kafka client span scenarios intofeatures/kafka_clients_spans.feature.
Chore¶
Chore - CI¶
- Behave Matrix - Reworked how CI runs the Behave features.
- Features run in descriptive, parallel groups per package, ordered slowest first, and only the groups a pull request can affect run (selected with
dorny/paths-filter) - The
coregroup runs every feature no other group lists, so a new feature file needs no workflow edit - Superseded runs are cancelled, and jobs install the locked dependencies with only the extras they need
make behaveandscripts/behave_parallel.pytakeEXCLUDE/--excludeto leave features out of a run
- Features run in descriptive, parallel groups per package, ordered slowest first, and only the groups a pull request can affect run (selected with
- New Workflows - Added a labeler that labels pull requests by the paths they change, a dependency review, a link check for the docs and README, and a workflow that comments on the issue a merged pull request names.
- Removed Workflows - Removed the Bandit workflow. A CodeQL workflow was added and dropped again because the repository uses the default setup.
Chore - Repository¶
- Issue Forms - Replaced the Markdown issue templates with forms (bug report, feature request, documentation improvement, question), added the issue template config and tailored the pull request template.
Chore - Docs¶
- README and Docs Links - Updated the README badges and the CI badge in
docs/index.md, and fixed the dead links the link check found. - Contributor Rules - Added a repository map, don'ts and a definition of done to
AGENTS.md, and documented in the Cursor rules the findings workflow (issue, fix, pull request, merge), labels, the Behave CI groups, small pull requests and keeping the issue checklist up to date.
Chore - Test Images¶
- Test Container Images - Updated the StarRocks image from
4.1.6to4.1.7and addedENVOY__IMAGE=envoyproxy/envoy:v1.40.1to.env.test; MySQL stays on the 8.4 LTS line.
Dependencies¶
Dependencies - Extras¶
- pydantic-ai and otel-pydantic-ai Extras - Added
archipy[pydantic-ai](pydantic-ai-slim>=2.62.0) andarchipy[otel-pydantic-ai], which also installsarchipy[otel].
Dependencies - Lower Bounds¶
- Lower Bounds Match uv.lock - Raised the lower bounds to the locked versions.
cachetools>=7.2.6,grpcio>=1.85.0andgrpcio-health-checking>=1.85.0- Development tools
boto3-stubs>=1.43.119,ruff>=0.17.3andty>=0.0.92