Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/javaducky/xk6-output-error
A k6 extension for add more information into StdErr
https://github.com/javaducky/xk6-output-error
Last synced: 10 days ago
JSON representation
A k6 extension for add more information into StdErr
- Host: GitHub
- URL: https://github.com/javaducky/xk6-output-error
- Owner: javaducky
- License: apache-2.0
- Created: 2022-05-05T16:32:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-05T16:46:11.000Z (over 2 years ago)
- Last Synced: 2024-11-06T00:30:49.472Z (about 2 months ago)
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# xk6-output-error
This is a [k6](https://go.k6.io/k6) extension using the [xk6](https://github.com/grafana/xk6) system.
`xk6-output-error` is a k6 extension to add more information into StdErr k6. Moreover, you can send logs with errors in your Elasticsearch or other log storage system used for this vector.dev, filebeat, etc.## Contents
* [Build](#build)
* [Usage](#usage)## 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](https://github.com/grafana/xk6) `xk6`:
```shell
go install go.k6.io/xk6/cmd/xk6@latest
```2. Build the binary:
```shell
CGO_ENABLED=1
xk6 build --with github.com/tinkoff/xk6-output-error@latest
```If you use Windows:
```shell
set CGO_ENABLED=1
xk6 build master --with github.com/tinkoff/xk6-output-error
```## Usage
You can use default params:
```shell
k6 run -o xk6-output-error example.js
```Also, you can add special fields for output:
```shell
k6 run -o xk6-output-error=fields="proto,tls_version" example.js
```Or set an environment variable:
```shell
export K6_OUTPUTERROR_FIELDS="proto,tls_version"
k6 run -o xk6-output-error example.js
```Moreover, you can set output into a file:
```shell
k6 run -o xk6-output-error=fields="proto,tls_version" example.js 2>error.log
```