- A push operation that removes any existing metrics for the job and adds the new ones (equivalent to an HTTP PUT request).
- A push operation that updates metrics with the same name while leaving other metrics unchanged (behaving like an HTTP POST request).
- A delete operation that removes all metrics in a specified group (similar to an HTTP DELETE request).
In the example above, the CollectorRegistry is used to group all metrics together. After defining and updating a gauge metric, the
push_to_gateway function pushes the updated metric to the designated Push Gateway, ensuring that the metrics for the specified job are up to date.