Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ahcub/client_python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: prometheus/client_python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 17 commits
  • 37 files changed
  • 10 contributors

Commits on Nov 17, 2025

  1. fix(multiprocess): avoid double-building child metric names (promethe…

    …us#1035) (prometheus#1146)
    
    * fix(multiprocess): avoid double-building child metric names (prometheus#1035)
    
    Signed-off-by: hazel-shen <mail@hazel.style>
    
    * test: ensure child metrics retain parent namespace/subsystem/unit
    
    Signed-off-by: hazel-shen <mail@hazel.style>
    
    ---------
    
    Signed-off-by: hazel-shen <mail@hazel.style>
    hazel-shen authored Nov 17, 2025
    Configuration menu
    Copy the full SHA
    e8f8bae View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2025

  1. Don't interleave histogram metrics in multi-process collector (promet…

    …heus#1148)
    
    The OpenMetrics exposition format requires that samples for a given
    Metric (i.e. metric name and label set) are not interleaved, but the way
    that the multi-process collector handled accumulating histogram metrics
    could end up interleaving them.  Restructure it slightly to guarantee
    that all the samples for a given Metric are kept together.
    
    Fixes: prometheus#1147
    
    Signed-off-by: Colin Watson <cjwatson@debian.org>
    cjwatson authored Nov 26, 2025
    Configuration menu
    Copy the full SHA
    a264ec0 View commit details
    Browse the repository at this point in the history
  2. Relax registry type annotations for exposition (prometheus#1149)

    * Turn Collector into a Protocol
    
    We require Python >= 3.9 now, so there's no reason to avoid this any
    more.
    
    Signed-off-by: Colin Watson <cjwatson@debian.org>
    
    * Relax registry type annotations for exposition
    
    Anything with a suitable `collect` method will do: for instance, it's
    sometimes useful to be able to define a class whose `collect` method
    yields all metrics from a registry whose names have a given prefix, and
    such a class doesn't need to inherit from `CollectorRegistry`.
    
    Signed-off-by: Colin Watson <cjwatson@debian.org>
    
    ---------
    
    Signed-off-by: Colin Watson <cjwatson@debian.org>
    cjwatson authored Nov 26, 2025
    Configuration menu
    Copy the full SHA
    13df124 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2025

  1. Added compression support in pushgateway (prometheus#1144)

    * feat(): Added compression support in pushgateway
    
    Signed-off-by: ritesh-avesha <ritesh@aveshasystems.com>
    
    * fix(): Incorporated changes for PR review comments
    
    Signed-off-by: ritesh-avesha <ritesh@aveshasystems.com>
    
    * fix(): Incorporated changes for PR review comments, lint issues
    
    Signed-off-by: ritesh-avesha <ritesh@aveshasystems.com>
    
    * fix(): lint issues
    
    Signed-off-by: ritesh-avesha <ritesh@aveshasystems.com>
    
    ---------
    
    Signed-off-by: ritesh-avesha <ritesh@aveshasystems.com>
    ritesh-avesha authored Dec 12, 2025
    Configuration menu
    Copy the full SHA
    7b99592 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2026

  1. Add Django exporter (prometheus#1088) (prometheus#1143)

    Signed-off-by: Julie Rymer <rymerjulie.pro@gmail.com>
    Chadys authored Jan 5, 2026
    Configuration menu
    Copy the full SHA
    e1cdc20 View commit details
    Browse the repository at this point in the history

Commits on Jan 12, 2026

  1. Release 0.24.0

    Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
    csmarchbanks committed Jan 12, 2026
    Configuration menu
    Copy the full SHA
    c5024d3 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2026

  1. Pass correct registry to MultiProcessCollector (prometheus#1152)

    `registry` does not exists in prometheus_client.registry, as that causes
    an ImportError the test was skipped in the 3.9 scenario.
    
    Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
    jelly authored Jan 14, 2026
    Configuration menu
    Copy the full SHA
    6f0e967 View commit details
    Browse the repository at this point in the history
  2. Release 0.24.1

    Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
    csmarchbanks committed Jan 14, 2026
    Configuration menu
    Copy the full SHA
    f417f6e View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2026

  1. Migrate to Github Actions (prometheus#1153)

    * Migrate to Github Actions
    * Pin github actions versions
    
    ---------
    
    Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
    csmarchbanks authored Jan 21, 2026
    Configuration menu
    Copy the full SHA
    a854135 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2026

  1. Fix server shutdown documentation (prometheus#1155)

    Add server.server_close() call to shutdown example to properly
    release the port. Without this call, attempting to restart the
    server on the same port results in "Address already in use" error.
    
    Fixes prometheus#1068
    
    Signed-off-by: Varun Chawla <varun_6april@hotmail.com>
    veeceey authored Feb 9, 2026
    Configuration menu
    Copy the full SHA
    1cf53fe View commit details
    Browse the repository at this point in the history
  2. Fix spaces in grouping key values for push_to_gateway (prometheus#1156)

    Use base64 encoding for grouping key values containing spaces,
    similar to how values with slashes are handled. This prevents
    spaces from being converted to '+' signs by quote_plus().
    
    Fixes prometheus#1064
    
    Signed-off-by: Varun Chawla <varun_6april@hotmail.com>
    veeceey authored Feb 9, 2026
    Configuration menu
    Copy the full SHA
    671f75c View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2026

  1. Support MultiProcessCollector in RestrictedRegistry. (prometheus#1150)

    * Support MultiProcessCollector in RestrictedRegistry.
    
    This change makes it so that the RestrictedRegistry will always attempt to collect metrics from a collector for which it couldn’t find any metrics name. Although this can be used generally, this is meant to be used with MultiProcessCollector.
    
    This changes the current behavior of the code but should be somehow safe as it enables filtering in case where it was not working previously. If this is an issue, an alternative approach with an explicit flag could be used (set either in the MultiProcessCollector or in the registry).
    
    The intent here is to allow collecting a subset of metrics from production fastapi servers (running in multiprocess mode). So not having to change the library usage in these servers is advantageous to have filtering work out-of-the-box with this change.
    
    Signed-off-by: Mathias Kende <mathias.kende@mistral.ai>
    
    * Make the new support for collectors without names be explicit.
    
    This adds a parameters to the constructor of CollectorRegistry to allow that new behavior rather than make it be the default.
    
    Signed-off-by: Mathias Kende <mathias.kende@mistral.ai>
    
    * Fix comments
    
    Signed-off-by: Mathias Kende <mathias.kende@mistral.ai>
    
    ---------
    
    Signed-off-by: Mathias Kende <mathias.kende@mistral.ai>
    mathias-kende authored Feb 18, 2026
    Configuration menu
    Copy the full SHA
    8673912 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2026

  1. docs: add API reference for all metric types (prometheus#1159)

    * docs: add API reference for all metric types
    
    Adds constructor parameter tables, method documentation, and runnable
    real-world examples for Counter, Gauge, Histogram, Summary, Info, and
    Enum. The _index.md quick-pick table now covers all six types. Also
    fixes labels.md which was missing remove(), remove_by_labels(), and
    clear() -- the metric pages were already linking to it for those methods.
    
    Closes prometheus#1021
    
    Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>
    
    * docs: address review feedback on counter example and table header
    
    Revert quick-start counter example to use 'my_failures' (no _total suffix)
    since the library appends it automatically. Rename 'Value goes' column to
    'Behavior' in the metric type overview table for clarity across all six types.
    
    Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>
    
    * docs: rename table column to 'Update model'
    
    Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>
    
    ---------
    
    Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>
    k1chik authored Apr 9, 2026
    Configuration menu
    Copy the full SHA
    daa1626 View commit details
    Browse the repository at this point in the history
  2. Release 0.25.0

    Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
    csmarchbanks committed Apr 9, 2026
    Configuration menu
    Copy the full SHA
    2cd1738 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2026

  1. docs: add API reference for pushgateway, textfile, and multiprocess (p…

    …rometheus#1162)
    
    Closes prometheus#1161
    
    Adds parameter tables and formal API reference sections to three pages
    that previously had examples but no parameter documentation.
    
    pushgateway.md: documents push_to_gateway, pushadd_to_gateway,
    delete_from_gateway, instance_ip_grouping_key, and all four built-in
    handlers (default, basic_auth, tls_auth, passthrough_redirect).
    
    textfile.md: documents write_to_textfile with all four parameters
    including the previously undocumented escaping and tmpdir, plus atomic
    write semantics and error behavior.
    
    multiprocess/_index.md: documents MultiProcessCollector constructor and
    mark_process_dead with parameter tables including the previously
    undocumented path parameter on both.
    
    Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>
    k1chik authored Apr 17, 2026
    Configuration menu
    Copy the full SHA
    130a4e8 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2026

  1. Expose measured duration on Timer context manager (prometheus#1166)

    Assigning the .time() context manager (with ... as t) now yields a Timer
    whose .duration attribute holds the observed value in seconds after the
    block exits. This lets callers reuse the measurement (logging, further
    metrics) without calling default_timer() a second time.
    
    Signed-off-by: Lukáš Vokráčko <lukas@vokracko.cz>
    vokracko authored Apr 24, 2026
    Configuration menu
    Copy the full SHA
    e75a74f View commit details
    Browse the repository at this point in the history
  2. docs: add API reference for CollectorRegistry and custom collector cl…

    …asses (prometheus#1169)
    
    Closes prometheus#1163
    
    collector/custom.md: Collector protocol section (collect/describe), value vs
    labels mutual exclusivity note, full constructor and add_metric tables for
    GaugeMetricFamily, CounterMetricFamily, SummaryMetricFamily,
    HistogramMetricFamily, and InfoMetricFamily, plus a runnable real-world example.
    
    collector/_index.md: constructor parameter tables for ProcessCollector,
    PlatformCollector, and GCCollector, with exported metrics listed for each.
    
    registry/_index.md (new): CollectorRegistry constructor and all public methods
    (register, unregister, collect, restricted_registry, get_sample_value,
    set_target_info, get_target_info), the global REGISTRY instance, and examples
    for isolated registry usage and registry=None.
    
    All code examples verified by running them in Python.
    
    Signed-off-by: k1chik <107162115+k1chik@users.noreply.github.com>
    k1chik authored Apr 24, 2026
    Configuration menu
    Copy the full SHA
    482656c View commit details
    Browse the repository at this point in the history
Loading