https://github.com/lewiscowles1986/k6-influxdb
Just messing around getting k6, grafsana, influxdb setup
https://github.com/lewiscowles1986/k6-influxdb
Last synced: 3 months ago
JSON representation
Just messing around getting k6, grafsana, influxdb setup
- Host: GitHub
- URL: https://github.com/lewiscowles1986/k6-influxdb
- Owner: Lewiscowles1986
- Created: 2024-11-05T06:31:27.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-05T06:45:05.000Z (8 months ago)
- Last Synced: 2025-03-06T14:55:04.856Z (3 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# K6 to influxDB (2.0) with Grafana
This repo is me messing around with K6, influxDB and Grafana to attempt to automate some of the mundane setup, and document.
## Pre requisites
* A *nix system (Linux or OSX should do)
* Homebrew or relevant package manager, `dpkg`, `rpm`, `yum`, `apk`, `aur`, `pacman`, etc
* build-essential
* golang
* docker
* k6### Build required binary
### Golang setup
```shell
go_version=$(go version | cut -d ' ' -f 3 | sed 's/go//')
export GOPATH=$HOME/go
export GOROOT=/opt/homebrew/Cellar/go/${go_version}/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
```### Build k6
```shell
go install go.k6.io/xk6/cmd/xk6@latest
xk6 build --with github.com/grafana/xk6-output-influxdb
```## using
### starting docker
```shell
docker compose up -d
```### executing
```
K6_INFLUXDB_ORGANIZATION="my-org" \
K6_INFLUXDB_BUCKET="k6" \
K6_INFLUXDB_TOKEN="my-super-secret-auth-token" \
K6_INFLUXDB_ADDR="http://127.0.0.1:8086" \
K6_INFLUXDB_INSECURE=true ./k6 run script.js --out "xk6-influxdb"
```### Cleaning up
```shell
docker compose down --remove-orphans
rm -rf data/grafana
git checkout main data
docker volume prune -f
```