Skip to main content

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.:

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metrics_common-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metrics_common-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file metrics_common-0.1.0.tar.gz.

File metadata

  • Download URL: metrics_common-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for metrics_common-0.1.0.tar.gz
Algorithm Hash digest
SHA256 af851d4b5c67282523cb34204cf6fccb41aaabc393638e9d4de4f975d666765f
MD5 0d77adb68014f07aa17f788d562e95b3
BLAKE2b-256 7734d208556ab803eecc87ee3ae6eababe4da4714f4b9ddd8966da15122f782f

See more details on using hashes here.

File details

Details for the file metrics_common-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: metrics_common-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for metrics_common-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2399e33ae7d24f50455d0cbdccc2c66058a2c1ab6f0bcf78bf6902c645e8bc72
MD5 690c06e0dddc06d9bea9793e7951f787
BLAKE2b-256 47c1ac60d502686bb65e82f3128ae7b79fa5a08ce17619bfcdb568d03c2ea026

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page