Jimdo / prometheus_client_php

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

REDIS EXPIRE key #69

Closed denis-korolev closed 6 years ago

denis-korolev commented 6 years ago

Can you explain this?

Expose the metrics:

$registry = \Prometheus\CollectorRegistry::getDefault();
$renderer = new RenderTextFormat();
$result = $renderer->render($registry->getMetricFamilySamples());
header('Content-type: ' . RenderTextFormat::MIME_TYPE);
echo $result;

It means that every page call will show more and more counters? Do i need flush redis after page call?

bracki commented 6 years ago

It means that every page call will show more and more counters?

It means that the counter (or what ever metric you chose) will increase with every call to inc().

Do i need flush redis after page call?

You never need to flush Redis. In fact I rather recommend using APC.