Registry / observability / oslo-metrics

oslo-metrics

JSON →
library0.16.0pypypiunverified

Oslo Metrics is a library for collecting and reporting metrics in OpenStack services. It provides a pluggable backend system for metrics such as counters, gauges, and histograms. The current version is 0.15.1, with a relatively stable release cadence.

pip install oslo-metrics
INSTALL
IMPORT
SIG · OSLO-METRICS
O
oslo-metrics
observabilitypythonv0.16.0
Install
5.1s avg
Import
Disk
49MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.16.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 45.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.1s · import 0.000s · 47MB
49MB installed
● package 49MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MetricsClient
from oslo_metrics import MetricsClient
from oslo_metrics import MetricsClient

Basic usage: configure and use a MetricClient, register metrics, and flush.

from oslo_metrics import get_metrics_client, Counter from oslo_config import cfg # Configuration (example using oslo.config) conf = cfg.ConfigOpts() conf.register_opts(cfg.CONF.opts) client = get_metrics_client(conf) # Create a counter metric counter = Counter('requests.total', 'Total number of requests') client.register_metric(counter) # Increment counter counter.increment() # Flush metrics to backend client.flush()
oslo-metrics --version
Debug
Known issues
breakingIn version 0.12.0, the API for creating metrics changed. Older 'Counter', 'Gauge', 'Histogram' classes were replaced with new metric types. Old code using the old classes will break.
fix
Update imports and usage to use new metric classes (e.g., from oslo_metrics import Counter).
affects: >=0.12.0
gotchaMetrics client is a singleton per process. Calling get_metrics_client multiple times returns the same instance, which can lead to unintended sharing of state.
fix
Use a single client instance, or pass conf consistently.
affects: all
deprecatedThe 'oslo.metrics' namespace (with dot) is deprecated in favor of 'oslo_metrics' (with underscore). Using the old dotted package name will cause ImportError in future releases.
fix
Replace 'import oslo.metrics' with 'import oslo_metrics'.
affects: >=0.15.0
Upgrade
Version history
0.16.0latest on PyPI · released May 18, 2026
Audit
Dependencies
oslo.configrequiredRequired for configuration options
oslo.logrequiredUsed for logging
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
2
Resources
oslo-metrics — pip install oslo-metrics · libregistry