xk6-output-prometheus-remote
xk6-output-prometheus-remote copied to clipboard
specify ServerURL in options{}?
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{}?
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.
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.
Unfortunately, this is a general limit for k6, the core repository already tracks it on https://github.com/grafana/k6/issues/587. I close this issue to keep it as a centralized place.