Telemetry
Copy-paste instrumentation template

API Error And Latency Monitor

Watch request volume, status codes, route latency, failed endpoints, and customer-impacting API incidents.

Reviewed by the Telemetry product team on . Event names, recommended fields, analysis questions, and privacy boundaries. Review standards and ownership

Questions this unlocks
  • Which routes are slowest by p95 latency?
  • Which customers are affected by elevated errors?
  • Where did traffic drop or spike?
Template evidence path

API Error And Latency Monitor: implementation to decision

Treat the prompt as an implementation brief. The useful artifact is not copied code alone, but a reviewed event contract that produces a trustworthy answer.

  1. 1

    Select the boundary

    Instrument the point where api_request_started becomes final.

  2. 2

    Create the contract

    Start with api_request_started, api_request_completed, api_request_failed and keep every field typed, bounded, and privacy-reviewed.

  3. 3

    Run a fixture

    Exercise known success, failure, retry, and empty-result cases before relying on aggregate results.

  4. 4

    Answer the question

    Which routes are slowest by p95 latency?

Template versus use case

This page is the implementation brief

Copy this template when the measurement goal is already clear. Use the matching use-case guide to review event boundaries, success definitions, and the decisions the resulting SQL should support.

Read API Reliability Monitoring

Template

Paste this into your coding agent

Replace YOUR_API_KEY, run the flow locally, then verify the generated events and dashboards.

api-error-monitor

API Error And Latency Monitor

text
Add Telemetry to API request handling.

Use /skill.md and this Telemetry API key: YOUR_API_KEY

Log each important API request with:
route_template, method, status_code, status, latency_ms, user_id, team_id, request_size_bytes, response_size_bytes, error_type, and feature.

Create charts for request volume, error rate, p50 latency, p95 latency, and top failing endpoints. Add alerts for 5xx spikes, slow p95 latency, and traffic drops.

Do not log request bodies, cookies, auth headers, secrets, or raw user content.

Events to capture

api_request_startedapi_request_completedapi_request_failedapi_rate_limitedapi_timeout

Verification checklist

What a complete instrumentation pass leaves behind

Events

Synthetic events reach the intended table with stable names and field types.

Queries

The first SQL queries return plausible rows with an explicit time window.

Views

A dashboard uses the real fields and includes enough context to explain a change.

Safety

Prompts, bodies, credentials, signatures, and private content were checked for redaction.

Event schema starting points

Review the row grain, emit boundary, required types, privacy classes, example payload, and validation checklist before adapting a query or snippet to production.

Related product capability

Continue this workflow in Alerts

Promote the reviewed reliability query into an owned threshold and response workflow.

Related SQL recipes

Answer the next question with SQL

Run the query against the structured fields from this workflow, inspect the example result, and turn a useful answer into a dashboard or alert.

Browse all recipes
API reliabilityBeginner

Calculate API Request Throughput by Route

Which API routes are processing the most requests per minute?

Open recipe
API reliabilityIntermediate

Measure API 429 Rate-Limit Recovery

Do requests that receive HTTP 429 recover successfully after retrying?

Open recipe
InfrastructureAdvanced

Calculate Incident Detection and Recovery Time

How long does each service take to detect and recover from incidents?

Open recipe
API reliabilityBeginner

Calculate API Error Rate by Route

Which API routes have the highest meaningful 5xx error rate?

Open recipe
API reliabilityIntermediate

Calculate p50, p95, and p99 API Latency

Which endpoints have the worst tail latency?

Open recipe
API reliabilityBeginner

Calculate API Timeout Rate by Route

Which API routes time out often enough to affect users?

Open recipe
API reliabilityIntermediate

Compare Dependency p95 Latency

Which downstream dependencies have the worst tail latency and failure rate?

Open recipe
API reliabilityIntermediate

Measure API Availability Against an SLO

Did each service meet its daily availability objective?

Open recipe
API reliabilityIntermediate

Calculate API Error-Budget Burn Rate

How quickly is the API consuming its 99.9% availability budget?

Open recipe
API reliabilityBeginner

Rank Error Fingerprints by Customer Impact

Which error groups affect the most customer accounts?

Open recipe
API reliabilityBeginner

Compare Feature Rollout Error Rate

Is the feature-flag rollout less reliable than its control cohort?

Open recipe
API reliabilityIntermediate

Measure Incident Customer Impact by Plan

How many accounts were affected by the incident in each plan?

Open recipe

More templates