grafana / xk6-output-prometheus-remote

k6 extension to output real-time test metrics using Prometheus Remote Write.
GNU Affero General Public License v3.0
149 stars 71 forks source link

specify ServerURL in options{}? #163

Open x3nb63 opened 6 months ago

x3nb63 commented 6 months ago

Hello,

I am in a situation where I can not set K6_PROMETHEUS_RW_SERVER_URL environment variable (nor any other env var) cause I do not control the invocation of k6 run .... All I can do is submit the script.js and specify which extensions should be loaded, thats all. So xk6-output-prometheus-remote does get loaded but then sends metrics to the default of localhost:9090 which fails and I cant make that port open either.

Is there a way to specify the prometheus connectivity settings (ServerURL, user, password) directly in options{}?

x3nb63 commented 6 months ago

Playing some more I find that I also need K6_PROMETHEUS_RW_STALE_MARKERS=true, K6_PROMETHEUS_RW_PUSH_INTERVAL=60 and K6_PROMETHEUS_RW_TREND_STATS='p(95),max' to get meaningful metrics for graphing my case.

Being able to set all these environment options from the script options{} would be really great.

olegbespalov commented 5 months ago

Hi @x3nb63 !

Unfortunately, it's not possible right now to configure extensions via options :cry:

We know this is an issue, and to some degree, the https://github.com/grafana/k6/issues/883 should address it.

I'm just keeping this issue open for future prioritization/reference.