NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #216 most downloaded on PyPI
Python client for the Prometheus monitoring system.
Last release 2 months ago
24 Jul 2026
Ships fairly regularly
a new release about every 3 months
Most releases are documented
notes for 51 of 59 stable releases
1 version withdrawn
withdrawn after publishing
12 years old
60 releases · first in 2015
Expose measured duration on Timer context manager by @vokracko in #1166
Full Changelog: v0.25.0...v0.26.0
One column per quarter.
Fix spaces in grouping key values for push_to_gateway by @veeceey in #1156
Full Changelog: v0.24.1...v0.25.0
[Django] Pass correct registry to MultiProcessCollector by @jelly in #1152
Add an AIOHTTP exporter by @Lexicality in #1139
Full Changelog: v0.23.1...v0.24.0
fix: use tuples instead of packaging Version by @efiop in #1136
UTF-8 Content Negotiation by @ywwg in #1102
write_to_textfile for custom tmpdir by @aadityadhruv in #1115Full Changelog: v0.22.1...v0.23.0
BugFix: Skip validating and parsing comment lines early ( #1108 ) by @wissamir in #1109
Full Changelog: v0.22.0...v0.22.1
Add support for native histograms in OM parser by @vesari in #1040
write_to_textfile leaves back temp files on errors by @ethanschen in #1066Full Changelog: v0.21.0...v0.22.0
[BUGFIX] Revert incorrect use of reentrant locks. #1076
[BUGFIX] Revert incorrect use of reentrant locks. #1076
[CHANGE] Reject invalid (not GET or OPTION) HTTP methods. #1019 [ENHANCEMENT] Allow writing metrics when holding a lock for the metric in the same thr
[CHANGE] Reject invalid (not GET or OPTION) HTTP methods. #1019 [ENHANCEMENT] Allow writing metrics when holding a lock for the metric in the same thread. #1014 [BUGFIX] Check for and error on None label values. #1012 [BUGFIX] Fix timestamp comparison. #1038
[CHANGE/BUGFIX] Update OpenMetrics Content Type to 1.0.0. #997
[FEATURE] support HTTPS/TLS in start_http_server. #946 [BUGFIX] fix: error in determining timestamp less than. #979
[FEATURE] support HTTPS/TLS in start_http_server. #946 [BUGFIX] fix: error in determining timestamp less than. #979
[CHANGE] Remove support for Python versions < 3.8. #936 [FEATURE] Add mostrecent aggregation to Gauge. #967 [ENHANCEMENT] Typing improvements. #935, #
[CHANGE] Remove support for Python versions < 3.8. #936
[FEATURE] Add mostrecent aggregation to Gauge. #967
[ENHANCEMENT] Typing improvements. #935, #970
[ENHANCEMENT] Allow enabling or disabling _created metrics from code. #973
[BUGFIX] Change #!/usr/bin/python to #!/usr/bin/env python in remaining places. #945
[BUGFIX] Use #!/usr/bin/env python instead of #!usr/bin/python in bridge/graphite.py. #928
[BUGFIX] Use #!/usr/bin/env python instead of #!usr/bin/python in bridge/graphite.py. #928
[ENHANCEMENT] Add additional typing. #887, #903 [BUGFIX] Fix typo in python_gc_objects_collected metadata. #894 [BUGFIX] Do not include .pyc files in
[ENHANCEMENT] Add additional typing. #887, #903 [BUGFIX] Fix typo in python_gc_objects_collected metadata. #894 [BUGFIX] Do not include .pyc files in the build wheel. #906
[FEATURE] Support HELP text in multiprocess mode. #804 [ENHANCEMENT] Reduce the mmap minimum size. #853 [BUGFIX] Use the correct OpenMetrics encoder w
[FEATURE] Support HELP text in multiprocess mode. #804
[ENHANCEMENT] Reduce the mmap minimum size. #853
[BUGFIX] Use the correct OpenMetrics encoder when application/openmetrics-text is requested in ASGI apps. #864
[BUGFIX] Allow Prometheus format parser to handle a missing space after labels. #872
[CHANGE] Remove choose_formatter. choose_formatter only existed for v0.14.x and was deprecated in v0.14.1. https://github.com/prometheus/client_python…
[CHANGE] Remove choose_formatter. choose_formatter only existed for v0.14.x and was deprecated in v0.14.1. https://github.com/prometheus/client_python/pull/846
[FEATURE] Support TLS auth when using push gateway with tls_auth_handler. https://github.com/prometheus/client_python/pull/841
[ENHANCEMENT] Add sum, livemin, and livemax multiprocess modes for Gauges. https://github.com/prometheus/client_python/pull/794
[BUGFIX] Revert choose_encoder being renamed to choose_formatter to fix a breaking change. For the 0.14.x release cycle choose_formatter will still ex…
[BUGFIX] Revert choose_encoder being renamed to choose_formatter to fix a breaking change. For the 0.14.x release cycle choose_formatter will still exist, but will be removed in 0.15.0. #796
[ENHANCEMENT] Continued typing improvements and coverage. #759, #771, #781 [ENHANCEMENT] Allow binding to IPv6 addresses. #657 [ENHANCEMENT] Negotiate
[ENHANCEMENT] Continued typing improvements and coverage. #759, #771, #781
[ENHANCEMENT] Allow binding to IPv6 addresses. #657
[ENHANCEMENT] Negotiate gzip content-encoding, enabled by default. #776
[ENHANCEMENT] Allow disabling _created metrics via the PROMETHEUS_DISABLE_CREATED_SERIES environment variable. #774
[BUGFIX] Correct minor typo in exception raised when exemplar labels are too long. #773
[BUGFIX] Relax some type constraints that were too strict. #754, #755, #756, #758 [BUGFIX] Explicitly export functions with __all__. #757
[BUGFIX] Relax some type constraints that were too strict. #754, #755, #756, #758
[BUGFIX] Explicitly export functions with __all__. #757
[CHANGE] Drop support for Python versions 2.7, 3.4, and 3.5. #718 [FEATURE] Support adding labels when using .time() #730 [ENHANCEMENT] Begin to add t
[CHANGE] Drop support for Python versions 2.7, 3.4, and 3.5. #718
[FEATURE] Support adding labels when using .time() #730
[ENHANCEMENT] Begin to add type hints to functions. #705
[ENHANCEMENT] Improved go-to-declaration behavior for editors. #747
[BUGFIX] Remove trailing slashes from pushgateway URLS. #722
[BUGFIX] Catch non-integer bucket/count values. #726
[FEATURE] Exemplar support (excludes multiprocess) #669 [ENHANCEMENT] Add support for Python 3.10 #706 [ENHANCEMENT] Restricted Registry will handle m
[FEATURE] Exemplar support (excludes multiprocess) #669
[ENHANCEMENT] Add support for Python 3.10 #706
[ENHANCEMENT] Restricted Registry will handle metrics added after restricting #675, #680
[ENHANCEMENT] Raise a more helpful error if a metric is not observable #666
[BUGFIX] Fix instance_ip_grouping_key not working on MacOS #687
[BUGFIX] Fix assertion error from favicion.ico with Python 2.7 #715
[CHANGE] Specify that the labelvalues argument on metric constructors is internal by renaming it to _labelvalues. If you are affected by this change,
[CHANGE] Specify that the labelvalues argument on metric constructors is internal by renaming it to _labelvalues. If you are affected by this change, it is likely that the metric was not being registered. #660
[BUGFIX] write_to_textfile will overwrite files in windows. If using python 3.4 or newer the replace will be atomic. #650
[BUGFIX] Support lowercase prometheus_multiproc_dir environment variable in mark_process_dead. #644
[BUGFIX] Support lowercase prometheus_multiproc_dir environment variable in mark_process_dead. #644
[CHANGE] The prometheus_multiproc_dir environment variable is deprecated in favor of PROMETHEUS_MULTIPROC_DIR. #624
prometheus_multiproc_dir environment variable is deprecated in favor of PROMETHEUS_MULTIPROC_DIR. #624passthrough_redirect_handler. #622clear() method to remove all children. #642[ENHANCEMENT] Add support for python3.9 (#600) [ENHANCEMENT] Various updates for latest OpenMetrics draft spec (#576 #577)
[ENHANCEMENT] Add support for python3.9 (#600) [ENHANCEMENT] Various updates for latest OpenMetrics draft spec (#576 #577)
[FEATURE] Added ASGI application (#512) [FEATURE] Add support for parsing timestamps in Prometheus exposition format. (#483) [FEATURE] Add target_info
[FEATURE] Added ASGI application (#512)
[FEATURE] Add support for parsing timestamps in Prometheus exposition format. (#483)
[FEATURE] Add target_info to registries (#453)
[ENHANCEMENT] Handle empty and slashes in label values for pushgateway (#547 #442)
[ENHANCEMENT] Various updates for latest OpenMetrics draft spec (#434 #445 #538 #460 #496)
[ENHANCEMENT] Add HELP output for auto-created metrics (#471)
[ENHANCEMENT] Use mmap.PAGESIZE constant as value for first read. (#505)
[ENHANCEMENT] Add __repr__ method to metric objects, make them debug friendly. (#481)
[ENHANCEMENT] Add observability check to metrics (#455 #520)
[BUGFIX] Fix urlparse in python >= 3.7.6 (#497)
[BUGFIX] Cleaning up name before appending unit on name (#543)
[BUGFIX] Allow for OSError on Google App Engine (#448)
[BUGFIX] multiprocess: don't crash on missing gauge_live/sum files (#424) [BUGFIX] correctly bind method on Python 2.x
[BUGFIX] multiprocess: don't crash on missing gauge_live/sum files (#424) [BUGFIX] correctly bind method on Python 2.x (#403)
[ENHANCEMENT] Multiprocess exposition speed boost (#421) [ENHANCEMENT] optimize openmetrics text parsing (~4x perf) (#402) [ENHANCEMENT] Add python3.7
[ENHANCEMENT] Multiprocess exposition speed boost (#421) [ENHANCEMENT] optimize openmetrics text parsing (~4x perf) (#402) [ENHANCEMENT] Add python3.7 support (#418) [ENHANCEMENT] Change exemplar length limit to be only for label names+values (#397) [BUGFIX] Disable gcCollector for pypy (#380)
[ENHANCEMENT] Better exceptions on exposition failure (#364) [BUGFIX] Fix deadlock in gcCollector, metrics are now different (#371) [BUGFIX] Fix threa
[ENHANCEMENT] Better exceptions on exposition failure (#364) [BUGFIX] Fix deadlock in gcCollector, metrics are now different (#371) [BUGFIX] Fix thread leak in Python 3.7 (#356) [BUGFIX] Make the format strings compatible with Python 2.6 (#361) [BUGFIX] parser: ensure samples are of type Sample (#358)
[ENHANCEMENT] Be more resilient to certain file corruptions (#329) [ENHANCEMENT] Permit subclassing of MetricsHandler (#339) [ENHANCEMENT] Updates bas
[ENHANCEMENT] Be more resilient to certain file corruptions (#329) [ENHANCEMENT] Permit subclassing of MetricsHandler (#339) [ENHANCEMENT] Updates based on latest OpenMetrics draft spec discussions (#338 #346) [BUGFIX] In multiprocess mode, ensure that metrics initialise to the correct file (#346) [BUGFIX] Avoid re-entrant calls to GC collector's callback (#343)
[BUGFIX] Disable GCCollector in multiprocess mode to prevent a deadlock
[BUGFIX] Disable GCCollector in multiprocess mode to prevent a deadlock
[BUGFIX] Fix OpenMetrics http negotiation handling
[BUGFIX] Fix OpenMetrics http negotiation handling
[CHANGE] Counter time series will now always be exposed with _total, and counter metrics will have a _total suffix stripped. This is as the internal d
[CHANGE] Counter time series will now always be exposed with _total, and counter metrics will have a _total suffix stripped. This is as the internal data model is now OpenMetrics, rather than Prometheus Text Format (#300) [CHANGE] Samples now use a namedtuple (#300) [FEATURE] Add OpenMetrics exposition and parser (#300 #306) [FEATURE] Add Info, Stateset, Enum, GaugeHistogram support for OpenMetrics (#300) [FEATURE] Add timestamp support for Prometheus text format exposition (#300) [FEATURE] Add garbage collection metrics (#301) [ENHANCEMENT] If reading multiprocess file, open it readonly. (#307) [BUGFIX] Fix bug in WSGI app code. (#307) [BUGFIX] Write to multiprocess files directly (#315)
[BUGFIX] Fix handing of escaping in parser [BUGFIX] Fix concurrency issues with timers
[BUGFIX] Fix handing of escaping in parser [BUGFIX] Fix concurrency issues with timers
[ENHANCEMENT] 4.5x speedup in parser #282 [ENHANCEMENT] Performance improvements for multiproc mode #266 [BUGFIX] Fix FD leak in multiproc mode #269
[ENHANCEMENT] 4.5x speedup in parser #282 [ENHANCEMENT] Performance improvements for multiproc mode #266 [BUGFIX] Fix FD leak in multiproc mode #269
[CHANGE/ENHANCEMENT] Set default timeout of 30s on pushgateway actions [ENHANCEMENT] Various performance improvements to multi-process mode [BUGFIX] H
[CHANGE/ENHANCEMENT] Set default timeout of 30s on pushgateway actions [ENHANCEMENT] Various performance improvements to multi-process mode [BUGFIX] Handle QUERY_STRING not being present for WSGI
[BUGFIX] Handle non-ASCII characters in /proc/pid/stat [BUGFIX] Make check for Python 2.6 work on development versions of Python
[BUGFIX] Handle non-ASCII characters in /proc/pid/stat [BUGFIX] Make check for Python 2.6 work on development versions of Python
[FEATURE] Add UntypedMetricFamily [FEATURE] Allow start_http_server to take a registry, for use in multiprocesses setups [ENCHANCEMENT] Don't log requ
[FEATURE] Add UntypedMetricFamily [FEATURE] Allow start_http_server to take a registry, for use in multiprocesses setups [ENCHANCEMENT] Don't log requests to WSGI server [ENCHANCEMENT] Improved error handling when prometheus_multiproc_dir isn't set [BUGFIX] Handle /proc/self/fd not being accessible [BUGFIX] Workaround urlparse bug in Python 2.6
[BUGFIX] In multi-proc mode correctly handle metrics being created in both parent and child processes [BUGFIX] Handle iterators being passed as labeln
[BUGFIX] In multi-proc mode correctly handle metrics being created in both parent and child processes [BUGFIX] Handle iterators being passed as labelnames to *MetricFamily [ENHANCEMENT] Python 3.6 now officially supported
[FEATURE] Support all modes of mutli-process operation in mutliproc mode, and it's a little faster too [FEATURE] Add platform collector by default to
[FEATURE] Support all modes of mutli-process operation in mutliproc mode, and it's a little faster too [FEATURE] Add platform collector by default to add information about the Python/JVM runtime [ENHANCEMENT] Httpserver now multi-threaded [BUGFIX] Use namespace/subsystem correctly in multiproc mode [BUGFIX] Support labelnames being an empty list
[FEATURE] Support basic auth and allow for custom handlers for talking to the pushgateway [BUGFIX] Support trailing commas in parser
[FEATURE] Support basic auth and allow for custom handlers for talking to the pushgateway [BUGFIX] Support trailing commas in parser
[FEATURE] Add optional describe() method on collectors, fallback to "collect() if not present and explcitly requested on the registry. This is enabled
[FEATURE] Add optional describe() method on collectors, fallback to "collect() if not present and explcitly requested on the registry. This is enabled on the default registry [FEATURE] Use describe() method to raise an exception on duplicate time series names in a registry [FEATURE] Add support for ?name[]=xxx to limit what metrics names are returned over http from a registry [BUGFIX] An exception in a collector now causes a 500 rather than a blank 200 [BUGFIX] Disallow colon in label names [BUGFIX] Correctly parse untyped metrics into one metric, not several
[BUGFIX] Gauge.set_to_current_time to return correct value on Python3
[BUGFIX] Gauge.set_to_current_time to return correct value on Python3
[FEATURE] Experimental multi-process supported added
[FEATURE] Experimental multi-process supported added
It's no longer possible to pass in a dict to labels(), instead use labels(dict).
It's no longer possible to pass in a dict to labels(), instead use labels(**dict).
[FEATURE] labels function supports labels as keyword argurments [CHANGE] labels function no longer supports being passed a dict [FEATURE] Pushgateway can now be specified as a URL prefix, allowing for https [IMPROVEMENT] Cleanup of process collector [FEATURE] Signatures of decorated functions are now preserved
[FEATURE] Added twisted HTTP exposition [FEATURE] Added WSGI HTTP exposition [ENHANCEMENT] Improved consistency of metric help strings [ENHANCEMENT] I
[FEATURE] Added twisted HTTP exposition [FEATURE] Added WSGI HTTP exposition [ENHANCEMENT] Improved consistency of metric help strings [ENHANCEMENT] Improved docstrings [ENHANCEMENT] Performance optimisations on inner classes [BUGFIX] Tests now work on more platforms and Python versions
[BUGFIX] Fix path for pushgateway
[BUGFIX] Fix path for pushgateway
Note that push_to_gateway/pushadd_to_gateway now requires an explicit registry argument, as the usual use case for batch jobs is to push a small custo
Note that push_to_gateway/pushadd_to_gateway now requires an explicit registry argument, as the usual use case for batch jobs is to push a small custom registry.
[FEATURE] Add time() to gauges
[FEATURE] Provide MetricFamilies to make custom collectors easier
[FEATURE] Graphite bridge now allows adding a namespace prefix to exported sample names
[FEATURE] Text format parser
[IMPROVEMENT] Improved docstrings
[IMPROVEMENT] push_to_gateway/pushadd_to_gateway now requires explicit registry argument
[ENHANCEMENT] Allow value implementation to be pluggable
[ENHANCEMENT] Removed resource warning in tests
[BUGFIX] Pushgateway tests now work on Python 3.4+
[FEATURE] Pushgateway support added [ENHANCEMENT] Improved error handling in graphite bridge
[FEATURE] Pushgateway support added [ENHANCEMENT] Improved error handling in graphite bridge
[FEATURE] Can push to graphite [IMPROVEMENT] Handles non-primitive values better [BUGFIX] Works on Windows again
[FEATURE] Can push to graphite [IMPROVEMENT] Handles non-primitive values better [BUGFIX] Works on Windows again
[FEATURE] Add the ability to specify labels as a dict of labelname->labelvalue [FEATURE] Add support for callbacks for gauges.
[FEATURE] Add the ability to specify labels as a dict of labelname->labelvalue [FEATURE] Add support for callbacks for gauges.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →