Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow final push at exit when using prometheus-push-gateway #413

Open
nstinus opened this issue Nov 22, 2023 · 1 comment
Open

Allow final push at exit when using prometheus-push-gateway #413

nstinus opened this issue Nov 22, 2023 · 1 comment
Labels
C-exporter Component: exporters such as Prometheus, TCP, etc. E-intermediate Effort: intermediate. T-enhancement Type: enhancement. T-ergonomics Type: ergonomics.

Comments

@nstinus
Copy link
Contributor

nstinus commented Nov 22, 2023

For short lived batch processes, a periodic push isn't sufficient and ideally we want to push the metrics right before exiting.
AFAICT, one would need to call Prometheus.render() and push manually. Since everything is in place, perhaps a PrometheusHandle.push() could be exposed. Additionally, a flag in PrometheusBuilder::with_push_gateway(..., at_exit = true | false) to try a push during a drop?

@tobz
Copy link
Member

tobz commented Nov 23, 2023

Yeah, this is a little tricky because there's no existing mechanism for having asynchronous Drop logic, so it would definitely have to be a method on PrometheusHandle that allows for triggering a push if the push gateway mode is enabled.

Time is tight/precious for me at the moment, so no idea when I'd be able to get to this, but I'm willing to accept a PR and guide the design of it if that's something you're interested in.

@tobz tobz added C-exporter Component: exporters such as Prometheus, TCP, etc. E-intermediate Effort: intermediate. T-enhancement Type: enhancement. T-ergonomics Type: ergonomics. labels Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-exporter Component: exporters such as Prometheus, TCP, etc. E-intermediate Effort: intermediate. T-enhancement Type: enhancement. T-ergonomics Type: ergonomics.
Projects
None yet
Development

No branches or pull requests

2 participants