Measure Infrastructure metrics with SQL and check the results
To measure infrastructure metrics with sql, choose one workflow and its owner. Define the events, test them with known inputs, and write a query that answers a specific question.
- 1
Choose when to log
Log metric snapshots with host, container, process, and environment labels.
- 2
Capture the outcome
Begin with container_metric_recorded, disk_metric_recorded, system_metric_recorded and document the grain of each event.
- 3
Check the stored rows
Alert on threshold breaches, trend changes, and missing heartbeats.
- 4
Make the decision
Which containers or hosts are under sustained pressure?
Agent prompt
Paste this into your coding agent
Replace YOUR_API_KEY after signup, then ask the agent to run the product flow and verify the first events.
Infrastructure metrics with SQL setup prompt
Instrument infrastructure metrics with Telemetry.
Use /skill.md and this Telemetry API key: YOUR_API_KEY
Please log container, disk, system, network, process, and heartbeat metrics. Include host_name, container_name, environment, metric_name, metric_value, unit, threshold, status, and observed_at.
Create dashboards for CPU, memory, disk, network, process health, and missing heartbeats. Add alerts for sustained threshold breaches and missing data.
Do not log secrets, environment variable values, command arguments containing credentials, or raw process payloads.Setup steps
- 1Log metric snapshots with host, container, process, and environment labels.
- 2Keep metric names stable and put high-cardinality identifiers in fields.
- 3Create dashboards for CPU, memory, disk, network, and process health.
- 4Alert on threshold breaches, trend changes, and missing heartbeats.
Events to capture
Questions you can answer
- Which containers or hosts are under sustained pressure?
- Which processes correlate with product incidents?
- Which hosts have stopped reporting heartbeats or are running out of disk space?
Example event schemas
Event schemas for this workflow
Check what each event records, when to send it, and which field types it needs. Review the example payload and privacy checklist before using it in production.
Use these queries in Telemetry
Learn about Alerts
Add a threshold and recipients to your reliability query to get alerts.
Related SQL recipes
More SQL recipes
Run the query using this workflow's event fields and check the example result. Save the result to a dashboard or set up an alert.
Find cache misses and stampede risk
Which cache-key patterns combine a poor hit rate with concurrent backend work?
Open recipeCalculate incident detection and recovery time
How long does each service take to detect and recover from incidents?
Open recipeFind host and container resource saturation
Which infrastructure sources are persistently resource constrained?
Open recipeDetect missing service heartbeats
Which expected telemetry sources have stopped sending heartbeats?
Open recipeCalculate p50, p95, and p99 API latency
Which endpoints have the worst tail latency?
Open recipeCalculate API error rate by route
Which API routes have the highest 5xx error rate with at least 20 requests?
Open recipeFind Kubernetes restarts by workload
Which Kubernetes workloads are restarting and failing readiness checks?
Open recipeMeasure Telemetry volume by event name
Which event contracts create the most ingestion volume?
Open recipeNext step
Create the API key your agent will use
The free plan is enough to run the prompt, send test events, and review the first dashboard.
Related pages
Kubernetes reliability monitoring with SQL
Query Kubernetes workload changes alongside application events. See whether restarts are part of a planned rollout and whether users are seeing failures.
Open pageAPI reliability monitoring
Track API request volume, status codes, latency, timeouts, customer impact, and failed endpoints with SQL.
Open pageClaude Code observability
Ask Claude Code to add event logging while it implements a feature, then verify the events in Telemetry.
Open page