diff --git a/release notes/v0.48.0.md b/release notes/v0.48.0.md index e11171e6eea..7b33eae4d0d 100644 --- a/release notes/v0.48.0.md +++ b/release notes/v0.48.0.md @@ -158,6 +158,28 @@ const redisClient = new redis.Client({ ``` +### Add tracing instrumentation [#3445](https://github.com/grafana/k6/pull/3445) + +`k6` now supports a new *traces output* option that allows to configure the output for traces generated during its execution. This option can be set through the `--traces-output` argument in `k6 run` command or by setting the `K6_TRACES_OUTPUT` environment variable. + +By default traces output is set to `none`, and currently the only supported output is `otel` which uses the [opentelemetry-go](https://github.com/open-telemetry/opentelemetry-go)'s [Open Telemetry](https://opentelemetry.io/) API and SDK implementations. The format for the `otel` *traces output* configuration is the following: + +``` +--traces-output=[,opt1=val1,opt2=val2] +``` +Where `opt`s can be one of the following options: +* `proto`: Specifies the protocol to use in the connection to the traces backend. Supports `grpc` *(default)* and `http`. +* `header.`: Specifies an additional header to include in the connection to the traces backend. + +Example: +``` +K6_TRACES_OUTPUT=https://traces.k6.io/v1/traces,proto=http,header.Authorization=Bearer token +``` + +This configuration will set up an underlying [*Tracer Provider*](https://github.com/grafana/k6/blob/e603a494f48bc9b106ffbcbdc6f7320c4563946a/lib/vu_state.go#L85-L86) which is exposed to extensions through the [VU interface](https://github.com/grafana/k6/blob/e603a494f48bc9b106ffbcbdc6f7320c4563946a/js/modules/modules.go#L41)'s [*State()*](https://github.com/grafana/k6/blob/e603a494f48bc9b106ffbcbdc6f7320c4563946a/js/modules/modules.go#L57) method. The *Tracer Provider* can be used to initialize [*Tracers*](https://pkg.go.dev/go.opentelemetry.io/otel/trace#Tracer) which are then used for the actual traces generation. + +Currently no traces are generated by `k6` itself, but this feature represents the first step towards richer tracing functionalities in `k6` and its extensions. + ### Add support for browser module's `page.throttleCPU` [browser#1095](https://github.com/grafana/xk6-browser/pull/1095) Allows users to throttle the CPU from chrome/chromium's perspective, which helps emulate slower devices when testing the website's frontend. The mandatory argument is of type `CPUProfile`, which is made up of one field named `rate` that is a slow down factor, where `1` means no throttling, and `2` means 2x slowdown, and so on. The documentation for this API can be found [here](https://grafana.com/docs/k6/v0.48.x/javascript-api/k6-experimental/browser/page/throttlecpu).