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.5.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metrics_accumulator_client-1.1.5-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for metrics_accumulator_client-1.1.5.tar.gz
Algorithm Hash digest
SHA256 52ce03217e4132384b51d568516c7b9ae2414e1e81531d14fbc828a73ef8e157
MD5 190e729141e3e8b343007d2a530c45a4
BLAKE2b-256 406e0252ff474d1b2a7d7772bbb1baee7042537c565fc6184ef51dddb300acd0

See more details on using hashes here.

File details

Details for the file metrics_accumulator_client-1.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for metrics_accumulator_client-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d3a3550b550b8295f96178e3275840bff6a14c62eab05113f51585950f6c3582
MD5 1ce8242053d67dd0f5d1a1f45891749e
BLAKE2b-256 8ac946215af6a4cf05fc602524791151e046a8bb3cee5745b933fe71e15709f3

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