GroupTasksByTypeSlowRequests
Overview
Section titled “Overview”This alert fires when the group Value Stream Analytics “Tasks by type” chart has had more than 2 requests slower than its 5 second target in the last 24 hours. It watches Groups::Analytics::TasksByTypeController#show and #top_labels.
The chart groups issues or merge requests by label and day over a whole group hierarchy. On the largest groups this reaches the 15 second PostgreSQL statement timeout. GracefulTimeoutHandling catches the timeout and returns HTTP 200 with an error message, so the user sees an empty chart and no error-rate SLI moves. The apdex SLI is the only signal: the endpoints are urgency :low, which is a 5 second target, and a timed-out request takes 15 seconds or more.
Each slow request holds a replica connection and a Puma worker for its whole duration, and the replicas are shared by all customers. The alert is an early meter for Project Bulkhead, not a page. It tells the Optimize group that a group is hitting the limit, so they can decide on a cheaper query or a cache.
Services
Section titled “Services”- Web service overview
- Owner: group::optimize, Slack
#g_analytics_optimize
Metrics
Section titled “Metrics”The alert reads the Rails request apdex SLI counters, filtered to the two endpoints:
gitlab_sli_rails_request_apdex_total: requests that have an apdex target.gitlab_sli_rails_request_apdex_success_total: requests that met it.
The value is increase(total[24h]) - increase(success[24h]), which is the number of requests that missed the target. If an endpoint has no success series at all, every request missed the target, and the rule uses the total instead of dropping the endpoint.
Threshold > 2: over 2026-10-01 to 2026-11-13 the value was 0 on most days, 1 on a few days with a single slow request, and 3 to 4 on the two periods of real timeouts (about Oct 3 and Oct 23). So the alert fires for those clusters and stays quiet for a single slow request. The issue #636171 has the measurements.
Alert Behavior
Section titled “Alert Behavior”- The alert is
s3: it does not page, and goes to#g_analytics_optimize. - It is expected to be rare. In the six weeks above it would have fired during two periods.
- It uses a 24 hour window, so after one burst of slow requests it stays firing for up to a day and clears on its own.
- It is evaluated in production only.
Severities
Section titled “Severities”- Impact: users of large groups see an empty Tasks by type chart. The cost on shared replicas is a few 15 second queries, not a capacity problem at this count.
- Incident severity: usually
S4. Raise it only if the count keeps growing for several days or if the replicas show load from these queries.
Verification
Section titled “Verification”Requests over target in 24 hours, per endpoint:
( sum by (endpoint_id) (increase(gitlab_sli_rails_request_apdex_total{env="gprd", endpoint_id=~"Groups::Analytics::TasksByTypeController#(show|top_labels)"}[24h])) - sum by (endpoint_id) (increase(gitlab_sli_rails_request_apdex_success_total{env="gprd", endpoint_id=~"Groups::Analytics::TasksByTypeController#(show|top_labels)"}[24h])))To find the group, use Kibana, pubsub-rails-inf-gprd index:
- Tasks by type saved search
- Requests over 5 seconds:
json.meta.caller_id : ("Groups::Analytics::TasksByTypeController#show" or "Groups::Analytics::TasksByTypeController#top_labels") and json.duration_s >= 5. Showjson.meta.root_namespace,json.duration_sandjson.db_duration_s. - Timeouts: add
json.exception.class : "ActiveRecord::QueryCanceled"andjson.subcomponent : "exceptions_json". Keep the time range to 7 days or less; longer ranges are slow in Kibana.
Recent changes
Section titled “Recent changes”Troubleshooting
Section titled “Troubleshooting”- Open the Kibana search above and note which
json.meta.root_namespacethe slow requests belong to. One namespace means one large group; many namespaces means a general database slowdown. - Compare
json.db_duration_swithjson.duration_s. They are normally almost equal for this endpoint, because the time is spent in PostgreSQL. - If many namespaces are slow at once, check the replica dashboards for load or replication lag before looking at the endpoint.
Possible Resolutions
Section titled “Possible Resolutions”- One large group: tell group::optimize in
#g_analytics_optimize. The fixes are on the Project Bulkhead issue: a cheaper query, a shorter range for the biggest groups, or a short cache. - A general database slowdown: this alert is a symptom. Follow the database alerts instead.
Dependencies
Section titled “Dependencies”- PostgreSQL replicas (the
label_linkslookup and the issue or merge request scan).
Escalation
Section titled “Escalation”- group::optimize in
#g_analytics_optimize.