8000 Fix documentation of labels method to pass keyword arguments instead … · ioggstream/client_python@60e9e4c · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 60e9e4c

Browse files
antialiasisbrian-brazil
authored andcommitted
Fix documentation of labels method to pass keyword arguments instead of a dict. (prometheus#137)
1 parent 52994d9 commit 60e9e4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

prometheus_client/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,13 @@ def labels(self, *labelvalues, **labelkwargs):
471471
c.labels('get', '/').inc()
472472
c.labels('post', '/submit').inc()
473473
474-
Labels can also be provided as a dict:
474+
Labels can also be provided as keyword arguments:
475475
476476
from prometheus_client import Counter
477477
478478
c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint'])
479-
c.labels({'method': 'get', 'endpoint': '/'}).inc()
480-
c.labels({'method': 'post', 'endpoint': '/submit'}).inc()
479+
c.labels(method='get', endpoint='/').inc()
480+
c.labels(method='post', endpoint='/submit').inc()
481481
482482
See the best practices on [naming](http://prometheus.io/docs/practices/naming/)
483483
and [labels](http://prometheus.io/docs/practices/instrumentation/#use-labels).

0 commit comments

Comments
 (0)
0