You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$registry = new \Prometheus\CollectorRegistry(new \Prometheus\Storage\PDO(new \PDO('sqlite::memory:')));
$renderer = new \Prometheus\RenderTextFormat();
$result = $renderer->render($registry->getMetricFamilySamples());
header('Content-type: ' . \Prometheus\RenderTextFormat::MIME_TYPE);
print($result."\n");
The second end-point keeps returning
# HELP php_info Information about the PHP environment.
# TYPE php_info gauge
php_info{version="8.4.1"} 1
Note: I had to change the line building $registry as the original line from the example in https://github.com/PromPHP/prometheus_client_php/README.md: $registry = new CollectorRegistry(new \PDO('sqlite::memory:')); triggers an error
If I persist the database in a file with new \PDO('sqlite:C:/temp/prom.sqlite'), I get this error the second time I run any of the 2 scripts:
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 index name already exists in...
It's working well after adding an IF NOT EXISTS in PDO.php line 644
$sqlIndex = "CREATE INDEX IF NOT EXISTS `name` ON `{$this->prefix}_summaries`(`name`);";);";
The text was updated successfully, but these errors were encountered:
I tried to setup PDO/Sqlite (Windows 11, prometheus_client_php 2.13.0) with the 2 end-points:
The second end-point keeps returning
Note: I had to change the line building
$registry
as the original line from the example in https://github.com/PromPHP/prometheus_client_php/README.md:$registry = new CollectorRegistry(new \PDO('sqlite::memory:'));
triggers an errorIf I persist the database in a file with
new \PDO('sqlite:C:/temp/prom.sqlite')
, I get this error the second time I run any of the 2 scripts:It's working well after adding an
IF NOT EXISTS
in PDO.php line 644The text was updated successfully, but these errors were encountered: