# prometheus-pusher
[](https://github.com/bigbag/prometheus-pusher/actions?query=workflow%3ACI)
[](https://codecov.io/gh/bigbag/prometheus-pusher)
[](https://pypi.python.org/pypi/prometheus-pusher)
[](https://pypistats.org/packages/prometheus-pusher)
[](https://github.com/bigbag/prometheus-pusher)
[](https://github.com/bigbag/prometheus-pusher/blob/master/LICENSE)
**prometheus-pusher** is a helper for push metrics in Prometheus push gateway.
* [Project Changelog](CHANGELOG.md)
## Installation
prometheus-pusher is available on PyPI.
Use pip to install:
$ pip install prometheus-pusher
## Basic Usage
```py
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](https://github.com/bigbag/prometheus-pusher/security/policy).
Raw data
{
"_id": null,
"home_page": "https://github.com/bigbag/prometheus-pusher",
"name": "prometheus-pusher",
"maintainer": "Pavel Liashkov",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "pavel.liashkov@protonmail.com",
"keywords": null,
"author": "Pavel Liashkov",
"author_email": "pavel.liashkov@protonmail.com",
"download_url": "https://files.pythonhosted.org/packages/7f/8e/1db496b55355629def96e26c819b9cd6a7d24e08c19b984b931a011cd5c5/prometheus-pusher-0.1.0.tar.gz",
"platform": "POSIX",
"description": "# prometheus-pusher\n\n[](https://github.com/bigbag/prometheus-pusher/actions?query=workflow%3ACI)\n[](https://codecov.io/gh/bigbag/prometheus-pusher)\n[](https://pypi.python.org/pypi/prometheus-pusher)\n[](https://pypistats.org/packages/prometheus-pusher)\n[](https://github.com/bigbag/prometheus-pusher)\n[](https://github.com/bigbag/prometheus-pusher/blob/master/LICENSE)\n\n\n**prometheus-pusher** is a helper for push metrics in Prometheus push gateway.\n\n* [Project Changelog](CHANGELOG.md)\n\n## Installation\n\nprometheus-pusher is available on PyPI.\nUse pip to install:\n\n $ pip install prometheus-pusher\n\n## Basic Usage\n\n```py\nfrom prometheus_client import CollectorRegistry\nfrom prometheus_client import Counter\n\nfrom prometheus_pusher import monitoring_adapter\n\nmonitoring_registry = CollectorRegistry()\ndemo_count_metric = Counter(\"demo\", \"Demo count\", registry=monitoring_registry)\n\n\nmonitoring_adapter.startup(\n gateway=\"http://127.0.0.1:9091\",\n job_name=\"test_job\",\n user=\"testuser\",\n password=\"testpassword\",\n registry=monitoring_registry,\n is_enabled=True,\n)\n\n\ndef demo_send():\n demo_count_metric.inc()\n monitoring_adapter.send()\n return\n\n\ndef demo_serve():\n demo_count_metric.inc()\n monitoring_adapter.serve()\n return\n\n\nif __name__ == \"__main__\":\n demo_send()\n demo_serve()\n print(\"Test\")\n \n```\n\n## License\n\nprometheus-pusher is developed and distributed under the Apache 2.0 license.\n\n## Reporting a Security Vulnerability\n\nSee our [security policy](https://github.com/bigbag/prometheus-pusher/security/policy).\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "It is a helper for push metrics in Prometheus push gateway",
"version": "0.1.0",
"project_urls": {
"Download": "https://pypi.python.org/pypi/prometheus-pusher",
"Homepage": "https://github.com/bigbag/prometheus-pusher"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "11dfb3c3649eb8d6e52873532e0f8864c05a7804c6461d6095c3353c63914e3a",
"md5": "249c90c541b5b9ade73e8a9ef3448b6a",
"sha256": "ba6a82c71965b7db3fb1a6fff96d0d704d061ee633f6a7557b7ab414f65d00a5"
},
"downloads": -1,
"filename": "prometheus_pusher-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "249c90c541b5b9ade73e8a9ef3448b6a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9732,
"upload_time": "2024-10-18T18:33:52",
"upload_time_iso_8601": "2024-10-18T18:33:52.136721Z",
"url": "https://files.pythonhosted.org/packages/11/df/b3c3649eb8d6e52873532e0f8864c05a7804c6461d6095c3353c63914e3a/prometheus_pusher-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7f8e1db496b55355629def96e26c819b9cd6a7d24e08c19b984b931a011cd5c5",
"md5": "c7b17047e06120452442caf990fa569f",
"sha256": "b80aceaf466d179a359ab3ffbe8d2d06041a6ee862e21b6375538fac3d9d0d5b"
},
"downloads": -1,
"filename": "prometheus-pusher-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "c7b17047e06120452442caf990fa569f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 8319,
"upload_time": "2024-10-18T18:33:54",
"upload_time_iso_8601": "2024-10-18T18:33:54.145922Z",
"url": "https://files.pythonhosted.org/packages/7f/8e/1db496b55355629def96e26c819b9cd6a7d24e08c19b984b931a011cd5c5/prometheus-pusher-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-18 18:33:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bigbag",
"github_project": "prometheus-pusher",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "prometheus-pusher"
}