PromPHP / prometheus_client_php

Prometheus instrumentation library for PHP applications
https://prometheus.io/docs/concepts/metric_types/
Apache License 2.0
411 stars 90 forks source link

Meta info missing for meta key exception #126

Open mohierf opened 10 months ago

mohierf commented 10 months ago

I got this exception just after the restart of my application. I am using apache + php-fpm in a Docker container.

Exception: Meta info missing for meta key: prom:counter:cron_total:meta /app/vendor/promphp/prometheus_client_php/src/Prometheus/Storage/APCng.php 333

To get rid of this error, then only solution was to restart once again. To make some tests, I did a new restart and yet another one and again and agin ... and sometimes the error is raised and sometimes not !

mohierf commented 10 months ago

After some time (around 15 minutes), the problem is back ...

My (simplified) source code:

$adapter = new Prometheus\Storage\APCng();
self::$registry = new CollectorRegistry($adapter);

... / ...

$counter = self::$registry->getOrRegisterCounter('cron', 'total', 'Cron task counter', ['cron']);
$counter->incBy(1, ['releaseActuality']);

Note that I am also using other labels: ['releaseActuality', 'pushNotifications', ...]

mohierf commented 10 months ago

To get rid of this problem I had to downgrade the package version to 2.6.2 !

The problem did not existed in my application before the upgrade to the most recent 2.7.1. Any idea what I should change to be able to upgrade ?

applovinjake commented 5 months ago

I'm also seeing this with the APCng adapter.