{"record":{"id":"891a65012d4c50d0","repo":"grafana/k6","slug":"the-kafka-output-was-deprecated-in-k6-v0-32-0-and","errorCode":null,"errorMessage":"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","messagePattern":"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","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/outputs.go","lineNumber":53,"sourceCode":"\tbuiltinOutputInfluxdb\n\tbuiltinOutputJSON\n\tbuiltinOutputKafka\n\tbuiltinOutputStatsd\n\tbuiltinOutputExperimentalOpentelemetry\n\tbuiltinOutputOpentelemetry\n\tbuiltinOutputSummary\n)\n\n// TODO: move this to an output sub-module after we get rid of the old collectors?\nfunc getAllOutputConstructors() (map[string]output.Constructor, error) {\n\t// Start with the built-in outputs\n\tresult := map[string]output.Constructor{\n\t\tbuiltinOutputJSON.String():     json.New,\n\t\tbuiltinOutputCloud.String():    cloud.New,\n\t\tbuiltinOutputCSV.String():      csv.New,\n\t\tbuiltinOutputInfluxdb.String(): influxdb.New,\n\t\tbuiltinOutputKafka.String(): func(_ output.Params) (output.Output, error) {\n\t\t\treturn nil, errors.New(\"the kafka output was deprecated in k6 v0.32.0 and removed in k6 v0.34.0, \" +\n\t\t\t\t\"please use the new xk6 kafka output extension instead - https://github.com/k6io/xk6-output-kafka\")\n\t\t},\n\t\tbuiltinOutputStatsd.String(): func(_ output.Params) (output.Output, error) {\n\t\t\treturn nil, errors.New(\"the statsd output was deprecated in k6 v0.47.0 and removed in k6 v0.55.0, \" +\n\t\t\t\t\"please use the new xk6 statsd output extension instead. \" +\n\t\t\t\t\"It can be found at https://github.com/LeonAdato/xk6-output-statsd and \" +\n\t\t\t\t\"more info at https://github.com/grafana/k6/issues/2982\")\n\t\t},\n\t\tbuiltinOutputDatadog.String(): func(_ output.Params) (output.Output, error) {\n\t\t\treturn nil, errors.New(\"the datadog output was deprecated in k6 v0.32.0 and removed in k6 v0.34.0, \" +\n\t\t\t\t\"please use the statsd output extension https://github.com/LeonAdato/xk6-output-statsd with environment \" +\n\t\t\t\t\"variable K6_STATSD_ENABLE_TAGS=true or an experimental opentelemetry output instead\",\n\t\t\t)\n\t\t},\n\t\tbuiltinOutputExperimentalPrometheusRW.String(): func(params output.Params) (output.Output, error) {\n\t\t\treturn remotewrite.New(params)\n\t\t},\n\t\t\"web-dashboard\": dashboard.New,","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cmd/outputs.go#L35-L71","documentation":"k6 removed its built-in Kafka output. In getAllOutputConstructors (internal/cmd/outputs.go:53) the 'kafka' entry is a constructor stub that unconditionally returns this error, so any attempt to enable the output fails at setup time. The message points to the replacement: the xk6-output-kafka extension, deprecated since k6 v0.32.0 and removed in v0.34.0.","triggerScenarios":"Running k6 with `--out kafka` (with or without `kafka=...` config) or `K6_OUT=kafka` on any k6 binary >= v0.34.0; also `k6 archive`/`k6 cloud` invocations that request the kafka output via CLI flags or env.","commonSituations":"CI pipelines, Makefiles, or wrapper scripts written for k6 <= v0.33.x still passing `--out kafka=brokers=...`; docs or blog examples copied from old versions; upgrading k6 without migrating output configuration.","solutions":["Remove `--out kafka` / `K6_OUT=kafka` from the command line, environment, or config files.","Build k6 with the extension: `xk6 build --with github.com/k6io/xk6-output-kafka`, then run `./k6 run --out kafka script.js` using that binary.","Alternatively use a still-supported output (`--out json`, `--out csv`, `--out experimental-prometheus-rw`) and ship metrics to Kafka from there."],"exampleFix":"# before\nk6 run --out kafka=brokers=kafka:9092,topic=k6 script.js\n# after\nxk6 build --with github.com/k6io/xk6-output-kafka\n./k6 run --out kafka script.js","handlingStrategy":"validation","validationCode":"# fail fast before upgrading k6: find removed output usages\nif grep -rnE -- '--out kafka|K6_OUT=kafka|K6_KAFKA_' ci/ scripts/ Makefile 2>/dev/null; then\n  echo 'kafka output removed in k6 v0.34.0 - migrate to xk6-output-kafka first'\n  exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin and diff k6 version in CI; run the release notes checklist for removed outputs before bumping.","Centralize output configuration in one variable (e.g. $K6_OUT) so removed outputs are caught by a single grep.","Prefer building extension binaries via a committed xk6 build command rather than ad-hoc --out flags."],"tags":["kafka","output","deprecation","removed-feature","xk6","cli"],"backgroundTag":"deprecated-output-removed","analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}