{"record":{"id":"06e2961287a6833a","repo":"grafana/k6","slug":"metrics-push-concurrency-must-be-a-positive-number-06e296","errorCode":null,"errorMessage":"metrics push concurrency must be a positive number but is %d","messagePattern":"metrics push concurrency must be a positive number but is (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/cloud/output.go","lineNumber":182,"sourceCode":"\t\tscriptPath := params.ScriptPath.String()\n\t\tif scriptPath == \"\" {\n\t\t\t// Script from stdin without a name, likely from stdin\n\t\t\treturn nil, errors.New(\"script name not set, please specify K6_CLOUD_NAME or options.cloud.name\")\n\t\t}\n\n\t\tconf.Name = null.StringFrom(filepath.Base(scriptPath))\n\t}\n\tif conf.Name.String == \"-\" {\n\t\tconf.Name = null.StringFrom(defaultTestName)\n\t}\n\n\tduration, testEnds := lib.GetEndOffset(params.ExecutionPlan)\n\tif !testEnds {\n\t\treturn nil, errors.New(\"tests with unspecified duration are not allowed when outputting data to k6 cloud\")\n\t}\n\n\tif conf.MetricPushConcurrency.Int64 < 1 {\n\t\treturn nil, fmt.Errorf(\"metrics push concurrency must be a positive number but is %d\",\n\t\t\tconf.MetricPushConcurrency.Int64)\n\t}\n\n\tif conf.MaxTimeSeriesInBatch.Int64 < 1 {\n\t\treturn nil, fmt.Errorf(\"max allowed number of time series in a single batch must be a positive number but is %d\",\n\t\t\tconf.MaxTimeSeriesInBatch.Int64)\n\t}\n\n\tapiClient := cloudapi.NewClient(\n\t\tlogger, conf.Token.String, conf.Host.String, build.Version, conf.Timeout.TimeDuration())\n\n\treturn &Output{\n\t\tconfig:        conf,\n\t\tclient:        apiClient,\n\t\texecutionPlan: params.ExecutionPlan,\n\t\tduration:      int64(duration / time.Second),\n\t\tlogger:        logger,\n\t\tusage:         params.Usage,","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/output/cloud/output.go#L164-L200","documentation":"The cloud output was configured with K6_CLOUD_METRIC_PUSH_CONCURRENCY (or options.cloud metricPushConcurrency) below 1. newOutput validates that the number of concurrent metric-pushing goroutines is at least 1 and rejects zero/negative values.","triggerScenarios":"Thrown at internal/output/cloud/output.go:182 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set metricPushConcurrency to a positive integer, e.g. K6_CLOUD_METRIC_PUSH_CONCURRENCY=5","Omit the setting to use the default concurrency"],"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-14T00:17:10.932Z"}