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

Function _group_for_sample

prometheus_client/openmetrics/parser.py:382–398  ·  view source on GitHub ↗
(sample, name, typ)

Source from the content-addressed store, hash-verified

380
381
382def _group_for_sample(sample, name, typ):
383 if typ == 'info':
384 # We can't distinguish between groups for info metrics.
385 return {}
386 if typ == 'summary' and sample.name == name:
387 d = sample.labels.copy()
388 del d['quantile']
389 return d
390 if typ == 'stateset':
391 d = sample.labels.copy()
392 del d[name]
393 return d
394 if typ in ['histogram', 'gaugehistogram'] and sample.name == name + '_bucket':
395 d = sample.labels.copy()
396 del d['le']
397 return d
398 return sample.labels
399
400
401def _check_histogram(samples, name):

Callers 2

_check_histogramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected