{"record":{"id":"caff9d605ec73c38","repo":"SigNoz/signoz","slug":"endtimemillis-is-required","errorCode":null,"errorMessage":"endTimeMillis is required","messagePattern":"endTimeMillis is required","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/model/v3/v3.go","lineNumber":332,"sourceCode":"\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\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","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/model/v3/v3.go#L314-L350","documentation":"FilterAttributeValueRequest.Validate() requires a non-zero EndTimeMillis, symmetric to the start-time check, because the value lookup scans a bounded time window.","triggerScenarios":"POSTing to the attribute_value autocomplete endpoint with endTimeMillis omitted or 0 while startTimeMillis is set — e.g. client computes the end timestamp incorrectly and it serializes as zero.","commonSituations":"UI using an open-ended \"now\"-less state, zero-value Go structs sent without populating end time, clock/timezone bugs producing 0 after formatting.","solutions":["Set endTimeMillis to a unix-epoch millisecond value, usually the current time (time.Now().UnixMilli())","Ensure endTimeMillis > startTimeMillis for a sane window","Match the exact JSON key endTimeMillis"],"exampleFix":"// before\n{\"filterAttributeKey\":\"http.method\",\"startTimeMillis\":1700000000000}\n\n// after\n{\"filterAttributeKey\":\"http.method\",\"startTimeMillis\":1700000000000,\"endTimeMillis\":1700003600000}","handlingStrategy":"validation","validationCode":"if req.EndTimeMillis <= 0 { return errors.New(\"endTimeMillis (unix ms) is required\") }\nif req.EndTimeMillis <= req.StartTimeMillis { return errors.New(\"end must be after start\") }","typeGuard":"func hasEndTime(r *v3.FilterAttributeValueRequest) bool { return r != nil && r.EndTimeMillis > 0 }","tryCatchPattern":null,"preventionTips":["Default end time to time.Now() when unset","Validate window ordering client-side"],"tags":["go","validation","missing-field","timestamp","signoz"],"backgroundTag":"missing-required-field","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}