MCPcopy Index your code
hub / github.com/prometheus/client_python / pushadd_to_gateway

Function pushadd_to_gateway

prometheus_client/exposition.py:654–685  ·  view source on GitHub ↗

PushAdd metrics to the given pushgateway. `gateway` the url for your push gateway. Either of the form 'http://pushgateway.local', or 'pushgateway.local'. Scheme defaults to 'http' if none is provided `job` is the job label to be attached to all pushed metrics

(
        gateway: str,
        job: str,
        registry: Optional[Collector],
        grouping_key: Optional[Dict[str, Any]] = None,
        timeout: Optional[float] = 30,
        handler: Callable = default_handler,
        compression: CompressionType = None,
)

Source from the content-addressed store, hash-verified

652
653
654def pushadd_to_gateway(
655 gateway: str,
656 job: str,
657 registry: Optional[Collector],
658 grouping_key: Optional[Dict[str, Any]] = None,
659 timeout: Optional[float] = 30,
660 handler: Callable = default_handler,
661 compression: CompressionType = None,
662) -> None:
663 """PushAdd metrics to the given pushgateway.
664
665 `gateway` the url for your push gateway. Either of the form
666 'http://pushgateway.local', or 'pushgateway.local'.
667 Scheme defaults to 'http' if none is provided
668 `job` is the job label to be attached to all pushed metrics
669 `registry` is a Collector, normally an instance of CollectorRegistry
670 `grouping_key` please see the pushgateway documentation for details.
671 Defaults to None
672 `timeout` is how long push will attempt to connect before giving up.
673 Defaults to 30s, can be set to None for no timeout.
674 `handler` is an optional function which can be provided to perform
675 requests to the 'gateway'.
676 Defaults to None, in which case an http or https request
677 will be carried out by a default handler.
678 See the 'prometheus_client.push_to_gateway' documentation
679 for implementation requirements.
680 `compression` selects the payload compression. Supported values are 'gzip'
681 and 'snappy'. Defaults to None (no compression).
682
683 This replaces metrics with the same name, job and grouping_key.
684 This uses the POST HTTP method."""
685 _use_gateway('POST', gateway, job, registry, grouping_key, timeout, handler, compression)
686
687
688def delete_from_gateway(

Callers 2

test_pushaddMethod · 0.90

Calls 1

_use_gatewayFunction · 0.85

Tested by 2

test_pushaddMethod · 0.72