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.2.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.2.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for py_metric_support-0.2.0.tar.gz
Algorithm Hash digest
SHA256 69ba4187df3e096e4fb0ae283f1b2620e134361c02ec42943980daaefef3768b
MD5 608592d9469bf79ea51b1a5f869822e6
BLAKE2b-256 3f3021a577cbccf835b57655a064e2a6fae5ed79d0f6ee56f257b4dd6d1e2d1b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_metric_support-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 734f5f2a8aae31f8b5c794e6214c2f18cc7aaf97b11f710a18fb49743a2f4d8a
MD5 69da7521ba0018060d7f2576fbf06f02
BLAKE2b-256 8fc6c445bf39bba01140339793c9b8af60464c2ef36ea0dcfd7393ebaca5a24b

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