{"record":{"id":"8eda744e2192ef73","repo":"SigNoz/signoz","slug":"filterattributekey-is-required","errorCode":null,"errorMessage":"filterAttributeKey is required","messagePattern":"filterAttributeKey is required","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/model/v3/v3.go","lineNumber":324,"sourceCode":"type FilterAttributeValueRequest struct {\n\tStartTimeMillis            int64                `json:\"startTimeMillis\"`\n\tEndTimeMillis              int64                `json:\"endTimeMillis\"`\n\tDataSource                 DataSource           `json:\"dataSource\"`\n\tAggregateOperator          AggregateOperator    `json:\"aggregateOperator\"`\n\tAggregateAttribute         string               `json:\"aggregateAttribute\"`\n\tFilterAttributeKey         string               `json:\"filterAttributeKey\"`\n\tFilterAttributeKeyDataType AttributeKeyDataType `json:\"filterAttributeKeyDataType\"`\n\tTagType                    TagType              `json:\"tagType\"`\n\tSearchText                 string               `json:\"searchText\"`\n\tLimit                      int                  `json:\"limit\"`\n\tExistingFilterItems        []FilterItem         `json:\"existingFilterItems\"`\n\tMetricNames                []string             `json:\"metricNames\"`\n\tIncludeRelated             bool                 `json:\"includeRelated\"`\n}\n\nfunc (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","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/model/v3/v3.go#L306-L342","documentation":"FilterAttributeValueRequest.Validate() requires FilterAttributeKey to be non-empty. This request fetches possible values for one attribute, so the attribute key is the mandatory anchor of the lookup.","triggerScenarios":"Calling POST /api/v3/auto_complete/attribute_value (filterAttributeValue) with a JSON body missing the filterAttributeKey field, or with it set to \"\" — often when the user hasn't yet selected an attribute in the UI filter builder.","commonSituations":"Filter UI submitting before the user picks an attribute key, programmatic clients copying the request shape from another endpoint (e.g. aggregate attributes, where the key is optional) and dropping the field, or JSON field-name typos like filterAttributekey.","solutions":["Include the exact field filterAttributeKey with the attribute you want values for (e.g. \"http.method\")","Guard the UI/caller so the request is only fired after an attribute key is selected","Verify JSON casing matches the struct tags exactly (filterAttributeKey)"],"exampleFix":"// before\n{\"startTimeMillis\":1700000000000,\"endTimeMillis\":1700003600000,\"dataSource\":\"traces\"}\n\n// after\n{\"filterAttributeKey\":\"http.method\",\"startTimeMillis\":1700000000000,\"endTimeMillis\":1700003600000,\"dataSource\":\"traces\"}","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(req.FilterAttributeKey) == \"\" { return errors.New(\"select an attribute key before fetching values\") }","typeGuard":"func hasFilterAttributeKey(r *v3.FilterAttributeValueRequest) bool { return r != nil && r.FilterAttributeKey != \"\" }","tryCatchPattern":null,"preventionTips":["Only fire the values request after a key is selected","Unit-test request builders for required fields"],"tags":["go","validation","missing-field","autocomplete","signoz"],"backgroundTag":"missing-required-field","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}