Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grafana/xk6-notification
A k6 extension for creating notifications.
https://github.com/grafana/xk6-notification
k6 k6-extension shoutrrr xk6
Last synced: 2 months ago
JSON representation
A k6 extension for creating notifications.
- Host: GitHub
- URL: https://github.com/grafana/xk6-notification
- Owner: grafana
- License: apache-2.0
- Created: 2020-11-18T22:55:49.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-10T08:30:02.000Z (6 months ago)
- Last Synced: 2024-09-28T15:01:32.123Z (3 months ago)
- Topics: k6, k6-extension, shoutrrr, xk6
- Language: Makefile
- Homepage:
- Size: 22.4 MB
- Stars: 18
- Watchers: 115
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-k6 - xk6-notification - Create notifications. (Extensions / Official)
- awesome-k6 - xk6-notification - Create notifications. (Extensions / Official)
README
## xk6-notification
This is a [k6](https://go.k6.io/k6) extension using the [xk6](https://github.com/grafana/xk6) system.
> #### :exclamation: This is a proof of concept
>
> As such, it isn't supported by the k6 team, and may break in the future. USE AT YOUR OWN RISK!## Build
To build a `k6` binary with this extension, first ensure you have the prerequisites:
- [Go toolchain](https://go101.org/article/go-toolchain.html)
- GitThen:
1. Install `xk6`:
```shell
$ go install go.k6.io/xk6/cmd/xk6@latest
```2. Build the binary:
```shell
$ xk6 build --with github.com/grafana/xk6-notification@latest
```## Usage
```javascript
import http from 'k6/http';
import notification from 'k6/x/notification';const url = 'slack://token:token@channel/';
export function setup() {
notification.send(url, 'Starting test');
}export default function () {
http.get('http://test.k6.io');
}export function teardown(data) {
notification.send(url, 'Finishing test');
}
```Token example ([more information](https://containrrr.dev/shoutrrr/latest/guides/slack/)): `slack://xoxb:123456789012-1234567890123-4mt0t4l1YL3g1T5L4cK70k3N@C001CH4NN3L`
## Documentation
For a full documentation of the api and how to use it, see the [official shoutrrr documentation](https://containrrr.dev/shoutrrr).