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

POC dashboard in Grafana #65

Closed
wants to merge 3 commits into from
Closed

POC dashboard in Grafana #65

wants to merge 3 commits into from

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Sep 6, 2023

Hi folks 👋🏻

Per our recent discussion, I'm presenting a draft PR (intended for review, not for merging) that replicates the xk6-dashboard experience using Grafana.

I've added a /grafana directory at the project root. This directory houses a docker-compose file and the necessary Grafana and Prometheus configurations to simplify setup.

How-to

# Start the Prometheus and Grafana stack
cd grafana && docker-compose up --build -d && cd -

# Execute a k6 test and push results to Prometheus
K6_PROMETHEUS_RW_SERVER_URL=http://localhost:9090/api/v1/write K6_PROMETHEUS_RW_TREND_STATS="p(90),p(95),avg" k6 run script-hour.js -o experimental-prometheus-rw

Upon starting the docker-compose stack and initiating the k6 command, navigate to http://localhost:3000. You'll find a pre-configured xk6-dashboard Grafana dashboard:

Screenshot 2023-09-06 at 15 24 51

Caveats & Assistance Requested

While I've managed to closely replicate the xk6-dashboard experience, I faced certain challenges. If you possess insights or potential solutions, please consider contributing directly to this branch. Here are the main challenges:

The k6 dashboard conveniently sets its range based on the test start time. However, in Grafana, you'll need to set this manually. Record the test's start time and adjust the From time range accordingly, e.g., 2023-09-06 15:19:30. Set the To field to now.
Set a refresh rate of 10s to align with the xk6 dashboard.
I've struggled to reproduce the table found in the xk6 dashboard's summary screen. Grafana's tables are, frankly, quite perplexing. Any guidance or direct adjustments would be greatly appreciated.
This branch utilizes k6's Prometheus-remote-write feature. The provided command is configured to emit Trend metrics as specific Prometheus summaries (k6_avg, k6p90, and k6*_p95). This is handy for some graphs but complicates the accurate representation of others, particularly the HTTP request rate.

@oleiade oleiade added the help wanted Extra attention is needed label Sep 6, 2023
@szkiba
Copy link
Collaborator

szkiba commented Sep 6, 2023

Thank you @oleiade ! I'll play with it soon

@szkiba
Copy link
Collaborator

szkiba commented Feb 2, 2024

Hi @oleiade , I think this PR is outdated. Can I close it?

@oleiade
Copy link
Member Author

oleiade commented Feb 12, 2024

👍🏻

@oleiade oleiade closed this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants