Skip to main content

This is the python client for metrics accumulator

Project description

Metrics Accumulator
Metrics Accumulator

metrics-accumulator-client

This is the official Python client for metric accumulator.

Get Started

Start an instance of metric-accumulator

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.

from prometheus_client import metrics
metrics.disable_created_metrics()

Create main.js file

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 for official documentation.

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

metrics_accumulator_client-1.1.2.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file metrics_accumulator_client-1.1.2.tar.gz.

File metadata

File hashes

Hashes for metrics_accumulator_client-1.1.2.tar.gz
Algorithm Hash digest
SHA256 349585458318f8b219cf0c799186a620dcc5f18ab5120c412f27c8c0de021463
MD5 ad59f8fcf4166f7dee5011f1aabc3865
BLAKE2b-256 3c0133191837268ac3ef3186c5d27a50e918467ab6b9d20ebf4abd9e20545f20

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