{"record":{"id":"a8313fcf0fc9b799","repo":"grafana/k6","slug":"q-is-an-unknown-option-s-key","errorCode":null,"errorMessage":"%q is an unknown option's key","messagePattern":"%q is an unknown option's key","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/prometheusrw/remotewrite/config.go","lineNumber":379,"sourceCode":"\n\t\t// TODO: add the support for trendStats\n\t\t// strvals doesn't support the same format used by --summary-trend-stats\n\t\t// using the comma as the separator, because it is already used for\n\t\t// dividing the keys.\n\t\t//nolint:gocritic\n\t\t//\n\t\t//if v, ok := params[\"trendStats\"].(string); ok && len(v) > 0 {\n\t\t//c.TrendStats = strings.Split(v, \",\")\n\t\t//}\n\n\t\tcase \"clientCertificate\":\n\t\t\tc.ClientCertificate = null.StringFrom(v)\n\t\tcase \"clientCertificateKey\":\n\t\t\tc.ClientCertificateKey = null.StringFrom(v)\n\n\t\tdefault:\n\t\t\tif !strings.HasPrefix(key, \"headers.\") {\n\t\t\t\treturn c, fmt.Errorf(\"%q is an unknown option's key\", r[0])\n\t\t\t}\n\t\t\tif c.Headers == nil {\n\t\t\t\tc.Headers = make(map[string]string)\n\t\t\t}\n\t\t\tc.Headers[strings.TrimPrefix(key, \"headers.\")] = v\n\t\t}\n\t}\n\n\treturn c, nil\n}\n\nfunc isSigV4PartiallyConfigured(region, accessKey, secretKey null.String) bool {\n\thasRegion := region.Valid && len(strings.TrimSpace(region.String)) != 0\n\thasAccessID := accessKey.Valid && len(strings.TrimSpace(accessKey.String)) != 0\n\thasSecretAccessKey := secretKey.Valid && len(strings.TrimSpace(secretKey.String)) != 0\n\t// either they are all set, or all not set. False if partial\n\tisComplete := (hasRegion && hasAccessID && hasSecretAccessKey) || (!hasRegion && !hasAccessID && !hasSecretAccessKey)\n\treturn !isComplete","sourceCodeStart":361,"sourceCodeEnd":397,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/output/prometheusrw/remotewrite/config.go#L361-L397","documentation":"parseArg hit its default case: the comma-separated prometheus-rw output argument contains a key that is neither a known option nor a headers.* prefixed custom header. The unknown key is named in the error.","triggerScenarios":"Thrown at internal/output/prometheusrw/remotewrite/config.go:379 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the misspelled option key or remove it","Use headers.<name>=<value> syntax for custom headers"],"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-14T05:17:10.506Z"}