Metadata-Version: 2.4
Name: metrics-common
Version: 0.1.0
Summary: Shared Prometheus instrumentation for Sauron MCP servers
Requires-Python: >=3.11
Requires-Dist: prometheus-client>=0.20
Description-Content-Type: text/markdown

# metrics-common

Shared Prometheus instrumentation for Sauron MCP servers.

- `instrument_tool_calls(mcp, service_name)` — wraps every `@mcp.tool(...)` registered
  after this call with call-count and latency metrics.
- `MetricsMiddleware` — ASGI middleware that serves `GET /metrics` (Prometheus text
  exposition format) and records per-request count/latency for everything else. Wrap
  it as the outermost layer, e.g.:

  ```python
  app = MetricsMiddleware(AuthMiddleware(mcp.streamable_http_app()), service_name="dynamics")
  ```
