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

k6runner/test: ensure logs are sent to loki when runner reports user errors #741

Closed roobre closed 1 week ago

roobre commented 1 week ago

Doesn't actually fix, but related to https://github.com/grafana/synthetic-monitoring-app/issues/835.

When running a script on a remote runner, roughly two kind of errors can occur:

  1. An error occurs reaching the remote runner, meaning that the script could not be scheduled. kan example of this can be network errors reaching our infra.
  2. The script was executed, and it returned an error. In this case the runner returns the k6 error log as a part of the response body.

This PR adds tests asserting that those errors in the response body (2) are sent to Loki regardless of the reported errorCode.