MCPcopy Index your code
hub / github.com/prometheus/client_python / custom_collector

Method custom_collector

tests/test_exposition.py:537–542  ·  view source on GitHub ↗
(self, metric_family)

Source from the content-addressed store, hash-verified

535 c.inc()
536
537 def custom_collector(self, metric_family):
538 class CustomCollector:
539 def collect(self):
540 return [metric_family]
541
542 self.registry.register(CustomCollector())
543
544 def assert_is_escaped(self, exp):
545 self.assertRegex(exp, r'.*\ndotted_counter_total 1.0\n.*')

Callers

nothing calls this directly

Calls 2

CustomCollectorClass · 0.70
registerMethod · 0.45

Tested by

no test coverage detected