cloudthinker-ai/cloudskills/api-latency-investigation

Claude Code and agent skill by cloudthinker-ai/cloudskills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when performing api latency investigation — provides a systematic investigation framework for diagnosing and resolving API latency issues. Covers distributed tracing analysis, bottleneck identification across the request path, database query impact, external dependency latency, and optimization recommendations with expected impact.

Install

npx vskill@latest install cloudthinker-ai/cloudskills/api-latency-investigation

SKILL.md

The same SKILL.md was published earlier as cloudthinker-ai/cloudskills/api-latency-investigation.

API Latency Investigation

Phase 1: Symptom Characterization

  1. Define the latency problem precisely
  • [ ] Which endpoints are affected?
  • [ ] When did latency increase? (gradual or sudden)
  • [ ] Is it constant or intermittent?
  • [ ] Does it correlate with traffic volume?
  • [ ] Which percentiles are affected? (P50, P95, P99)
  • [ ] Are specific users, regions, or clients affected?
  1. Collect current latency metrics
  2. Compare against historical baseline
  3. Check for recent deployments or infrastructure changes
Latency Profile
EndpointP50 (current)P50 (baseline)P95 (current)P95 (baseline)P99 (current)
msmsmsmsms

Phase 2: Request Path Analysis

  1. Trace the full request path
  • [ ] Client / CDN / Load Balancer
  • [ ] API Gateway / Reverse Proxy
  • [ ] Application server processing
  • [ ] Database queries
  • [ ] Cache lookups (hit/miss)
  • [ ] External API calls
  • [ ] Message queue operations
  • [ ] Response serialization
  1. Measure time spent at each component using distributed tracing
  2. Identify the component consuming most time
Latency Breakdown
ComponentAvg Time (ms)% of TotalVarianceBottleneck
Network/LB%Low/High[ ]
API Gateway%[ ]
App processing%[ ]
Database%[ ]
Cache%[ ]
External APIs%[ ]
Serialization%[ ]
Total100%

Phase 3: Bottleneck Deep Dive

  1. For database bottlenecks:
  • [ ] Review slow queries and execution plans
  • [ ] Check for missing indexes
  • [ ] Analyze connection pool utilization
  • [ ] Check for lock contention
  1. For application bottlenecks:
  • [ ] Profile CPU hotspots
  • [ ] Check for memory pressure / GC pauses
  • [ ] Review thread/goroutine blocking
  • [ ] Check for synchronous operations that should be async
  1. For external dependency bottlenecks:
  • [ ] Measure dependency response times
  • [ ] Check for timeout configurations
  • [ ] Evaluate circuit breaker behavior
  • [ ] Consider caching dependency responses
  1. For network bottlenecks:
  • [ ] Check DNS resolution times
  • [ ] Verify TLS handshake performance
  • [ ] Measure cross-AZ/region latency
  • [ ] Review connection reuse and keep-alive settings

Phase 4: Root Cause Identification

  1. Correlate latency with system metrics
  2. Check for resource saturation (CPU, memory, connections, IOPS)
  3. Review application logs for errors and warnings
  4. Identify any cascade effects from downstream services
  5. Document confirmed root cause(s)
Root Cause Analysis
Root CauseEvidenceImpact on LatencyFix ComplexityPriority
+msLow/Med/High1-5

Phase 5: Optimization Implementation

  1. Implement fixes in priority order
  • [ ] Database query optimization and indexing
  • [ ] Caching layer (application cache, Redis, CDN)
  • [ ] Connection pooling tuning
  • [ ] Async processing for non-critical paths
  • [ ] Payload size reduction
  • [ ] Batch/bulk API operations
  • [ ] Circuit breakers for external dependencies
  1. Test each fix and measure latency impact
  2. Verify no regressions introduced

Phase 6: Validation & Monitoring

  1. Compare post-fix latency against baseline
  2. Validate across all affected percentiles
  3. Run load test at peak traffic levels
  4. Set up latency alerting and SLO monitoring
  5. Document findings for future reference

Counter-Rationalizations

ShortcutCounterWhy
"We can skip some steps for this case"Adapt the workflow steps, don't skip themSkipped steps are where incidents and oversights originate
"The user seems to already know what to do"Complete all workflow phases with the userThe workflow catches blind spots that experience alone misses
"This is a minor case, full process is overkill"Scale the process down, don't turn it offMinor cases become major when unstructured; the process scales, not disappears
"I'll fill in the details later"Complete each section before moving onDeferred details are forgotten; real-time capture is more accurate
"The template output isn't necessary"Always produce the structured output formatStructured output enables comparison, audit trails, and handoff to other teams

Output Format

  • Latency Profile: Current vs. baseline by percentile
  • Request Path Breakdown: Time per component analysis
  • Root Cause Report: Confirmed causes with evidence
  • Optimization Results: Before/after latency measurements
  • Monitoring Setup: Alerts and dashboards for ongoing tracking

Action Items

  • [ ] Characterize the latency problem with precise metrics
  • [ ] Trace request path and identify bottleneck components
  • [ ] Deep dive into top bottleneck(s)
  • [ ] Implement optimizations in priority order
  • [ ] Validate latency improvement against targets
  • [ ] Set up ongoing latency monitoring and alerting

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/cloudthinker-ai/cloudskills/api-latency-investigation/badge)](https://verified-skill.com/skills/cloudthinker-ai/cloudskills/api-latency-investigation)

Something wrong with this skill or its page? Tell us.