<h1 align="center" style="border-bottom: none">
<img alt="Metrics Accumulator" src="https://apoole-personal-bucket.s3.amazonaws.com/images_used_by_links/github/Logo+for+metrics+Accumulator.svg" width="600"><br>Metrics Accumulator
</h1>
# metrics-accumulator-client
This is the official Python client for [metric accumulator](https://github.com/bpoole6/metrics-accumulator).
## Get Started
Start an instance of metric-accumulator
```bash
docker run \
-p 8080:8080 \
bpoole6/metrics-accumulator
```
It is highly advised that you disable the created metrics. The Metrics accumulator doesn't handle the created metrics at this time.
```python
from prometheus_client import metrics
metrics.disable_created_metrics()
```
Create main.js file
```python
from Client import Client, strip_forward_slash
from prometheus_client import exposition, Counter,Gauge, CollectorRegistry, metrics
metrics.disable_created_metrics()
registry = CollectorRegistry()
c = Counter("hello_total", "dock", labelnames=['application'], registry=registry)
c.labels(["app"]).inc()
g = Gauge("man", "dock", labelnames=['application'], registry=registry)
g.labels(["app"]).inc()
client = Client("http://localhost:8080", "0d98f65f-074b-4d56-b834-576e15a3bfa5")
client.update_metrics("default", registry)
print(client.get_metric_group("default").content.decode())
print(client.reload_configurations().status_code)
print(client.reset_metric_group("default").status_code)
print(client.service_discovery().status_code)
print(client.current_configurations().status_code)
```
Please see [metric accumulator](https://github.com/bpoole6/metrics-accumulator) for official documentation.
Raw data
{
"_id": null,
"home_page": null,
"name": "metrics-accumulator-client",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Austin Poole <readblip@yahoo.com>",
"keywords": "client, metrics-accumulator, prometheus",
"author": null,
"author_email": "Austin Poole <readblip@yahoo.com>",
"download_url": "https://files.pythonhosted.org/packages/67/53/e05c322ed2666f10eae64cf23d7910779f5ac175abb0e391fd347f88bd25/metrics_accumulator_client-1.1.4.tar.gz",
"platform": null,
"description": "<h1 align=\"center\" style=\"border-bottom: none\">\n <img alt=\"Metrics Accumulator\" src=\"https://apoole-personal-bucket.s3.amazonaws.com/images_used_by_links/github/Logo+for+metrics+Accumulator.svg\" width=\"600\"><br>Metrics Accumulator\n</h1>\n\n\n# metrics-accumulator-client\nThis is the official Python client for [metric accumulator](https://github.com/bpoole6/metrics-accumulator).\n\n\n## Get Started\n\nStart an instance of metric-accumulator\n\n```bash\ndocker run \\ \n -p 8080:8080 \\ \n bpoole6/metrics-accumulator\n```\n\nIt is highly advised that you disable the created metrics. The Metrics accumulator doesn't handle the created metrics at this time.\n\n```python\nfrom prometheus_client import metrics\nmetrics.disable_created_metrics()\n```\n\n\n\nCreate main.js file\n```python\nfrom Client import Client, strip_forward_slash\nfrom prometheus_client import exposition, Counter,Gauge, CollectorRegistry, metrics\nmetrics.disable_created_metrics()\nregistry = CollectorRegistry()\nc = Counter(\"hello_total\", \"dock\", labelnames=['application'], registry=registry)\nc.labels([\"app\"]).inc()\n\ng = Gauge(\"man\", \"dock\", labelnames=['application'], registry=registry)\ng.labels([\"app\"]).inc()\n\nclient = Client(\"http://localhost:8080\", \"0d98f65f-074b-4d56-b834-576e15a3bfa5\")\nclient.update_metrics(\"default\", registry)\nprint(client.get_metric_group(\"default\").content.decode())\nprint(client.reload_configurations().status_code)\nprint(client.reset_metric_group(\"default\").status_code)\nprint(client.service_discovery().status_code)\nprint(client.current_configurations().status_code)\n```\n\nPlease see [metric accumulator](https://github.com/bpoole6/metrics-accumulator) for official documentation.",
"bugtrack_url": null,
"license": null,
"summary": "This is the python client for metrics accumulator",
"version": "1.1.4",
"project_urls": {
"Documentaion": "https://github.com/bpoole6/metrics-accumulator-clients/tree/main/python-client",
"Source code": "https://github.com/bpoole6/metrics-accumulator-clients/tree/main/python-client"
},
"split_keywords": [
"client",
" metrics-accumulator",
" prometheus"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "031d808d5b8907f76e81aab00e876dacc30592401fe2f69a7daf0bf7ca0798d8",
"md5": "87223bf0057586d03802b1a124f7edc3",
"sha256": "141342d488039a4380b221e06fa0f70dc6eb6ef698d4f6753f3c1bbeb7aaed82"
},
"downloads": -1,
"filename": "metrics_accumulator_client-1.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "87223bf0057586d03802b1a124f7edc3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 2590,
"upload_time": "2024-08-26T23:16:38",
"upload_time_iso_8601": "2024-08-26T23:16:38.489735Z",
"url": "https://files.pythonhosted.org/packages/03/1d/808d5b8907f76e81aab00e876dacc30592401fe2f69a7daf0bf7ca0798d8/metrics_accumulator_client-1.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6753e05c322ed2666f10eae64cf23d7910779f5ac175abb0e391fd347f88bd25",
"md5": "a1f8117947fffed138e9c241fc4c95e8",
"sha256": "2449eb021e933fc0bb134f7c47b3c461b73b6df920feaed70a105fce9f27ecae"
},
"downloads": -1,
"filename": "metrics_accumulator_client-1.1.4.tar.gz",
"has_sig": false,
"md5_digest": "a1f8117947fffed138e9c241fc4c95e8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3077,
"upload_time": "2024-08-26T23:16:24",
"upload_time_iso_8601": "2024-08-26T23:16:24.629346Z",
"url": "https://files.pythonhosted.org/packages/67/53/e05c322ed2666f10eae64cf23d7910779f5ac175abb0e391fd347f88bd25/metrics_accumulator_client-1.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-26 23:16:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bpoole6",
"github_project": "metrics-accumulator-clients",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "metrics-accumulator-client"
}