k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Prometheus PushGateway output

Open lucasoares opened this issue 1 year ago • 7 comments

Feature Description

Pushgateway is one of the best option to send metrics without using scraping mode: https://github.com/prometheus/pushgateway

I think K6 would have great benefits from allowing metrics to be sent using the push gateway instead of the server remote write.

Currently there is a plugin that tries to do it, but it lacks completeness and also have several bugs (trends not handled as histograms, metri labels not being exported, etc): https://github.com/martymarron/xk6-output-prometheus-pushgateway

Suggested Solution (optional)

No response

Already existing or connected issues / PRs (optional)

No response

lucasoares avatar Apr 25 '23 21:04 lucasoares

Hi @lucasoares, I interpret this request for integrating the extension or natively support the Push Gateway in the k6's core.

At the moment, based on the demand this is outside our high-priority list. I leave this issue open for gathering more feedback and reactions.

Currently there is a plugin that tries to do it, but it lacks completeness and also have several bugs (trends not handled as histograms, metri labels not being exported, etc): https://github.com/martymarron/xk6-output-prometheus-pushgateway

I see you're contributing to the extension, currently, it is the best approach for getting faster a working output.

I think K6 would have great benefits from allowing metrics to be sent using the push gateway instead of the server remote write.

Can you report your use case, please?

codebien avatar Apr 28 '23 09:04 codebien

Hello, our use case has to do with security. The company policies do not allow us to open another port on Prometheus, Given that we already have push gateways in operation, leveraging this existing infrastructure seems like a practical, secure and faster solution

looking forward

grancu avatar Aug 08 '23 13:08 grancu

Hello, we run a HA prometheus setup and when K6 pushes metrics to prometheus, there is no guarantee of metrics going into both servers. When we want to see the loadtest metrics on grafana dashboards, the dashboard sometimes shows metrics & sometimes it doesnt (the reason being that metrics are available only in one of the prometheus server).

A better approach would be to enable PushGateway compatibility from which both the prometheus servers can scrape the metrics.

IamGroot19 avatar Sep 04 '23 15:09 IamGroot19

Hey @IamGroot19, @lucasoares do you guys know if xk6-output-prometheus-pushgateway has been fixed ?

Pierre-Raffa avatar Feb 12 '24 12:02 Pierre-Raffa

Hey @IamGroot19, @lucasoares do you guys know if xk6-output-prometheus-pushgateway has been fixed ?

Idk, I haven't been using it for a few months

lucasoares avatar Feb 13 '24 03:02 lucasoares

At this point this is still not being worked on from the core team, and there are good chance it will never will be.

If you want to report issues or want to asks for status on development on the extension - I would recommend openning issues there.

The author of the issues is not in this comments and the k6 core team has no affiliation (AFAIK) with the extension .

mstoykov avatar Feb 13 '24 08:02 mstoykov

i would def agree that only a remote write solution is not possible in several orgs, (also case for us), due to policies etc. However, when we tried to send to PGW metrics once out of a job, we had performance issues. I guess it can be configured and run more smoothly, but not sure if PGW is made for the amount of metrics that can be generated from k6 or any other load test, but any alternative apart from remote-write would be really great.

hkailantzis avatar Feb 15 '24 13:02 hkailantzis