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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for metrics_accumulator_client-1.1.3.tar.gz
Algorithm Hash digest
SHA256 f4352ead101bcbb46656caae1347a5f86801be7d190a5ece08353348e86b6f31
MD5 14a76a5df9e760f343f15736d3287491
BLAKE2b-256 49920b7c164fb5c0f75c586562dbda0ac72cef117f873056840b842d34c69940

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