Created
November 22, 2018 09:20
-
-
Save kkirsanov/077355b8d0344b1c9c426800bee33d1b to your computer and use it in GitHub Desktop.
write prometheus metrics to string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from prometheus_client import CollectorRegistry, Gauge, generate_latest | |
registry = CollectorRegistry() | |
g = Gauge('reg_cnt', '1-2 per day is ok', registry=registry) | |
g.set(2) | |
print(generate_latest(registry)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment