prometheus_client_php
prometheus_client_php copied to clipboard
Meta info missing for meta key exception
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 !
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', ...]
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 ?
I'm also seeing this with the APCng adapter.