Skip to content

Commit 7dd7b0e

Browse files
author
Anand Sanmukhani
committed
Add example usage in app.py
1 parent 83db605 commit 7dd7b0e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Example Usage
2+
import prometheus_connect
3+
url="www.example-prom-url.com"
4+
token='Auth_token'
5+
6+
prom = prometheus_connect.PrometheusConnect(url=url, token=token)
7+
8+
labels = {'pod':'prometheus-k8s-0', '_id': 'f716a8c8-5d4e-417a-a95c-742c2bbcd3d2'}
9+
metric_data = (prom.get_metric_range_data(metric_name='up', start_time='20m', label_config=labels, chunk_size='10m', store_locally=True))
10+
11+
prom.pretty_print_metric(metric_data)

0 commit comments

Comments
 (0)