{"library":"oslo-metrics","title":"Oslo Metrics","description":"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.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install oslo-metrics"],"cli":{"name":"oslo-metrics","version":"usage: oslo-metrics [-h] [--config-dir DIR] [--config-file PATH] [--debug]"}},"imports":["from oslo_metrics import MetricsClient","from oslo_metrics import get_metrics_client","from oslo_metrics import Counter"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from oslo_metrics import get_metrics_client, Counter\nfrom oslo_config import cfg\n\n# Configuration (example using oslo.config)\nconf = cfg.ConfigOpts()\nconf.register_opts(cfg.CONF.opts)\n\nclient = get_metrics_client(conf)\n\n# Create a counter metric\ncounter = Counter('requests.total', 'Total number of requests')\nclient.register_metric(counter)\n\n# Increment counter\ncounter.increment()\n\n# Flush metrics to backend\nclient.flush()","lang":"python","description":"Basic usage: configure and use a MetricClient, register metrics, and flush.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}