Skip to content

Setting metric unit to "total" #542

Description

@nritsche

a4dd93b enforced counters ending in _total, but the unit= parameter doesn't seem to interact well with that. If I pass unit="total" to a Counter, I get a _total_total suffix (but only in some places?).

$ python3.6
Python 3.6.8 (default, Aug  7 2019, 17:28:10) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from prometheus_client import Counter
>>> c = Counter('my_failures', 'Description of counter', unit="total")
>>> c.inc(6.6)
>>> from prometheus_client import start_http_server, Summary
>>> start_http_server(8000)
$ curl localhost:8000/metrics
...
# HELP my_failures_total_total Description of counter
# TYPE my_failures_total_total counter
my_failures_total 6.6
my_failures_created 1.5888939194938827e+09

This is with version 0.7.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions