grafana / synthetic-monitoring-agent

Synthetic Monitoring Agent
https://grafana.com/docs/grafana-cloud/how-do-i/synthetic-monitoring/
Apache License 2.0
164 stars 24 forks source link

Specifying `--vus` and `--iterations` prevents execution of browser checks #915

Open roobre opened 2 weeks ago

roobre commented 2 weeks ago

829 introduced an image flavor that allows running browser checks. However, for them to be fully runnable, we need to get rid of --vus, --iterations, and --duration arguments: https://github.com/grafana/k6/issues/3742

If specified, k6 will yield an error like the following:

ERRO[0000] Uncaught (in promise) GoError: browser not found in registry. make sure to set browser type option in scenario definition in order to use the browser module
    at github.com/grafana/xk6-browser/browser.syncMapBrowser.func7 (native)
    at default (file:///home/roobre/Devel/crocochrome/manualtest/testk6io.js:20:31(3))  executor=shared-iterations scenario=default

We currently specify two of those:

https://github.com/grafana/synthetic-monitoring-agent/blob/083d43bee64c27ff723fb9ad2fc3c5ee0511d5e2/internal/k6runner/k6runner.go#L589-L590

We should figure out a way to condition those arguments to the check being a browser check, or find another workaround.

Blocked by https://github.com/grafana/synthetic-monitoring-agent/pull/928, which will inform the runner of the script type and allow it to not specify these options.

peterschretlen commented 1 week ago

This is blocking browser checks running in private probes.

roobre commented 1 week ago

Renamed the issue to make it a bit more discoverable.