Skip to content
/ xk6-output-error Public archive

A k6 extension for add more information into StdErr

License

Notifications You must be signed in to change notification settings

Tinkoff/xk6-output-error

Repository files navigation

xk6-output-error

This is a k6 extension using the 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 (config vector), filebeat, etc.

Contents

Build

To build a k6 binary with this extension, first ensure you have the prerequisites:

Then:

  1. Install xk6:
go install go.k6.io/xk6/cmd/xk6@latest
  1. Build the binary:
CGO_ENABLED=1
xk6 build --with github.com/Tinkoff/xk6-output-error@latest

If you use Windows:

set CGO_ENABLED=1
xk6 build master --with github.com/Tinkoff/xk6-output-error

Usage

You can use default params:

k6 run -o xk6-output-error sample.js

Also, you can add special fields for output:

k6 run -o xk6-output-error=fields="proto,tls_version" sample.js

Or set an environment variable:

export K6_OUTPUTERROR_FIELDS="proto,tls_version"
k6 run -o xk6-output-error sample.js

Moreover, you can set output into a file:

k6 run -o xk6-output-error=fields="proto,tls_version" ./examples/sample.js 2>error.log