14 lines
532 B
Python
14 lines
532 B
Python
from prometheus import Path, Counter, Gauge, Summary, GLOBAL_REGISTRY, NOW
|
|
|
|
g1 = Gauge(value=20, path=Path("foobar_g1", {"server": "[host:xy]"}), help="foo help with bar")
|
|
g2 = Gauge(path=Path("foobar_g2", {"server": "[host:xy]"}), help="foo help with bar")
|
|
g1.inc(10)
|
|
c = Counter(
|
|
path=Path("foobar", {"server": "[host:xy]"}), help="foo help with bar")
|
|
c.set(1024.12374981723)
|
|
s = Summary(path=Path("m_sum_foo", {"tag": "sum"}), help="count on it!")
|
|
s.observe(1)
|
|
s.observe(2)
|
|
s.observe(3, NOW)
|
|
print(GLOBAL_REGISTRY.collect())
|