Closed leedm777 closed 6 years ago
I have the need for counter metrics that are set explicitly, instead of being incremented. I don't have access to the system tracking the metric, I only have whatever the current value is. One good example of this is to provide an uptime metric.
uptime
$u = getCurrentUptime(); $uptime = $registry->registerCounter($ns, 'uptime_seconds_total', 'Current uptime in seconds'); $uptime->set($u);
You wouldn't use a Counter but rather a Gauge for that type of thing.
Counter
Gauge
$gauge = $registry->getOrRegisterGauge('test', 'some_gauge', 'it sets', ['type']); $gauge->set(2.5, ['blue']);
I have the need for counter metrics that are set explicitly, instead of being incremented. I don't have access to the system tracking the metric, I only have whatever the current value is. One good example of this is to provide an
uptime
metric.