Skip to content

Checking your reading list…

Retry verification

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

STAROps Practice: AI-Driven Root Cause Analysis for Web Latency & Origin Failures
Operations 55 min read

STAROps Practice: AI-Driven Root Cause Analysis for Web Latency & Origin Failures

This article details how Alibaba Cloud's STAROps platform automates website troubleshooting by correlating logs, metrics, and traces to pinpoint root causes across six real-world fault injection scenarios, providing reusable prompt templates and a step-by-step framework for latency analysis, error diagnosis, cascade failure isolation, and daily health inspections.

Introduction: The High Cost of Troubleshooting

When a website misbehaves, users only say "it's slow" or "it's broken" while dashboards stay green. Traditional troubleshooting crosses four hurdles: (1) a request spans DNS, CDN, gateway, frontend, multiple microservices, databases, and caches — latency could originate anywhere; (2) a single component failure triggers cascading alerts across teams, obscuring the true root cause; (3) evidence is scattered across SLS access logs, CloudMonitor metrics, ARMS traces, CDN origin logs, DNS, WAF, and change records — each with its own console and query syntax; (4) routine health checks rely on manual diligence and miss slow trends like memory leaks.

The article identifies four structural challenges: incomplete data coverage creates blind spots; correlation analysis requires expert tribal knowledge; alerts tell you that something is wrong but not why , who is affected, or where to look first; and repetitive tasks (inspections, postmortems, reports) resist automation because scripts break on novel failure modes.

STAROps Solution Overview

STAROps is Alibaba Cloud's domain-specific intelligent operations platform. In website monitoring, its role is: give it the problem, and it performs the cross-team evidence gathering and correlation analysis, outputting a conclusion backed by evidence.

Mapping Pain Points to STAROps Capabilities

Unknown latency hop: Automatically decomposes traces, attributes latency to specific service operations, and provides per-hop timing evidence.

Root cause vs. cascade confusion: Groups errors by service within the time window, determines the originating fault and propagation path.

Manual evidence stitching: Auto-generates queries (SQL aggregations, span drill-downs, log searches) across metrics, logs, and traces, cross-validates them, and assembles a minute-level timeline.

Ad-hoc inspections: Encodes inspection patterns as repeatable prompts that output health summaries, resource trend analysis, event inventories, and prioritized action items; supports scheduled long-running tasks.

How STAROps Works

Reads three observability pillars: Metrics (busy/saturation), Logs (what errors), Traces (request flow and per-hop latency). Missing any pillar leaves a gap.

Complete data pipeline: Your app → OTel collectors → SLS / CloudMonitor 2.0 → STAROps (read-only). No application intrusion, no data storage, no config changes.

Delivers conclusions, not raw queries: Correlates evidence around an anomaly, outputs affected objects, cause clues, evidence, and investigation suggestions, reducing back-and-forth between teams.

Complements, not replaces, existing tools: CloudMonitor (CMS) for resource/network metrics, SLS for access/app logs, ARMS for traces/dependency analysis continue to serve monitoring, alerting, and manual troubleshooting. STAROps orchestrates inspections, intelligent diagnosis, and follow-up tasks as "digital employees" toward website ops goals. Existing data in the same CMS 2.0 workspace connects to that workspace; logs in a separate SLS Project connect to that Project — no new product purchases required.

Critical Caveats

Observability completeness is a prerequisite: STAROps cannot see what isn't collected. Its ceiling is your data coverage. It honestly reports insufficient evidence rather than hallucinating a root cause.

Separation of duties: Inspection, diagnosis, and config changes are distinct. Dangerous operations (config changes, restarts, deletions) are only suggested; execution is gated by RBAC and tool permissions. High-risk changes require human confirmation.

Business logic bugs remain yours: STAROps can tell you which interface fails at which hop; fixing the business logic is still your job.

Quick Start: Console and CLI

Console Path

Open https://starops.console.aliyun.com.

In "Digital Employees", open the target employee card (e.g., system employee apsara-ops), click New Session ; select data scope and connect your SLS Project (see official doc at

https://help.aliyun.com/zh/starops/user-guide/connect-to-log-service-sls-of-starops

).

Enter the domain/URL, time window, backend services, and data source names; ask for correlation of access logs, origin/network metrics, backend traces, and release/config changes. After the first answer, request an intelligent diagnosis report, then follow up on affected requests, upstream/downstream services, change correlations, and priority actions (see quick start guide at

https://help.aliyun.com/zh/starops/getting-started/quick-start-for-intelligent-conversations

).

Three Reusable Prompt Templates

Inspection: "Inspect <site> daily: check request errors, access latency, origin status, and resource load; output inspection report, risk objects, and follow-ups per website health rules."

Intelligent Diagnosis: " <domain> has been slow with CDN origin failures in the last hour. Correlate access/app logs, origin/network metrics, backend traces, and concurrent changes; output anomalous hops, impact scope, and investigation suggestions."

Special Query: "Query <site> 's WAF logs for the last hour, summarize hits by block rule and request pattern, list associated URLs, timestamps, and log evidence."

CLI Path (Reproducible, Scriptable)

Create a persistent thread (context reused across the investigation):

./aliyun starops create-thread --name apsara-ops  --title "Website Monitoring Troubleshooting"  --variables '{"project":"<your-project>"}'  --region cn-beijing --endpoint starops.cn-beijing.aliyuncs.com --profile webmon
# Returns threadId; save it as <THREAD>

Each question is a create-chat call (SSE streaming, ~3-5 minutes per diagnosis):

./aliyun starops create-chat --digital-employee-name apsara-ops  --thread-id <THREAD>  --variables '{"project":"<your-project>","region":"cn-hangzhou","language":"zh","timeZone":"Asia/Shanghai"}'  --messages '[{"messageId":"msg-001","role":"user","contents":[{"type":"text","value":"<your question>"}]}]'  --region cn-beijing --endpoint starops.cn-beijing.aliyuncs.com --profile webmon

Three questioning essentials (omission leads to vague answers): ① Data coordinates (Project/Region/Logstore); ② Explicit time window (absolute time + UTC+8); ③ Clear intent (query data / find root cause with evidence / merge & grade / inspection). Reuse the same threadId for multi-turn follow-ups; STAROps carries forward prior evidence. Increment messageId each turn (msg-002, msg-003...).

Six Hands-On Scenarios: A Universal Troubleshooting Framework

Each scenario follows a five-step framework applicable to any website anomaly:

What is the problem? User/monitoring observed symptoms.

Solution approach: How to think: what to check first, what evidence needed, common pitfalls.

Prompt to STAROps: Translate the approach into a precise question (copy-paste, swap coordinates/time).

STAROps feedback & analysis: How it actually queried, what conclusions and evidence it produced, what to learn, what to watch for.

Action on results: Verify conclusion, decide next steps.

Scenario 1: Website Slow — Which Hop?

Fault injected: disk_io (source disk I/O anomaly, template latency 3-8s).

Symptom: Homepage load degrades from ~0.06s to 3.5-7.3s, HTTP still 200. Classic "green dashboard, losing users" stealth mode.

Approach: Latency is end-to-end; essence is decomposing total time into hops . Correct order: (1) Identify slow entry — which page/endpoint? Check per-service latency distributions (P95/P99, not average — averages dilute with fast requests). (2) Drill down the trace of the slowest entry — which services, how long per segment? Bottleneck: self compute or waiting on downstream? (3) Rule out confounders: traffic spike (capacity vs. component)? Error rate rising (pure latency or latency+errors)? (4) Demand evidence: conclusion must land on "specific operation of specific service" with timing data.

Prompt: "My site runs on ECS, observability data in SLS Project=<project> / Region=cn-hangzhou, three Logstores: otel-traces, otel-metrics, otel-logs. Query last 15 min access experience: per service (generate/template/history/llm-gateway) request volume, error rate, latency (P95/P99), identify which service slowed and which hop, with evidence."

STAROps Execution (worth studying): First explores schema to confirm fields/units, then aggregates, finds slowest endpoint, proactively drills traces:

Layer 1 (Service Overview): Full table of four services' volume/error rate/P95/P99/max — confirms zero errors site-wide, ruling out "slow+error", pure latency.

Layer 2 (Endpoint Ranking): POST /generate on frontend P95=13.79ms is slowest entry; homepage and detail pages next.

Layer 3 (Trace Decomposition): Splits POST /generate trace — GenerateAction has two parallel paths: GenerateService.Generate and TemplateService.GetTemplate. Further drill shows generate-service's main time spent in callTemplateService.

Conclusion: Bottleneck is not LLM inference but the generate-service → template-service call chain; template-service's getTemplate is the ultimate latency source (llm-gateway single inference ~1.07s but only few requests trigger it, limited end-to-end impact — STAROps actively excluded the most easily misjudged component).

Bonus Suggestion: Add template caching in generate-service to eliminate repeated template-service calls.

Action: Go check the component indicated (here template-service machine's disk I/O; real site: disk/cache/dependency per conclusion). Validation: your injected fault is the ground truth — direction match is instantly verifiable.

Scenario 2: Mass 500 Errors — Root Cause & Evidence Chain

Fault injected: db_error (quota MySQL unreachable), note injection timestamp.

Symptom: Users report "generation completely broken": generation interface all HTTP 500 (fail fast 0.3-0.6s), homepage and other features normal.

Approach — Iron Law for 500s: "Where the error occurs matters more than the error itself." (1) Anchor time: when did errors start? Prior changes/events? Minute-level timeline is first evidence for root cause. (2) Find deepest error span: interface 500 is surface; examine failed request's trace for the deepest span reporting error — self code bug or dependency failure? (3) Grab raw evidence: original error log text, span statusMessage and attributes (which address, what statement), no hearsay. (4) Define blast radius: which interfaces/users affected, which services untouched? Upstream errors: independent fault or cascade? (5) Remediation tiers: stop bleeding (check dependency), then harden (fallback/retry/decouple).

Prompt: "Users report generation requests failing massively from <injection time, e.g., 2026-11-19 14:54> (UTC+8). Data in SLS Project=<project> / Region=cn-hangzhou (otel-traces/otel-metrics/otel-logs). Diagnose root cause of generate-service 500s, provide evidence chain (specific error logs, error spans, impact scope), and remediation suggestions."

STAROps Execution: Opens with parallel error span and error log queries, converges in two rounds:

Root Cause: generate-service cannot connect to quota DB rm-quota-db.mysql.rds.aliyuncs.com:3306 (connection refused), every request's prerequisite checkUserQuota fails → entire generation chain 500.

Timeline: Pre-injection errors 0; injection minute onward 51→71→70 per minute, precisely hits your injection minute .

Evidence Triad: ① 192 failed traces' error spans all land in checkUserQuota, statusMessage consistently dial tcp ... connection refused; ② span attributes directly give db.system=mysql, target table user_quota, SQL SELECT remaining_tokens FROM user_quota WHERE user_id = ? — which host, what query, no SSH needed; ③ App logs corroborate spans.

Blast Radius: Frontend's 189 502s classified as cascade, not independent fault ; template/history zero impact; affected user list complete.

Tiered Remediation: Urgent: check RDS status/connections/whitelist → Short-term: add fallback and retry → Long-term: decouple quota check from generation.

Key Learning: It didn't stop at "database down" but explained how the fault propagated to users (checkUserQuota is per-request prerequisite → generation fully down not partial) — exactly the causal chain needed to explain impact to stakeholders.

Scenario 3: Multi-Service Errors — Source vs. Cascade

Fault injected: cascading_failure (LLM gateway unavailable), note timestamp.

Symptom: Alert storm: multiple services erroring — generate-service returns 429 (internal rate-limit shape), frontend returns 502. Users say "site broken"; ops face undifferentiated alert pile — classic multi-team thrash scenario.

Approach: Multi-service errors: merge first, locate second, never spread effort evenly . (1) Constrain time window: only this error wave. Prior same-day events (e.g., Scenario 2's quota DB) must be explicitly excluded, else analysis conflates two incidents. (2) Trace dependency direction: follow call chain to see which layer errors first — downstream first, upstream later → source downstream; upstream translating downstream error codes into its own is classic cascade signature. (3) Demand propagation evidence: both source and cascade service status codes must appear to confirm conduction, not guess. (4) Anomaly = clue: rate limit fires but traffic didn't spike? Problem is limiter config/state, not capacity.

Prompt: "Monitoring detects new error wave from <injection time> (UTC+8) across multiple services. Data in SLS Project=<project> / Region=cn-hangzhou. Analyze only post-injection window: merge errors by service, determine source fault vs. cascade reactions, provide propagation path and evidence. Note: prior <Scenario 2 time> quota DB fault is separate incident, do not mix."

STAROps Execution:

Merge Conclusion: generate-service is source (429 rate limited); frontend 502 is cascade (translates upstream 429 to 502); template/history zero errors, unaffected.

Propagation Path with Dual Evidence: User → frontend POST /generate → generate-service returns 429 → frontend returns 502; both spans' http.status_code shown.

Caught Anomaly: Traffic stable (70-77 req/min) yet rate limit triggered → limiter threshold/state abnormal, not capacity.

Unexpected Discovery: Frontend shouldn't convert 429 to 502 — 429 means "retry later", converting to 502 misleads users and upstream monitoring as unavailable. Suggests pass-through 429 + Retry-After header. Real code improvement, not immediate fix, but worth logging.

Two Incidents Cleanly Separated: Side-by-side comparison table of Scenario 2 quota DB fault vs. this: root cause, error message, status code, duration, recovery status — no conflation.

Action: Only address the locked source (here check llm-gateway/rate-limit config); don't restart frontend just because it errors. Log "429→502" as improvement item.

Scenario 4: Same Storage Down — Why Different Impact?

Fault injected: cache_down (Redis unreachable), note timestamp.

Symptom: History/cache features error, but core generation works: history/cache interfaces all 500, generation requests still 200. Sharp contrast with Scenario 2 "DB down → generation fully down" — same storage unreachable, why totally different business impact? Best lesson for understanding your system's resilience.

Approach: (1) Root cause routine same as Scenario 2 (time anchor → deepest error span → raw evidence). (2) Ask one more layer: "Why different blast radius?" Is the failed component a hard dependency (failure = request failure, like quota check) or soft dependency (failure degradable, like cache miss → pass-through)? Impact difference itself is architecture information. (3) Explicitly compare with prior event: have analysis compare two storage faults item-by-item (component, address, interfaces, impact, cascade path, root cause type) to confirm independent events vs. recurrence — decides "fix new problem" vs. "previous fix incomplete". (4) Incidentally review degradation design: soft dependency failure behavior (pass-through, error, silent degrade) as expected? Cache pass-through shifting load downstream?

Prompt: "Site from <injection time> (UTC+8) shows new fault: history/cache requests mass 500. Data in SLS Project=<project> / Region=cn-hangzhou. Analyze only post-injection window, diagnose history-service 500 root cause, provide evidence chain (error log original, error span, affected interfaces and upstream/downstream impact), and explain difference from prior <quota DB fault time> quota DB fault."

STAROps Execution:

Root Cause: Redis redis:6379 Connection refused, evidenced by history-service error log originals and 500 spans on /cache/lookup etc.

Propagation Path: Redis → history-service /cache/*, /history/* 500 → generate-service's lookupPromptCache call fails — but generation overall 200 because cache failure passes through to direct LLM call (soft dependency + degradation path, contrasting Scenario 2's hard dependency).

Itemized Comparison Table: MySQL quota DB vs. Redis cache — connection address, error message, affected services/interfaces, cascade impact, business impact, root cause type column-by-column, explicitly judged two completely independent events .

Remediation: Urgent: check Redis instance status/network → Short-term: explicit degradation on cache query failure (return empty not 500), add pass-through protection for lookupPromptCache → Long-term: Redis HA + connection failure alerts.

Action: Verify root cause against your injected fault; log "soft dependency failure still returns 500" as degradation design improvement.

Scenario 5: Site Loads but Features Broken — Independent Faults or Shared Dependency?

Fault injected: config_error (config center anomaly), note timestamp.

Symptom: Most confusing shape: synthetic checks show site normal (homepage 200), users say all features broken — generate, history simultaneously 503, static homepage still 200. Static path doesn't depend on config hot-reload, so "site loads"; dynamic features all depend, so "features broken".

Approach: Multiple unrelated services simultaneously emitting same error class → suspect shared dependency over coincidence. (1) Align error start times: do errors begin same minute (even second-level window)? Stronger simultaneity → stronger shared dependency hypothesis. (2) Check error semantics same family: all config-related? all connection? all timeout? Same family points to same dependency layer (config center/network/DNS/auth service). (3) Find unaffected services as control: who didn't error? Its difference from erroring services (no config hot-reload dependency) precisely scopes the faulty dependency. (4) Pivot investigation to change records: shared dependency faults often triggered by changes — concurrent config pushes, config center health, mount/permission issues. (5) Maintain conclusion discipline: evidence only supports "config-class errors, simultaneous occurrence" → stop there, list "confirm if same config source" as next action, don't hard-code.

Prompt: "Site from <injection time> (UTC+8) shows multiple services simultaneously returning 503, but static homepage appears normal. Data in SLS Project=<project> / Region=cn-hangzhou. Analyze only post-injection window: are multi-service 503s independent faults or shared dependency? Merge diagnosis for root cause, provide error log/span evidence and impact scope, and give investigation directions."

STAROps Execution:

Error Classification: generate "cannot resolve model routing config", history "configuration unavailable" — both config-class.

Simultaneity Evidence: Two services errors start nearly simultaneously (~5 sec diff), supports common trigger hypothesis.

Control Group: template-service zero errors — it doesn't depend on the broken config path.

Impact Quantification: Per-service error span counts (generate 228 / history 198 / frontend 225 cascade 502 / template 0) and minute-level timeline.

Investigation Directions: Config loading mechanism (env/file/config center), concurrent config changes/restarts, config center health, host resource pressure.

Same-Day Multi-Incident Catalog: Quota DB / Rate Limit / Redis / Config four incidents' root causes, components, statuses listed individually, no mixing.

Key Learning (Conclusion Discipline): Two services' config error messages differ; STAROps judges from data "not same config file", does not flatly assert shared root cause is config center — even though injection was indeed fleet-wide config hot-reload failure. This isn't a mistake: with divergent error messages, data only supports "config-class, simultaneous"; it stops there. Insufficient evidence → no death conclusion is prerequisite for trustworthy intelligent diagnosis; you combine injection facts (or real config center health check) to add final confirmation.

Scenario 6: Daily Inspection — Catching "Quietly Worsening" Risks

Fault injected: None — run after all faults recovered and double-confirmed.

Problem: Incidents resolved, but two questions unanswered: Really clean recovery? Any silently worsening risks? (Memory leaks, error rate creep — dashboards look "normal" every day before disaster.) This is what inspections solve — and what most teams fail to sustain.

Approach: A useful inspection isn't "glance at charts" but answers three questions: (1) Healthy now? Request volume/error rate/P95 in normal bands? Just-recovered services need minute-level trends to confirm clean recovery, not window averages (averages polluted by incident data). (2) Trending worse? Resource waterlines (memory/connections/disk) monotonically rising? Judgment standard is trend not absolute value — 20 min +5MB is noise, sustained two days +50MB/hour is leak. (3) What happened today? Event inventory (time/root cause/current status) + unclosed follow-ups, priority-sorted — inspection output half "confirm nothing", half "todo list".

Prompt: "Incidents resolved. Perform a checkup on this site (data: SLS Project=<project> / Region=cn-hangzhou): 1) Last 10 min per-service volume/error rate/P95 latency recovered normal? 2) Origin resource waterlines (otel-metrics process memory etc., check for slow rising trend); 3) Summarize anomaly events since <start time> (time, root cause, current status), output format suitable for daily scheduled inspection."

STAROps Execution:

Health Confirmation: Service health table + minute-level recovery trends (generate error rate zero from minute X, frontend fully recovers after), and proactively notes 10-min window average still contains incident-accumulated errors — doesn't fool you with polluted average.

Trend Judgment: Four services' process memory RSS 20-min +1~7MB, judged normal fluctuation, no leak signs; simultaneously points out origin missing process CPU metrics, recommends adding collection — admits missing data rather than pretending it looked.

Event Retrospective: Day's incidents time/root cause/impact/status table + timeline.

Prioritized Todos: P1 investigate RDS root cause (bleeding stopped but root cause open), P2 check rate-limit config and 429 pass-through, P3 add metrics and alerts — turns "exercise discoveries" into auto-tracked follow-up list.

Action: Two minutes daily read conclusions; spin up intelligent diagnosis on risk items; todo list feeds directly into team task tracker.

Integrating STAROps with Your Real Website

Data Onboarding Checklist (Connect Where Data Actually Lives, No New Products)

Access logs/monitoring: Status codes, latency, errors/timeouts/origin failures → Request error & latency inspection → SLS (independent Project connect that Project).

Origin CPU/memory/network metrics, resource status: Origin & resource health → CloudMonitor 2.0 (if same CMS 2.0 workspace, connect only that workspace).

Backend interface latency, traces, upstream/downstream dependencies: Slow hop, cascade merge → OTel agents → SLS otel-traces (or existing trace source).

Release/config change records, website health rules: Change correlation analysis → Supplement per actual situation.

CDN origin, DNS, WAF blocks, frontend performance: Supplement per anomalous hop → Corresponding product logs into SLS.

Onboarding docs:

https://help.aliyun.com/zh/starops/user-guide/connect-to-log-service-sls

,

https://help.aliyun.com/zh/starops/user-guide/connect-to-log-service-sls-of-starops

. First thing after connect: ask STAROps to draw your site's real call map ("Draw core call graph and dependencies for this site").

Embedding into Your AI Toolchain

STAROps supports Skill/CLI/Plugin integration (Qoder native, plugin marketplace search alibabacloud-starops-chat). Configure digital employee ID and Alibaba Cloud credentials; AI assistant auto-invokes on ops diagnosis intent — this tutorial's CLI commands are what it does under the hood.

Summary

Back to the opening scene: user says "site laggy", dashboards green, access team and origin team talk past each other. After six scenarios, you have a different answer — one question, minutes later returns an evidence-backed conclusion: which hop is slow, which dependency errors, which alerts are cascades, is recovery clean. Data unchanged; distance from data to conclusion transformed.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

Cloud NativeoperationsObservabilitytroubleshootingSLSAlibaba Cloudroot cause analysisfault injectionwebsite monitoringSTAROps

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion