{"record":{"id":"5cb0212d0f23bd5a","repo":"grafana/k6","slug":"the-cloud-output-needs-the-following-system-tags-e","errorCode":null,"errorMessage":"the cloud output needs the following system tags enabled: %s","messagePattern":"the cloud output needs the following system tags enabled: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cmd/outputs_cloud.go","lineNumber":300,"sourceCode":"\treturn nil\n}\n\n// validateRequiredSystemTags checks if all required tags are present.\nfunc validateRequiredSystemTags(scriptTags *metrics.SystemTagSet) error {\n\tvar missingRequiredTags []string\n\trequiredTags := metrics.SystemTagSet(metrics.TagName |\n\t\tmetrics.TagMethod |\n\t\tmetrics.TagStatus |\n\t\tmetrics.TagError |\n\t\tmetrics.TagCheck |\n\t\tmetrics.TagGroup)\n\tfor _, tag := range metrics.SystemTagValues() {\n\t\tif requiredTags.Has(tag) && !scriptTags.Has(tag) {\n\t\t\tmissingRequiredTags = append(missingRequiredTags, tag.String())\n\t\t}\n\t}\n\tif len(missingRequiredTags) > 0 {\n\t\treturn fmt.Errorf(\n\t\t\t\"the cloud output needs the following system tags enabled: %s\",\n\t\t\tstrings.Join(missingRequiredTags, \", \"),\n\t\t)\n\t}\n\treturn nil\n}\n\nfunc cloudConfToRawMessage(conf cloudapi.Config) (json.RawMessage, error) {\n\tvar buff bytes.Buffer\n\tenc := json.NewEncoder(&buff)\n\tif err := enc.Encode(conf); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buff.Bytes(), nil\n}\n\n// resolveCloudTestName returns the test name from the config, or derives it from\n// the script path when the config name is unset. A name of \"-\" is replaced","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/cmd/outputs_cloud.go#L282-L318","documentation":"Thrown while wiring up the cloud output (k6 cloud, k6 cloud run, or --out cloud): the cloud service requires the system tags name(proto), method, status, error, check and group on every sample, and the run was configured with a restricted systemTags set that omits at least one of them. The error lists exactly which required tags are missing. k6 aborts startup because cloud aggregation would otherwise be incomplete.","triggerScenarios":"Running with a cloud output while --system-tags, K6_SYSTEM_TAGS, or options.systemTags in the script does not include all of: proto/name, method, status, error, check, group. Example: `k6 run --out cloud --system-tags 'proto,status' script.js` fails listing error, check, group (and name/method if omitted).","commonSituations":"Copy-pasted options blocks that slim systemTags to cut storage costs; shared CI configs tuned for local JSON output then reused with --out cloud; scripts written before the cloud output enforced required tags.","solutions":["Re-enable the tags named in the error: --system-tags 'check,error,group,method,name,proto,status' (plus any others you want)","Remove the --system-tags flag / systemTags option entirely so k6 uses its default set, which already includes all required tags","If the restriction comes from the script, edit `export const options = { systemTags: [...] }` to include the required tags","If cloud results are not needed, drop --out cloud and run locally instead"],"exampleFix":"// before\nk6 run --out cloud --system-tags 'proto,status' script.js\n\n// after\nk6 run --out cloud --system-tags 'check,error,group,method,name,proto,status' script.js\n// or simply omit --system-tags (defaults include all required tags)","handlingStrategy":"validation","validationCode":"# before invoking k6 with a cloud output, verify the system-tags flag is a superset of the required tags\nreq=\"check error group method name proto status\"\nfor t in $req; do\n  case \" $K6_SYSTEM_TAGS $EXTRA_SYSTEM_TAGS \" in\n    *\" $t \"*) ;;\n    *) echo \"missing required system tag: $t\"; exit 1;;\n  esac\ndone\nk6 run --out cloud script.js","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never restrict systemTags in scripts you plan to send to the cloud; keep one options block for local-only runs and one for cloud runs","Default to omitting systemTags — the k6 default set already satisfies the cloud output","Add a CI lint that greps exported options for systemTags when the job uses --out cloud"],"tags":["k6","cloud-output","system-tags","metrics","config"],"backgroundTag":"invalid-config-value","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"}