Skip to content

v2.2.0 - Structured Logging + Prometheus Metrics

Choose a tag to compare

@DerekEXS DerekEXS released this 14 Jul 14:02

AgentWire CORE v2.2.0

Observability infrastructure for Phase 0 stability.

New Features

Prometheus Metrics Endpoint

  • GET /metrics — Prometheus scrape format (no auth required)
  • GET / — root endpoint now lists metrics path

Metrics Exported

Metric Type Labels Purpose
agentwire_router_hit_total Counter rule_name Routing rule hit count
agentwire_routing_duration_seconds Histogram Routing decision latency
a2a_dispatch_total Counter peer, status Dispatch attempts (success/error)
a2a_message_duration_seconds Histogram peer, agent_id, rule_name End-to-end message latency
a2a_task_state_total Counter state Task state transitions

Structured Logging

  • Added structlog dependency (>=24.1.0)
  • _configure_structlog() helper for JSON-formatted logs

Dependencies

  • +structlog>=24.1.0
  • +prometheus-client>=0.20.0

Testing

  • 31 tests passing (added 5 new test classes for metrics instrumentation)
  • TestAgentCard, TestAgentRouter, TestSqliteTaskStore, TestGatewayExecutor, TestBearerTokenMiddleware
  • TestMetricsEndpoint, TestRouterMetrics, TestExecutorMetrics, TestTaskStoreMetrics (new)

Files Changed

  • server_v2/__init__.py — version bump 2.1.0 → 2.2.0
  • server_v2/requirements.txt — +structlog, +prometheus-client
  • server_v2/agent_router.py — metrics instrumentation
  • server_v2/gateway_executor.py — metrics instrumentation
  • server_v2/task_store.py — metrics instrumentation
  • server_v2/start.py — /metrics endpoint + root endpoint update
  • tests/test_v2_core.py — +5 test classes

Alignment with Strategic Goals

This release supports Phase 0 (~2029) stability requirements by providing:

  • Production-grade observability via Prometheus metrics
  • Foundation for Grafana dashboards and alerting
  • Structured logs for log aggregation pipelines

Commit: 273ccbb
Author: silk-thread silk-thread@agentwire.local