Name the autocomplete Global Search SLI target

🤖 AI-authored change.

Names the autocomplete Global Search SLI target AUTOCOMPLETE_TARGET_S, and makes an un-derived target detectable. Still 5 seconds, so no SLI behaviour changes.

What does this MR do and why?

SearchController#autocomplete reports nil search type, level and scope, so it matched no branch of duration_target and took the 5s default by accident — indistinguishable from a chosen threshold, and an edit to DEFAULT_TARGET_S would have moved it silently.

Before After
An unclaimed combination fell through to DEFAULT_TARGET_S in the derivation derived_duration_target returns nil; only duration_target falls back
A scope added later would inherit the 5 unnoticed A spec fails if any registered combination derives no target

The target is deliberately not re-tightened here; the collapsed section below says why.

Reviewer focus: the EE semantic override moves to derived_duration_target. That keeps semantic inside the every-label guard but puts the autocomplete endpoint_id check ahead of it — correct today, since autocomplete never reports the semantic type.

References

  • Spec: specs/global-search-request-sli/SPEC.md (merged 7f927a31e3c5) — documents this fallthrough; its acceptance criterion 9 states the one-owner property the new spec asserts.
  • Related to #627960 — its Finding 1 measures autocomplete at 2.40% apdex failure against this 5s bar.
  • !254016 adds the histogram a re-derived target needs.

Screenshots or screen recordings

Not applicable — no UI change. The only observable field is target_s on the Global Search Apdex SLI log line, unchanged at 5.

How to set up and validate locally

  1. bundle exec rspec spec/lib/gitlab/metrics/global_search_slis_spec.rb ee/spec/lib/ee/gitlab/metrics/global_search_slis_spec.rb
  2. Delete the zoekt branch from derived_duration_target; the every-combination example fails.

MR acceptance checklist

Evaluated against the MR acceptance checklist.


🤖 Automated change — mention me to get a response. Feedback welcome. Ask to speak to John directly anytime.

Mechanism, citations and verification (for agents / deep readers)

Mechanism

Three files, at head dcab60cd:

  • lib/gitlab/metrics/global_search_slis.rb — adds AUTOCOMPLETE_TARGET_S and AUTOCOMPLETE_ENDPOINT_ID; duration_target returns the autocomplete target when endpoint_id matches, otherwise derived_duration_target(...) || DEFAULT_TARGET_S. The branch chain moves into derived_duration_target, whose else arm is deleted so an unclaimed combination yields nil. autocomplete_labels uses the new constant, and DEFAULT_TARGET_S gains a comment marking it the un-derived fallthrough.
  • ee/lib/ee/gitlab/metrics/global_search_slis.rb — the semantic override is re-pointed from duration_target to derived_duration_target.
  • spec/lib/gitlab/metrics/global_search_slis_spec.rb — an autocomplete example passing advanced/blobs dimensions, which resolve to 15.52 without the new branch, so it cannot pass on the old code; plus two derived_duration_target examples, one asserting every combination in possible_labels derives a target (guarded against a vacuous pass on an empty list) and one asserting an unknown type derives nil.

The target is not re-tightened because 93.3% of autocomplete's over-5s requests fall in a recurring 2-hourly cluster spike this endpoint does not cause, and per-scope duration percentiles do not exist yet — the histogram arrives with !254016. The Rack-side urgency :low (also 5s) is unchanged and out of scope.

Nil is the signal rather than the value on purpose: AUTOCOMPLETE_TARGET_S, DEFAULT_TARGET_S and the basic-scope target are all 5, so a value comparison cannot tell a chosen target from a fallthrough.

Verification

Pipeline 2856485209 on the merged result of head dcab60cd: success, including all 39 rspec-ee unit pg17 es9 shards. The two previous heads also went green.

What I did not verify

  • Nothing was run locally for this description; it was re-derived from the MR diff and the CI result above, which is the only evidence quoted.
  • The 93.3% spike-attribution figure is a gprd metrics measurement quoted from the linked error-budget work item, not a measurement of this branch.
  • No production behaviour was observed. The claim that target_s stays at 5 rests on both constants being 5 in the diff, not on a deployed log line.
Edited by John Mason

Merge request reports

Loading
Loading