{"record":{"id":"cf1a6348384f2aa6","repo":"grafana/k6","slug":"couldn-t-parse-argument-q-as-option","errorCode":null,"errorMessage":"couldn't parse argument %q as option","messagePattern":"couldn't parse argument %q as option","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/prometheusrw/remotewrite/config.go","lineNumber":337,"sourceCode":"\treturn c, nil\n}\n\n// parseJSON parses the supplied JSON into a Config.\nfunc parseJSON(data json.RawMessage) (Config, error) {\n\tvar c Config\n\terr := json.Unmarshal(data, &c)\n\treturn c, err\n}\n\n// parseArg parses the supplied string of arguments into a Config.\nfunc parseArg(text string) (Config, error) {\n\tvar c Config\n\topts := strings.SplitSeq(text, \",\")\n\n\tfor opt := range opts {\n\t\tr := strings.SplitN(opt, \"=\", 2)\n\t\tif len(r) != 2 {\n\t\t\treturn c, fmt.Errorf(\"couldn't parse argument %q as option\", opt)\n\t\t}\n\t\tkey, v := r[0], r[1]\n\t\tswitch key {\n\t\tcase \"url\":\n\t\t\tc.ServerURL = null.StringFrom(v)\n\t\tcase \"insecureSkipTLSVerify\":\n\t\t\tif err := c.InsecureSkipTLSVerify.UnmarshalText([]byte(v)); err != nil {\n\t\t\t\treturn c, fmt.Errorf(\"insecureSkipTLSVerify value must be true or false, not %q\", v)\n\t\t\t}\n\t\tcase \"tlsMinVersion\":\n\t\t\tc.TLSMinVersion = null.StringFrom(v)\n\t\tcase \"username\":\n\t\t\tc.Username = null.StringFrom(v)\n\t\tcase \"password\":\n\t\t\tc.Password = null.StringFrom(v)\n\t\tcase \"pushInterval\":\n\t\t\tif err := c.PushInterval.UnmarshalText([]byte(v)); err != nil {\n\t\t\t\treturn c, err","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/output/prometheusrw/remotewrite/config.go#L319-L355","documentation":"parseArg splits the Prometheus remote-write config string on commas and requires each option to be key=value (SplitN with 2 parts). This fires when an option fragment lacks '=' (or is empty), meaning the user's remote-write output configuration string is malformed and k6 cannot start the output.","triggerScenarios":"Thrown at internal/output/prometheusrw/remotewrite/config.go:337 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add '=' and a value to each option, e.g. --out prometheus-rw=url=http://prometheus:9090/api/v1/write,insecureSkipTLSVerify=true","Remove stray comma-separated tokens that aren't options"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}