Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: k6runner: improve error handling for k6 output #1063

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nadiamoe
Copy link
Member

@nadiamoe nadiamoe commented Nov 25, 2024

Closes #1060

This pull requests brings a number of improvements to how the local k6 runner, mostly used in private probe context, handles errors from k6. Most prominently:

  • For errors that we can attribute to the script contents (user errors), it no longer returns nil, err (understood as "k6 could not be run"), but rather a response with a textual representation of the error, and the k6 output. This still causes the test to be marked as failed, but the error is reported to Loki and thus made visible.
  • Logs are now parsed and searched for specific strings that, in SM context, are considered fatal errors.
  • Limits are imposed on how many bytes will be read for log and metrics output. These are last-resort measures to prevent the whole payload to be rejected by mimir or loki if it is too big.

Based on #1061 as I want CI/CD to be able to run.

@nadiamoe nadiamoe force-pushed the port-runner branch 2 times, most recently from 41eaa1f to 856e47e Compare November 25, 2024 14:52
@nadiamoe nadiamoe changed the base branch from main to dockerfile-chromium-alpine November 25, 2024 14:52
Base automatically changed from dockerfile-chromium-alpine to main November 26, 2024 14:09
An error occurred while trying to automatically change base from dockerfile-chromium-alpine to main November 26, 2024 14:09
@devtony15
Copy link

hello @roobre, thank you for your work! Do you have an estimate for when this might be merged?

@nadiamoe
Copy link
Member Author

Hey @devtony15, I expect to finish testing this week, so hopefully it will be merged a few days later. As per Grafana policy we have stopped making releases due to the holiday season, so my expectation is for this to be released early January.

@nadiamoe nadiamoe marked this pull request as ready for review January 9, 2025 11:31
@nadiamoe nadiamoe requested a review from a team as a code owner January 9, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backport cloud k6 runner improvements to k6 local runner
2 participants