PromPHP / prometheus_client_php

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

Predis support? #156

Open matheusbento opened 5 months ago

matheusbento commented 5 months ago

I'm using Predis on my laravel, I tried to use something like this:

$connection = $this->app->make('redis')->connection(config('prometheus.redis'))->client();
$adapter = Redis::fromExistingConnection($connection);
$registry = new CollectorRegistry($adapter, false);
$renderer = new RenderTextFormat();
$result = $renderer->render($registry->getMetricFamilySamples());
return response()->json(['data' => $result]);

its saying that is not possible to convert Predis to Redis, but I would like to continue working with Predis,

What can I do to keep using this lib?

LKaemmerling commented 2 months ago

Currently, there is no Predis support available. However if you would have spare time, feel free to add support for Predis within an MR. I would be happy to review & merge it :)

augustonicolawd commented 2 months ago

Hey there! I'm also using Predis and facing the same problem. I just wanted to ask if PR #127 could be any useful for supporting Predis. I haven't tested with the PR yet, but I'll update if I find anything.