Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions prometheus_client/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,13 @@ def labels(self, *labelvalues, **labelkwargs):
c.labels('get', '/').inc()
c.labels('post', '/submit').inc()

Labels can also be provided as a dict:
Labels can also be provided as keyword arguments:

from prometheus_client import Counter

c = Counter('my_requests_total', 'HTTP Failures', ['method', 'endpoint'])
c.labels({'method': 'get', 'endpoint': '/'}).inc()
c.labels({'method': 'post', 'endpoint': '/submit'}).inc()
c.labels(method='get', endpoint='/').inc()
c.labels(method='post', endpoint='/submit').inc()

See the best practices on [naming](http://prometheus.io/docs/practices/naming/)
and [labels](http://prometheus.io/docs/practices/instrumentation/#use-labels).
Expand Down