Skip to content

Commit dbb236b

Browse files
committed
readme: add information about new predis adapter
1 parent 16992be commit dbb236b

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ Change the Redis options (the example shows the defaults):
8484
);
8585
```
8686

87+
Using the Predis storage (requires `predis/predis`):
88+
```php
89+
$registry = new CollectorRegistry(new \Prometheus\Storage\Predis());
90+
```
91+
92+
Or with an existing connection:
93+
```php
94+
$client = new \Predis\Client(['host' => '127.0.0.1']);
95+
$registry = new CollectorRegistry(\Prometheus\Storage\Predis::fromExistingConnection($client));
96+
```
97+
98+
> **Note:** `Redis::setPrefix()` and `Predis::setPrefix()` share the same prefix. Using both adapters with different prefixes in the same application is not supported.
99+
87100
Using the InMemory storage:
88101
```php
89102
$registry = new CollectorRegistry(new InMemory());

0 commit comments

Comments
 (0)