grafana / synthetic-monitoring-agent

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

Create `k6runner.Script` and make probers aware of it #727

Closed roobre closed 2 weeks ago

roobre commented 3 weeks ago

Before this PR, MultiHTTP and Scripted Probers created k6 runners using only the raw script data ([]byte) as input to the runner. This have worked nicely, as until now runners only required two things to work: The raw script data, and a timeout that was encoded in the context for Runner.Run().

We have seen however a couple scenarios that make me think this is not enough for the near future:

For these three reasons, I think it is beneficial to create a richer type so that Probers can feed all these details to the k6 runner, which this PR does.

Please note that this PR is not feature complete, namely how timeouts are handled does not fully makes sense. This is because I tried to keep the patchset as small as possible for reviewability. How timeouts are handled is improved in #724.