## Thumbnail ## Title 1. Prometheus Remote Write for k6 load testing 2. Visualize load testing results in Grafana using k6's Prometheus Remote Write integration ## What value do viewers get? They learn: - the three different ways that they can get k6 load testing results out via Prometheus Remote Write - how to set up each way - which way they should choose ## Hook > k6 load testing results in Prometheus? If you're already using Prometheus to collect metrics from your application servers, why not send your load testing results to the same place? I'm going to show you three ways that you can see your load testing results in the same dashboards where the rest of your metrics are, whether that's Grafana or another Prometheus-enabled tool. ## Structure - There are three options for writing load testing metrics to Prometheus: - k6 Cloud UI - k6 Cloud script - k6 OSS output - All three ways require the connection details for your Prometheus instance: - Prometheus Remote Write URL - username - password - k6 Cloud UI - Configure in settings - Configure per test - k6 Cloud script - Include details in your script - k6 OSS output - Currently, the Prometheus Remote Write output is an extension to k6. We may add this to the core k6 binary later, but for now, we want to give people the option to include or exclude this feature. - Disclaimer: This extension is still in progress. - What is xk6? - Install or download xk6. - Clone the extension repository, which is called `xk6-output-prometheus-remote`. - Do a custom build of k6 that includes the extension: `./xk6 build --with github.com/grafana/xk6-output-prometheus-remote` - Run k6 with those credentials: ``` K6_PROMETHEUS_REMOTE_URL=https://prometheus-prod-10-prod-us-central-0.grafana.net/api/prom/push K6_PROMETHEUS_INSECURE_SKIP_TLS_VERIFY=false K6_PROMETHEUS_USER=202981 K6_PROMETHEUS_PASSWORD="eyJrIjoiOWUzNjg0ZDVjMzYwNGViYThkMGFhZTEwOGMxZDRlZjg5NGFlY2IyZCIsIm4iOiJQcm9tZXRoZXVzIFJlbW90ZSBXcml0ZSBPdXRwdXQiLCJpZCI6NTQxMjc3fQ==" ./k6 run simple.js -o output-prometheus-remote ``` - View in your Prometheus-enabled visualization or observability tool. Here it is on Grafana Cloud. - Which one should you use? - If you're using k6 Cloud, UI, and you can switch to the script version and copy that out. That way, you or your team can use either option in the future. - If you're using k6 OSS, you can use the output extension. - If you like the idea of having k6 results in Grafana, but you want something simpler to set up, check out our video on the k6 Cloud Grafana data source plugin. Or watch my webinar on Grafana integrations for k6. I'm Nicole van der Hoeven. Thanks for watching. ## Related videos and resources - xk6-output-prometheus-remote: https://github.com/grafana/xk6-output-prometheus-remote ## Pre-production - [ ] Take a thumbnail photo and create one for YouTube (1280 x 720). - [ ] Add description. - [ ] Include the title and any keywords in the first few sentences, but in a natural way. - [ ] Add related videos and resources as links. - [ ] Add end screen. - [ ] Add cards if necessary. - [ ] Add video to relevant playlist(s), or create a playlist if necessary. - [ ] Create captions using Descript or using the script, then edit them. - [ ] (For k6 videos) Send Floor thumbnail and video link for promotion. - [ ] Add chapters for YouTube if longer than 5 minutes. - [ ] Schedule on YouTube. ## Post-production - [ ] Promote on personal social media. - [ ] Twitter - [ ] LinkedIn - [ ] Create a blog post on [nicolevdh.com](http://nicolevdh.com) - [ ] Include in a weekly newsletter.