Data Visualization

Hello,

Is it possible to directly visualize data from load tests on Grafana Cloud (k6)?
I have a pipeline for each load test, and I want to create a data visualization in Datadog (just results or real-time data). This is possible when the test runs locally, but not in the cloud - as I know.

I am using this GitHub action to run the load test: GitHub - grafana/run-k6-action: GitHub Action for running k6 tests

welcome @eco

Are the test results being dumped out as json

I thought about it, but how can I download json results from Grafana Cloud? I haven’t found anything interesting.

So are the outputs in JSON? Was the question

The outputs are visible on Grafana Cloud in specific project for example, and in pipeline I can only see output like that:

Run grafana/run-k6-action@v1
:mag: Validating test run files.
:test_tube: Found 1 valid K6 tests out of total 1 test files.

  1. /root/github-action-runner-work/GrafanaCloud-k6/GrafanaCloud-k6/bilka-basket/PREPROD/VUS-100.js
    :robot: Running test: k6 cloud /root/github-action-runner-work/GrafanaCloud-k6/GrafanaCloud-k6/bilka-basket/PREPROD/VUS-100.js

    /\      Grafana   /‾‾/  
    
/\  /  \     |\  __   /  /   

/ / \ | |/ / / ‾‾\
/ \ | ( | (‾) |
/ __________ \ ||_\ ____/

Init [ 0% ] Validating script options
:globe_with_meridians: Test run URLs:
/bilka-basket/PREPROD/VUS-100.js

 test status: Finished

:white_check_mark: Test passed

So, when I will know how to export results data as JSON - the task will be completed.

1 Like

Or the output with debug: true:

Run grafana/run-k6-action@v1
:mag: Validating test run files.
:test_tube: Found 1 valid K6 tests out of total 1 test files.

  1. /root/github-action-runner-work/GrafanaCloud-k6/GrafanaCloud-k6/bilka-basket/PREPROD/VUS-100.js
    :robot: Running test: k6 cloud /root/github-action-runner-work/GrafanaCloud-k6/GrafanaCloud-k6/bilka-basket/PREPROD/VUS-100.js

    /\      Grafana   /‾‾/  
    
/\  /  \     |\  __   /  /   

/ / \ | |/ / / ‾‾\
/ \ | ( | (‾) |
/ __________ \ ||_\ ____/

Init [ 0% ] Loading test script…
Init [ 0% ] Building the archive…
Init [ 0% ] Validating script options
Init [ 0% ] Uploading archive
:globe_with_meridians: Test run URLs:
/bilka-basket/PREPROD/VUS-100.js: https://.grafana.net/a/k6-app/runs/3478582
execution: cloud
script: /root/github-action-runner-work/GrafanaCloud-k6/GrafanaCloud-k6/bilka-basket/PREPROD/VUS-100.js
output: https://
.grafana.net/a/k6-app/runs/3478582

 scenarios: (100.00%) 1 scenario, 15 max VUs, 6m5s max duration (incl. graceful stop):
          * ramping_load: Up to 1.00 iterations/s for 5m50s over 5 stages (maxVUs: 15, startTime: 5s, gracefulStop: 10s)

Run [ 0% ] Initializing the cloud test
Unable to get pull request number for the commit, skipping comment creation

Run [ 0% ] Waiting…

Run [ 0% ] Waiting…

Run [ 0% ] Initializing

Run [ 0% ] Initializing

Run [ 0% ] Initializing

Run [ 0% ] Initializing

Run [ 0% ] Initializing

Run [ 0% ] Initializing

Run [ 0% ] Initializing

Run [ 0% ] Initializing

Run [ 0% ] Initializing

Run [ 1% ] 0m13.0s/6m5s

Run [ 43% ] 2m46.0s/6m5s

Run [ 100% ] 6m04.0s/6m5s

Run [ 100% ] 6m5s

Run [ 100% ] 6m5s
test status: Finished

Run [ 100% ] Finished
:rotating_light: time=“2024-11-08T11:11:16Z” level=error msg=“Thresholds have been crossed”
:rotating_light: Test failed with code: 99 and signal: null
:rotating_light: Some tests failed

1 Like

k6 run --out json=test_results.json script.js

or push your k6 metrics to influxdb

It’s not a correct solution, your code runs tests locally instead of Cloud.

Yes but That was just to show you the principle of how you can possibly save the test results

:robot: Running test: k6 cloud /root/github-action-runner-work/GrafanaCloud-k6/GrafanaCloud-k6/bilka-basket/PREPROD/VUS-100.js