prometheus-relstorage
Prometheus collector for RelStorage metrics.
Exposes local object cache statistics (hits, misses, hit ratio, byte usage) and storage-level statistics (object count, database size) for RelStorage backends (PostgreSQL, MySQL, SQLite, Oracle).
Metrics exposed
| Metric | Type | Description |
|---|---|---|
relstorage_cache_hits |
Gauge | Local cache hits since last reset |
relstorage_cache_misses |
Gauge | Local cache misses since last reset |
relstorage_cache_sets |
Gauge | Local cache sets since last reset |
relstorage_cache_hit_ratio |
Gauge | Local cache hit ratio (0–1) |
relstorage_cache_bytes |
Gauge | Bytes currently used by the local cache |
relstorage_cache_bytes_limit |
Gauge | Configured byte limit of the local cache |
relstorage_db_object_count |
Gauge | Approximate number of objects in the database |
relstorage_db_size_bytes |
Gauge | Approximate physical size of the database in bytes |
Usage
from relstorage.storage import RelStorage
from prometheus_relstorage import RelStorageCollector
from prometheus_client import REGISTRY
storage = RelStorage(adapter)
# Register on the default global registry
RelStorageCollector(storage)
# Or use a custom registry
from prometheus_client import CollectorRegistry
registry = CollectorRegistry()
RelStorageCollector(storage, registry=registry)
# Or manage registration manually
collector = RelStorageCollector(storage, registry=None)
registry.register(collector)
Notes
relstorage_db_object_countandrelstorage_db_size_bytesrequire a live database connection and execute a lightweight query on each scrape. They are relatively cheap but not free, consider scraping at a lower frequency if needed.- Cache stats are in-process counters and are extremely cheap to read.
Metadata
Release files for prometheus-relstorage 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prometheus_relstorage-0.1.0.tar.gz | 7.9 kB | With provenance | Details for prometheus_relstorage-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prometheus_relstorage-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for prometheus_relstorage-0.1.0-py3-none-any.whl |
Total release size: 13.2 kB
Release files / prometheus_relstorage-0.1.0.tar.gz
| Download URL | prometheus_relstorage-0.1.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b80815bffc12010e367fc4b22b672a79d53b2005ca59e697b90d76e30aa53ad4
|
|
BLAKE2b-256 checksum How to use checksums |
f287f5de9f09ac1c1134b46e18c6bf6af6a3dff8be9d590103620bc80c35116d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logRelease files / prometheus_relstorage-0.1.0-py3-none-any.whl
| Download URL | prometheus_relstorage-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12c099c9c0395fbdd23295fd086228e998f94d09c72923b72ba6bc9535699bce
|
|
BLAKE2b-256 checksum How to use checksums |
ea22f84a33223cfcaeb6fd8f3761e4cc01c23e81b222ddbf065ef0e256fc5b15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logSecurity for prometheus-relstorage 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for prometheus_relstorage-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 18, 2026.
Transparency logA 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.