Bulk push to pushgateway #746
Answered
by
csmarchbanks
niteshsin786
asked this question in
Q&A
-
HI, I want to push bulk data, but can you help me figure out how it's done with python?cat <<EOF | curl -v --data-binary @- http://localhost:9091/metrics/job/pushgateway
|
Beta Was this translation helpful? Give feedback.
Answered by
csmarchbanks
Jan 14, 2022
Replies: 1 comment
-
You can see the example in the README for pushing to a gateway: https://github.com/prometheus/client_python#exporting-to-a-pushgateway. In your case the code would look something like: from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
registry = CollectorRegistry()
g = Gauge('test', 'test metric', ['id'], registry=registry)
g.labels("11137241").set(3.2)
...
push_to_gateway('localhost:9091', job='pushgateway', registry=registry) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
niteshsin786
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can see the example in the README for pushing to a gateway: https://github.com/prometheus/client_python#exporting-to-a-pushgateway.
In your case the code would look something like: