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

Function delete_from_gateway

prometheus_client/exposition.py:688–714  ·  view source on GitHub ↗

Delete metrics from 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,
        grouping_key: Optional[Dict[str, Any]] = None,
        timeout: Optional[float] = 30,
        handler: Callable = default_handler,
)

Source from the content-addressed store, hash-verified

686
687
688def delete_from_gateway(
689 gateway: str,
690 job: str,
691 grouping_key: Optional[Dict[str, Any]] = None,
692 timeout: Optional[float] = 30,
693 handler: Callable = default_handler,
694) -> None:
695 """Delete metrics from the given pushgateway.
696
697 `gateway` the url for your push gateway. Either of the form
698 'http://pushgateway.local', or 'pushgateway.local'.
699 Scheme defaults to 'http' if none is provided
700 `job` is the job label to be attached to all pushed metrics
701 `grouping_key` please see the pushgateway documentation for details.
702 Defaults to None
703 `timeout` is how long delete will attempt to connect before giving up.
704 Defaults to 30s, can be set to None for no timeout.
705 `handler` is an optional function which can be provided to perform
706 requests to the 'gateway'.
707 Defaults to None, in which case an http or https request
708 will be carried out by a default handler.
709 See the 'prometheus_client.push_to_gateway' documentation
710 for implementation requirements.
711
712 This deletes metrics with the given job and grouping_key.
713 This uses the DELETE HTTP method."""
714 _use_gateway('DELETE', gateway, job, None, grouping_key, timeout, handler)
715
716
717def _use_gateway(

Callers 2

test_deleteMethod · 0.90

Calls 1

_use_gatewayFunction · 0.85

Tested by 2

test_deleteMethod · 0.72