I noticed that registering 2 different countrers (different namespaces and names) with 2 different labels creates a weird situation where metrics are messed up.
$counter = $this->metricsClient->getOrRegisterCounter(
'oosm',
'location_put_offline_total',
'Total of location put offline',
['location_name']
);
$counter->inc([$event->getLocationName()]);
When I hit both this counters, the metric endpoint is returning:
# HELP oosm_location_put_offline_total Total of location put offline
# TYPE oosm_location_put_offline_total counter
oosm_location_put_offline_total{location_name="Springfield Avenue"} 1 <---- Ok
# HELP oosm_successful_login_total Total of successful login
# TYPE oosm_successful_login_total counter
oosm_location_put_offline_total{role="Springfield Avenue"} 1 <---- This is wrong!
oosm_successful_login_total{role="ADMINISTRATOR"} 2 <---- Ok
I noticed that registering 2 different countrers (different namespaces and names) with 2 different labels creates a weird situation where metrics are messed up.
Here's how I register the 2 counters:
Counter 1
Counter 2
When I hit both this counters, the metric endpoint is returning:
Could be related to: #34 ?
PHP version:
7.1.13