It is a helper for push metrics in Prometheus push gateway
Project description
prometheus-pusher
prometheus-pusher is a helper for push metrics in Prometheus push gateway.
Installation
prometheus-pusher is available on PyPI. Use pip to install:
$ pip install prometheus-pusher
Basic Usage
from prometheus_client import CollectorRegistry
from prometheus_client import Counter
from prometheus_pusher import monitoring_adapter
monitoring_registry = CollectorRegistry()
demo_count_metric = Counter("demo", "Demo count", registry=monitoring_registry)
monitoring_adapter.startup(
gateway="http://127.0.0.1:9091",
job_name="test_job",
user="testuser",
password="testpassword",
registry=monitoring_registry,
is_enabled=True,
)
def demo_send():
demo_count_metric.inc()
monitoring_adapter.send()
return
def demo_serve():
demo_count_metric.inc()
monitoring_adapter.serve()
return
if __name__ == "__main__":
demo_send()
demo_serve()
print("Test")
License
prometheus-pusher is developed and distributed under the Apache 2.0 license.
Reporting a Security Vulnerability
See our security policy.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file prometheus-pusher-0.1.0.tar.gz
.
File metadata
- Download URL: prometheus-pusher-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b80aceaf466d179a359ab3ffbe8d2d06041a6ee862e21b6375538fac3d9d0d5b |
|
MD5 | c7b17047e06120452442caf990fa569f |
|
BLAKE2b-256 | 7f8e1db496b55355629def96e26c819b9cd6a7d24e08c19b984b931a011cd5c5 |
File details
Details for the file prometheus_pusher-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: prometheus_pusher-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba6a82c71965b7db3fb1a6fff96d0d704d061ee633f6a7557b7ab414f65d00a5 |
|
MD5 | 249c90c541b5b9ade73e8a9ef3448b6a |
|
BLAKE2b-256 | 11dfb3c3649eb8d6e52873532e0f8864c05a7804c6461d6095c3353c63914e3a |