{"record":{"id":"23d262e04e8c7c15","repo":"grafana/k6","slug":"max-allowed-number-of-time-series-in-a-single-batc-23d262","errorCode":null,"errorMessage":"max allowed number of time series in a single batch must be a positive number but is %d","messagePattern":"max allowed number of time series in a single batch must be a positive number but is (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/cloud/output.go","lineNumber":187,"sourceCode":"\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,\n\t\ttestRunID:     params.RuntimeOptions.Env[testRunIDKey],\n\t}, nil\n}\n\n// validateRequiredSystemTags checks if all required tags are present.","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/output/cloud/output.go#L169-L205","documentation":"The cloud output's maxTimeSeriesInBatch setting (K6_CLOUD_MAX_TIME_SERIES_IN_BATCH or options.cloud) is below 1. newOutput validates this batching limit because at least one time series per batch is required for metric shipping.","triggerScenarios":"Thrown at internal/output/cloud/output.go:187 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set maxTimeSeriesInBatch to a positive integer","Remove the setting to fall back to the default batch size"],"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"}