SigNoz/signoz · error

step param missing in query

Error message

step param missing in query

What it means

The usage endpoint parser requires a step query parameter expressed in seconds. If the step parameter is absent or empty, the request is rejected before usage aggregation runs.

Source

Thrown at pkg/query-service/app/parser.go:192

		Stats: r.FormValue("stats"),
	}

	return &queryRangeParams, nil
}

func parseGetUsageRequest(r *http.Request) (*model.GetUsageParams, error) {
	startTime, err := parseTime("start", r)
	if err != nil {
		return nil, err
	}
	endTime, err := parseTime("end", r)
	if err != nil {
		return nil, err
	}

	stepStr := r.URL.Query().Get("step")
	if len(stepStr) == 0 {
		return nil, errors.New("step param missing in query")
	}
	stepInt, err := strconv.Atoi(stepStr)
	if err != nil {
		return nil, errors.New("step param is not in correct format")
	}

	serviceName := r.URL.Query().Get("service")
	stepHour := stepInt / 3600

	getUsageParams := model.GetUsageParams{
		StartTime:   startTime.Format(time.RFC3339Nano),
		EndTime:     endTime.Format(time.RFC3339Nano),
		Start:       startTime,
		End:         endTime,
		ServiceName: serviceName,
		Period:      fmt.Sprintf("PT%dH", stepHour),
		StepHour:    stepHour,
	}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Add step in seconds, e.g. ?step=3600 (hourly) or ?step=86400 (daily)
  2. Audit client code that conditionally appends query params and ensure step is always set
  3. Check the final constructed URL in logs to confirm the parameter is present

Example fix

// before
req := "/api/v1/usage?service=frontend"
// after
req := "/api/v1/usage?service=frontend&step=3600"
Defensive patterns

Strategy: validation

Validate before calling

if step == 0 {
    step = 3600
}
q := url.Values{}
q.Set("step", strconv.Itoa(step))
resp, err := http.Get(baseURL + "/api/v1/usage?" + q.Encode())

Prevention

When it happens

Trigger: GET to the usage API without ?step=... (e.g. /api/v1/usage?step=86400 missing the parameter entirely), or step= with an empty value.

Common situations: Clients copying example URLs that omit step; conditional parameter building in code that skips step for 'all time' usage; URL-encoding bugs stripping empty params.

Related errors


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