Some workloads may not want to run an HTTP server to expose metrics,
especially in the case of short-lived batch jobs. For these cases metrics
can also be manually "pushed" to a Prometheus Pushgateway instance, though
there are drawbacks.
push_to_gateway() is used to push metrics, and delete_from_gateway() is
used to clean them up when the workload is finished.
# NOT RUN {register_default_metrics()
push_to_gateway("localhost:9091", job = "batch-job-1")
# Some time later...delete_from_gateway("localhost:9091", job = "batch-job-1")
# }# NOT RUN {# }