We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3889a5d commit 02be07aCopy full SHA for 02be07a
README.md
@@ -220,6 +220,17 @@ c.labels(method='get', endpoint='/').inc()
220
c.labels(method='post', endpoint='/submit').inc()
221
```
222
223
+Metrics with labels are not initialized when declared, because the client can't
224
+know what values the label can have. It is recommended to initialize the label
225
+values by calling the `.labels()` method alone:
226
+
227
+```python
228
+from prometheus_client import Counter
229
+c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint'])
230
+c.labels('get', '/')
231
+c.labels('post', '/submit')
232
+```
233
234
### Process Collector
235
236
The Python client automatically exports metrics about process CPU usage, RAM,
0 commit comments