SigNoz/signoz · error

endTimeMillis is required

Error message

endTimeMillis is required

What it means

FilterAttributeValueRequest.Validate() requires a non-zero EndTimeMillis, symmetric to the start-time check, because the value lookup scans a bounded time window.

Source

Thrown at pkg/query-service/model/v3/v3.go:332

	TagType                    TagType              `json:"tagType"`
	SearchText                 string               `json:"searchText"`
	Limit                      int                  `json:"limit"`
	ExistingFilterItems        []FilterItem         `json:"existingFilterItems"`
	MetricNames                []string             `json:"metricNames"`
	IncludeRelated             bool                 `json:"includeRelated"`
}

func (f *FilterAttributeValueRequest) Validate() error {
	if f.FilterAttributeKey == "" {
		return fmt.Errorf("filterAttributeKey is required")
	}

	if f.StartTimeMillis == 0 {
		return fmt.Errorf("startTimeMillis is required")
	}

	if f.EndTimeMillis == 0 {
		return fmt.Errorf("endTimeMillis is required")
	}

	if f.Limit == 0 {
		f.Limit = 100
	}

	if f.Limit > 1000 {
		return fmt.Errorf("limit must be less than 1000")
	}

	if f.ExistingFilterItems != nil {
		for _, value := range f.ExistingFilterItems {
			if value.Key.Key == "" {
				return fmt.Errorf("existingFilterItems must contain a valid key")
			}
		}
	}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Set endTimeMillis to a unix-epoch millisecond value, usually the current time (time.Now().UnixMilli())
  2. Ensure endTimeMillis > startTimeMillis for a sane window
  3. Match the exact JSON key endTimeMillis

Example fix

// before
{"filterAttributeKey":"http.method","startTimeMillis":1700000000000}

// after
{"filterAttributeKey":"http.method","startTimeMillis":1700000000000,"endTimeMillis":1700003600000}
Defensive patterns

Strategy: validation

Validate before calling

if req.EndTimeMillis <= 0 { return errors.New("endTimeMillis (unix ms) is required") }
if req.EndTimeMillis <= req.StartTimeMillis { return errors.New("end must be after start") }

Type guard

func hasEndTime(r *v3.FilterAttributeValueRequest) bool { return r != nil && r.EndTimeMillis > 0 }

Prevention

When it happens

Trigger: 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.

Common situations: UI using an open-ended "now"-less state, zero-value Go structs sent without populating end time, clock/timezone bugs producing 0 after formatting.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/caff9d605ec73c38. Report an issue: GitHub.