@@ -67,11 +67,16 @@ Counters go up, and reset when the process restarts.
6767
6868``` python
6969from prometheus_client import Counter
70- c = Counter(' my_failures_total ' , ' Description of counter' )
70+ c = Counter(' my_failures ' , ' Description of counter' )
7171c.inc() # Increment by 1
7272c.inc(1.6 ) # Increment by given value
7373```
7474
75+ If there is a suffix of ` _total ` on the metric name, it will be removed. When
76+ exposing the time series for counter, a ` _total ` suffix will be added. This is
77+ for compatibility between OpenMetrics and the Prometheus text format, as OpenMetrics
78+ requires the ` _total ` suffix.
79+
7580There are utilities to count exceptions raised:
7681
7782``` python
@@ -169,6 +174,27 @@ with h.time():
169174 pass
170175```
171176
177+ ### Info
178+
179+ Info tracks key-value information, usually about a whole target.
180+
181+ ``` python
182+ from prometheus_client import Info
183+ i = Info(' my_build_version' , ' Description of info' )
184+ i.info({' version' : ' 1.2.3' , ' buildhost' : ' foo@bar' })
185+ ```
186+
187+ ### Enum
188+
189+ Enum tracks which of a set of states something is currently in.
190+
191+ ``` python
192+ from prometheus_client import Enum
193+ e = Enum(' my_task_state' , ' Description of enum' ,
194+ states = [' starting' , ' running' , ' stopped' ])
195+ e.state(' running' )
196+ ```
197+
172198### Labels
173199
174200All metrics can have labels, allowing grouping of related time series.
@@ -444,6 +470,7 @@ This comes with a number of limitations:
444470
445471- Registries can not be used as normal, all instantiated metrics are exported
446472- Custom collectors do not work (e.g. cpu and memory metrics)
473+ - Info and Enum metrics do not work
447474- The pushgateway cannot be used
448475- Gauges cannot use the ` pid ` label
449476
0 commit comments