grafana/k6 · error

the datadog output was deprecated in k6 v0.32.0 and removed…

Error message

the datadog output was deprecated in k6 v0.32.0 and removed in k6 v0.34.0, please use the statsd output extension https://github.com/LeonAdato/xk6-output-statsd with environment variable K6_STATSD_ENABLE_TAGS=true or an experimental opentelemetry output instead

What it means

k6 removed the built-in Datadog output; the constructor stub in getAllOutputConstructors (internal/cmd/outputs.go:63) always fails. It was deprecated in v0.32.0 and removed in v0.34.0. The error message names two replacements: the xk6 statsd extension in DogStatsD mode, or k6's OpenTelemetry output pointed at a Datadog OTLP endpoint.

Solutions

  1. Remove `--out datadog` / `K6_OUT=datadog` and the `K6_DATADOG_*` variables.
  2. Build k6 with the statsd extension and enable tags: `xk6 build --with github.com/LeonAdato/xk6-output-statsd`, run with `--out statsd` and `K6_STATSD_ENABLE_TAGS=true`, pointing at a DogStatsD endpoint.
  3. Or use `--out experimental-opentelemetry` with the OTLP exporter configured for Datadog intake.

Example fix

# before
k6 run --out datadog script.js
# after (statsd extension in DogStatsD mode)
xk6 build --with github.com/LeonAdato/xk6-output-statsd
K6_STATSD_ENABLE_TAGS=true ./k6 run --out statsd script.js
Defensive patterns

Strategy: validation

Validate before calling

# guard CI before upgrading k6 past v0.34.0
if grep -rnE -- '--out datadog|K6_OUT=datadog|K6_DATADOG_' ci/ scripts/ 2>/dev/null; then
  echo 'datadog output removed - migrate to xk6 statsd extension (K6_STATSD_ENABLE_TAGS=true) or OTLP'
  exit 1
fi

Prevention

When it happens

Trigger: Running k6 >= v0.34.0 with `--out datadog` or `K6_OUT=datadog`, including legacy `K6_DATADOG_*` env configuration that silently implies the output.

Common situations: Old monitoring setups shipping k6 metrics to Datadog via the native output being upgraded; copied `--out datadog` examples from pre-2021 docs.

Related errors


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/c79a2cc0762c495b. Report an issue: GitHub.

Appendix: source

Thrown at internal/cmd/outputs.go:63

func getAllOutputConstructors() (map[string]output.Constructor, error) {
	// Start with the built-in outputs
	result := map[string]output.Constructor{
		builtinOutputJSON.String():     json.New,
		builtinOutputCloud.String():    cloud.New,
		builtinOutputCSV.String():      csv.New,
		builtinOutputInfluxdb.String(): influxdb.New,
		builtinOutputKafka.String(): func(_ output.Params) (output.Output, error) {
			return nil, errors.New("the kafka output was deprecated in k6 v0.32.0 and removed in k6 v0.34.0, " +
				"please use the new xk6 kafka output extension instead - https://github.com/k6io/xk6-output-kafka")
		},
		builtinOutputStatsd.String(): func(_ output.Params) (output.Output, error) {
			return nil, errors.New("the statsd output was deprecated in k6 v0.47.0 and removed in k6 v0.55.0, " +
				"please use the new xk6 statsd output extension instead. " +
				"It can be found at https://github.com/LeonAdato/xk6-output-statsd and " +
				"more info at https://github.com/grafana/k6/issues/2982")
		},
		builtinOutputDatadog.String(): func(_ output.Params) (output.Output, error) {
			return nil, errors.New("the datadog output was deprecated in k6 v0.32.0 and removed in k6 v0.34.0, " +
				"please use the statsd output extension https://github.com/LeonAdato/xk6-output-statsd with environment " +
				"variable K6_STATSD_ENABLE_TAGS=true or an experimental opentelemetry output instead",
			)
		},
		builtinOutputExperimentalPrometheusRW.String(): func(params output.Params) (output.Output, error) {
			return remotewrite.New(params)
		},
		"web-dashboard": dashboard.New,
		builtinOutputExperimentalOpentelemetry.String(): func(params output.Params) (output.Output, error) {
			params.Logger.Warnf("OpenTelemetry output has been graduated as a stable output."+
				"You can now use just %q instead of %q. The experimental version will be removed in future versions.",

				"opentelemetry", "experimental-opentelemetry")
			return opentelemetry.New(params)
		},
		builtinOutputOpentelemetry.String(): func(params output.Params) (output.Output, error) {
			return opentelemetry.New(params)
		},

View on GitHub (pinned to 01ffac6f24)