Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/k6/next/using-k6/protocols.md, or by sending Accept: text/markdown to https://grafana.com/docs/k6/next/using-k6/protocols/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
Protocols
Out of the box, k6 supports the following protocols:
- HTTP/1.1
- HTTP/2
- WebSockets
- gRPC
You can use k6 on more protocols with xk6.
Upgrade to HTTP/2 is automatic
By default, k6 uses HTTP/1.1 when it contacts a server. If the server reports to k6 that it supports HTTP/2, k6 upgrades the connection to HTTP/2 instead.
This is all automatic: you don’t need to do anything special for either the initial use of HTTP/1.1 or the potential protocol upgrade. However, you might want to verify which protocol is actually being used for a transaction. This verification requires an extra step.
Using WebSockets is a bit different, for both the test structure and the VU lifecycle.
Extend protocol support with xk6
xk6 is a separate CLI tool that lets you build custom k6 binaries. Community contributors have already added support for additional protocols, with extensions for SQL, Kafka, ZeroMQ, Redis, and more. Refer to the full list of extensions and find the ones you want to build. Then follow the xk6 guide.
You can build your own extension, too. See the tutorials to get started.
Was this page helpful?
Related resources from Grafana Labs

