{"record":{"id":"bde3128cc4fa13ae","repo":"SigNoz/signoz","slug":"limit-must-be-less-than-1000","errorCode":null,"errorMessage":"limit must be less than 1000","messagePattern":"limit must be less than 1000","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/model/v3/v3.go","lineNumber":340,"sourceCode":"func (f *FilterAttributeValueRequest) Validate() error {\n\tif f.FilterAttributeKey == \"\" {\n\t\treturn fmt.Errorf(\"filterAttributeKey is required\")\n\t}\n\n\tif f.StartTimeMillis == 0 {\n\t\treturn fmt.Errorf(\"startTimeMillis is required\")\n\t}\n\n\tif f.EndTimeMillis == 0 {\n\t\treturn fmt.Errorf(\"endTimeMillis is required\")\n\t}\n\n\tif f.Limit == 0 {\n\t\tf.Limit = 100\n\t}\n\n\tif f.Limit > 1000 {\n\t\treturn fmt.Errorf(\"limit must be less than 1000\")\n\t}\n\n\tif f.ExistingFilterItems != nil {\n\t\tfor _, value := range f.ExistingFilterItems {\n\t\t\tif value.Key.Key == \"\" {\n\t\t\t\treturn fmt.Errorf(\"existingFilterItems must contain a valid key\")\n\t\t\t}\n\t\t}\n\t}\n\n\tif err := f.DataSource.Validate(); err != nil {\n\t\treturn fmt.Errorf(\"invalid data source: %w\", err)\n\t}\n\n\tif f.DataSource != DataSourceMetrics {\n\t\tif err := f.AggregateOperator.Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid aggregate operator: %w\", err)\n\t\t}","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/model/v3/v3.go#L322-L358","documentation":"FilterAttributeValueRequest.Validate() rejects limit values over 1000 (and defaults limit to 100 when unset). This caps the number of distinct attribute values returned to protect ClickHouse from huge result sets.","triggerScenarios":"Calling the attribute_value autocomplete endpoint with limit: 5000 (or any value > 1000) in the JSON body — often from a client that wants 'all values' and guesses a big number.","commonSituations":"Copying a limit from another API without the cap, UI dropdown 'show all' features passing total row counts, or hardcoded large defaults.","solutions":["Set limit to 1000 or less (omit it entirely to get the default 100)","If you need more values, page through results by narrowing filters or time windows rather than raising limit","Cache common value lookups client-side instead of requesting large lists"],"exampleFix":"// before\n{\"filterAttributeKey\":\"http.url\",\"limit\":5000,...}\n\n// after\n{\"filterAttributeKey\":\"http.url\",\"limit\":1000,...}","handlingStrategy":"validation","validationCode":"if req.Limit > 1000 { req.Limit = 1000 }","typeGuard":"func limitWithinCap(l int64) bool { return l == 0 || (l > 0 && l <= 1000) }","tryCatchPattern":null,"preventionTips":["Clamp limit to 1000 before sending","Omit limit for the default 100"],"tags":["go","validation","limit","pagination","signoz"],"backgroundTag":"value-out-of-range","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}