Skip to content

Commit 079ffb9

Browse files
Edits to explore and extensions index pages
1 parent 1b0a2eb commit 079ffb9

File tree

2 files changed

+43
-19
lines changed

2 files changed

+43
-19
lines changed

docs/sources/k6/next/extensions/_index.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,32 @@ weight: 700
66

77
# Extensions
88

9-
<!-- TODO: Add content -->
9+
With k6 extensions, you can extend the core k6 functionality with new features to support your specific reliability-testing needs.
1010

11-
{{< section withDescriptions="true" >}}
11+
k6 supports three types of extensions:
12+
13+
- **JavaScript extensions** extend the JavaScript APIs available to your test scripts. Add support for new network protocols, improve performance compared to equivalent JS libraries, or add features.
14+
15+
- **Output extensions** send metrics to a custom file format or service. Add custom processing and dispatching.
16+
17+
- **Secret Source extensions** provide secrets to your tests.
18+
19+
## Use cases
20+
21+
The extensions ecosystem provides endless possibilities to expand the functionality for your k6 testing. Some reasons you might want to extend k6 include the following:
22+
23+
- **To add support for a new network protocol**
24+
25+
For example, [xk6-dns](https://github.com/grafana/xk6-dns) lets users resolve DNS names to IP addresses in k6 scripts. With xk6-dns, you can assert the performance of custom DNS servers under load, and provide a way to resolve DNS names to IP addresses using a specific DNS server.
26+
27+
- **To incorporate a client library for test dependency**
28+
29+
Everyone wants to run their services in Kubernetes these days. With [xk6-kubernetes](https://github.com/grafana/xk6-kubernetes), your JavaScript tests can interface directly with Kubernetes resources using functionality typically restricted to kubectl. Prepare isolated Namespaces for each test run, or inject environment variables as ConfigMaps.
30+
31+
- **To format and send metrics to the output of your choice**
32+
33+
Suppose your company has consolidated its observability metrics into Prometheus. Use [xk6-output-prometheus-remote](https://github.com/grafana/xk6-output-prometheus-remote) to publish your k6 test metrics to Prometheus as well!
34+
35+
- **To improve script performance and efficiency**
36+
37+
Perhaps your company uses OpenTelemetry to trace service requests through layers of microservices. Using [xk6-distributed-tracing](https://github.com/grafana/xk6-distributed-tracing), you can update the HTTP client to link your test requests as the origin for your traces—no need to add JavaScript code to supply the required trace headers.

docs/sources/k6/next/extensions/explore.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,16 @@ weight: 01
77

88
# Explore extensions
99

10-
## Supported by automatic extension resolution
11-
12-
These extensions can be used in your test without any additional configuration. They are automatically resolved and loaded by k6 when you [import them in your test script](https://grafana.com/docs/k6/<K6_VERSION>/extensions/run/#using-automatic-extension-loading).
13-
14-
We have two categories of extensions:
10+
Extensions can be used to extend the core k6 features to fit your performance-testing use cases. There are two main categories of extensions:
1511

1612
| Category | Maintainer | Audited | Cloud support |
1713
| ------------- | ------------ | ------- | ------------- |
1814
| **Official** | Grafana Labs | ✅ Yes | ✅ Yes |
1915
| **Community** | Community | ✅ Yes | ⚠️ Partial\* |
2016

21-
\* _Partial_ means that they can be used in the CLI with the `--local-execution` mode. Also, on Private Load Zones if a custom image is build. They don't work on Grafana Cloud k6 Public Load Zones.
17+
\* _Partial_ cloud support means that the extensions can be used in the CLI with the `--local-execution` mode, and on Private Load Zones with a custom image. They don't work on Grafana Cloud k6 Public Load Zones.
2218

23-
### Official extensions
19+
## Official extensions
2420

2521
| Extension | Description | Versions |
2622
| --------------------------------------------------------------------------------------- | ------------------------------------------------- | ---------------------------------------- |
@@ -32,11 +28,11 @@ We have two categories of extensions:
3228
| [xk6-sql-driver-postgres](https://github.com/grafana/xk6-sql-driver-postgres) | SQL driver for Postgres | 0.1.0, 0.1.1 |
3329
| [xk6-ssh](https://github.com/grafana/xk6-ssh) | Use SSH connections in your tests | 0.1.0, 0.1.1, 0.1.2, 0.1.3 |
3430

35-
### Community extensions
31+
## Community extensions
3632

3733
{{< admonition type="note" >}}
3834

39-
We are working on process for community folks to submit their extensions to be included here.
35+
We're working on a process for community folks to submit their extensions.
4036

4137
{{< /admonition >}}
4238

@@ -48,20 +44,22 @@ We are working on process for community folks to submit their extensions to be i
4844
| [xk6-sql-driver-sqlserver](https://github.com/grafana/xk6-sql-driver-sqlserver) | SQL driver for SQLite3 | 0.1.0, 0.1.1 |
4945
| [xk6-sse](https://github.com/phymbert/xk6-sse) | Test with Server-Sent Events (SSE) | 0.1.10, 0.1.11 |
5046

51-
## Require building a custom k6 binary
47+
## Use extensions
5248

53-
### Your own extensions
49+
There are two ways to use extensions when running a k6 test script.
5450

55-
If you have developed your own k6 extension or want to use an extension that's not available through automatic extension resolution, you'll need to build a custom k6 binary. This process involves using the xk6 tool to compile k6 with your desired extensions included. Custom binaries give you the flexibility to incorporate any extension from the k6 ecosystem.
51+
### Automatic extension resolution
5652

57-
Check out how to [build a custom k6 binary guide](https://grafana.com/docs/k6/<K6_VERSION>/extensions/run/#using-extensions-that-require-building-a-custom-k6-binary) to learn how to create your own k6 binary with custom extensions.
53+
These extensions can be used in your test without any additional configuration. They are automatically resolved and loaded by k6 when you [import them in your test script](https://grafana.com/docs/k6/<K6_VERSION>/extensions/run/#using-automatic-extension-loading).
5854

59-
### More ecosystem extensions
55+
### Custom k6 binary
56+
57+
If you have developed your own k6 extension or want to use an extension that's not available through automatic extension resolution, you have to build a custom k6 binary. The process involves using the xk6 tool to compile k6 with your desired extensions included. Custom binaries give you the flexibility to incorporate any extension from the k6 ecosystem.
58+
59+
Refer to [build a custom k6 binary guide](https://grafana.com/docs/k6/<K6_VERSION>/extensions/run/#use-extensions-with-a-custom-k6-binary) to learn how to create your own k6 binary with custom extensions.
6060

6161
{{< admonition type="caution" >}}
6262

63-
The extensions in this category are not maintained nor audited by Grafana Labs.
63+
Many other extensions maintained by members of the k6 ecosystem are available in [GitHub](https://github.com/topics/xk6). These extensions aren't maintained nor audited by Grafana Labs.
6464

6565
{{< /admonition >}}
66-
67-
Many other extensions, maintained by members of the k6 ecosystem are available in [GitHub](https://github.com/topics/xk6).

0 commit comments

Comments
 (0)