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")
    

Publishing

Use the release script to bump patch version, build, and publish to PyPI:

export PYPI_TOKEN=pypi-...
./scripts/release.sh

The script requires a PyPI API token set via PYPI_TOKEN environment variable. Create a token at https://pypi.org/manage/account/tokens/

Metadata

Release files for metrics-common 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metrics-common 0.1.1
File Size Uploaded Provenance
metrics_common-0.1.1.tar.gz 6.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for metrics-common 0.1.1
File Interpreter ABI Platform
metrics_common-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / metrics_common-0.1.1.tar.gz

Download URL metrics_common-0.1.1.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
db77f82d16cbfa2cef0c30e35bd260c87ca5997fba5260af6efb6a4463ade0c1
BLAKE2b-256 checksum
How to use checksums
4443491eb2c2e32900cea53c2e984e9bc818907431d2b4a3285c97a75524d182
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / metrics_common-0.1.1-py3-none-any.whl

Download URL metrics_common-0.1.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
330285fbad2140744413e132774bef0189bc34a0010873738be017623a36787f
BLAKE2b-256 checksum
How to use checksums
bebe632dfe8b3406e3a22fbc964e271bc0a73eed21af2a54054cc970f7437881
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for metrics-common 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page