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
Copy file name to clipboardExpand all lines: README.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,19 @@ Change the Redis options (the example shows the defaults):
84
84
);
85
85
```
86
86
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
+
87
100
Using the InMemory storage:
88
101
```php
89
102
$registry = new CollectorRegistry(new InMemory());
0 commit comments