Skip to main content

Prometheus metric support

Project description

py_metric_support

Prometheus metric helper.

Install

pip install -e .

Or with requirements files:

pip install -r requirements.txt
pip install -r requirements-dev.txt

Usage

from py_metric_support import Measure, MetricSupport

MetricSupport.counter("requests_total", ("path", "/health")).inc()
MetricSupport.gauge("workers").set(4)
MetricSupport.gauge_on_scrape("build_info", "version", callback=lambda: Measure(1, "0.1.0"))

print(MetricSupport.to_prometheus())
print(MetricSupport.to_json_string())

Project details


Download files

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

Source Distribution

py_metric_support-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

py_metric_support-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: py_metric_support-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for py_metric_support-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df02a444f034ab38bfeb8f2175725d307d547319ce5697c543163f0ea964bd4c
MD5 b9eb2e2384a41c90eb3c60aaf2eaa9c4
BLAKE2b-256 7a0dfd420dee5a1a496ce15e1df657ef332d84df834a361c59030856471fb60d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_metric_support-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b398a37fba434e8a9f1e5ac8b0da331a423b89b6438d9aa9c1763a1238af85c1
MD5 006359e84b55033ba5c975b7c76015dd
BLAKE2b-256 c9e1d58586f244343ffc132a47411ee16b651b169c10a60f3b1dfc6e3c124e1d

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 Pingdom Monitoring Sentry Error logging StatusPage Status page