infrastructuremetrics

Infrastructure

Send gauge metrics from your servers and services — CPU, memory, request rates, or any numeric value — and see host health at a glance on the Infrastructure page.

Infrastructure

The Infrastructure page shows the health of your hosts in real time — which are online, which are silent, and which metrics are spiking. Click any host to drill into its metric history.

What you’ll need

Step 1: Send your first metrics

Use the metrics ingest endpoint with your API key:

curl -X POST https://api.scrywatch.com/api/metrics \
  -H "Authorization: Bearer <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "host": "web-server-01",
    "service": "api-gateway",
    "environment": "production",
    "metrics": [
      { "name": "cpu_percent", "value": 42.7 },
      { "name": "mem_percent", "value": 61.2 },
      { "name": "disk_percent", "value": 38.0 }
    ]
  }'

You should receive:

{ "accepted": 3 }

Tip: Send up to 50 metrics per request. Batch all metrics for a host in a single call rather than making one call per metric.

Step 2: Open Infrastructure

Click Infrastructure in the left sidebar.

At the top you’ll see a summary bar with four chips:

ChipMeaning
Total HostsEvery host that has ever sent metrics
OnlineHosts that reported within the last 2 minutes
OfflineHosts that have gone silent
WarningsHosts with at least one metric ≥ 80%

Below the summary bar is the host table — one row per host.

Step 3: Read the host table

Each row shows:

Offline rows are dimmed. Metric cells for offline hosts show .

Step 4: Drill into a host

Click any row to open the host detail page.

You’ll see:

Each card shows:

Step 5: Understand metric colors

Metrics in the 0–100 range are treated as percentages and colored by threshold:

ValueColorMeaning
< 80%GreenHealthy
80–89%YellowWarning
≥ 90%RedCritical

Metrics outside 0–100 (e.g. queue_depth, latency_ms) are shown in purple with no threshold — ScryWatch can’t know what “too high” means for arbitrary values.

Step 6: Set up periodic metric collection

For ongoing monitoring, send metrics on a schedule. The page treats a host as online if it reported within the last 2 minutes, so send at least every 60 seconds.

Example using Node.js:

import os from 'os';

setInterval(async () => {
  const memUsed = process.memoryUsage().rss / os.totalmem() * 100;

  await fetch('https://api.scrywatch.com/api/metrics', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer sw_your_key',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      host: os.hostname(),
      service: 'my-service',
      metrics: [
        { name: 'mem_percent', value: memUsed },
      ],
    }),
  });
}, 30_000);

Tip: For Cloudflare Workers, use a cron trigger (scheduled handler) to send metrics every minute.

You’re done

You now know how to:

Full metrics ingest API reference — request body schema, batch limits, and time-series query endpoints.

API Reference

Want the full API spec for this feature?

View in Docs →
← All guides