Dashboards

API Monitoring Dashboard for the Endpoints You Own

9 min read

An API monitoring dashboard should answer one question in under a second: is the API working for our users right now? Your monitoring stack can already answer it, along with a thousand other questions, on screens built for the engineer who is debugging. This page is about the other screen: the one on the office wall or someone's phone, readable by anyone on the team, showing a handful of numbers for the endpoints you own.

It covers which API metrics earn a place, what to leave to your monitoring tools, the widget for each number, and the JSON and queries to build it.

What belongs on an API monitoring dashboard?

Five things. Each answers a question someone acts on.

  • Is it up? (status per critical endpoint). Login, checkout, the public API: the handful of endpoints where an outage is a customer-facing incident. One green or red tile each. Everything else is detail.
  • Error rate (5xx responses as a share of requests). The best single number for "are users getting failures". Count server errors only. A spike in 4xx is usually a client bug, a bot or a bad deploy of someone else's app.
  • p95 latency. How slow the slowest 5 % of requests are. Use a percentile, not the average: one fast health check per second can make the mean look healthy while real users wait.
  • Throughput (requests per minute). Not because high is good, but because a sudden drop to near zero is often the first sign of an outage the other checks miss, like DNS or a load balancer.
  • Background work: queue depth and the last successful job. APIs fail quietly through their workers. A backlog that only grows, or a nightly job that last succeeded three days ago, belongs on the board.

If your API depends on third parties, such as a payment provider, an email service or an upstream API, add one table with their state. When checkout breaks, the first question is whose fault it is.

What to leave off

  • CPU, memory and disk per host. They're causes, not symptoms. If they matter, they'll show up as latency or errors. Keep them in your infrastructure monitoring, where the person debugging will look.
  • Average latency. It hides exactly the requests you care about. Show p95, or p99 for very high traffic.
  • Every endpoint. A wall of 80 status tiles is green noise. Pick the five to ten that matter to customers.
  • Raw log counts. "12,408 log lines" isn't a signal. If an error matters, count it as an error rate.
  • Anything without a threshold. If nobody can say at what value a number becomes a problem, it can't turn red, and the board stops working.

The widget layout

  • Status in heartbeat mode for each critical endpoint: a pulse while it's healthy, a flatline when it isn't. On a TV it's readable from across the room.
  • KPI tile with an alert for the error rate: the number, the change against the last hour, and an alert above your threshold.
  • Line chart for p95 latency over the last day or week, with ms on each point.
  • Table for dependencies and background jobs, with a coloured badge per row.

Refresh the status and error-rate tiles every minute. Latency trends can refresh every few minutes.

Wiring it up

With dashboardbase, each widget is one endpoint you write. It reads the number from wherever you already keep it, usually your metrics store or your database, and returns JSON. dashboardbase renders it on the web, on a TV and in the apps.

Endpoint status, as a heartbeat

response.jsondashboard.yourcompany.com/s/revenue
{
  "title": "Checkout API",
  "actions": [
    {
      "title": "Check logs",
      "type": "link",
      "url": "https://logs.example.com/checkout"
    }
  ],
  "data": {
    "header": {
      "title": "Operational",
      "subtitle": "All checks passing"
    },
    "status": "Ok",
    "mode": "Heartbeat"
  }
}

Paste that into the free endpoint validator and you'll see the pulse, no account needed. The handler calls the endpoint's own health check with a short timeout and reports what happened:

import express from 'express'

const app = express()

app.get('/dashboard/checkout-status', async (req, res) => {
  let ok = false
  let detail = 'No response'

  try {
    const started = Date.now()
    const response = await fetch('https://api.example.com/checkout/health', {
      signal: AbortSignal.timeout(3000),
    })
    ok = response.ok
    detail = ok ? `Responded in ${Date.now() - started} ms` : `HTTP ${response.status}`
  } catch {
    detail = 'Timed out after 3 s'
  }

  res.json({
    title: 'Checkout API',
    actions: [
      {
        title: 'Check logs',
        type: 'link',
        url: 'https://logs.example.com/checkout',
      },
    ],
    data: {
      header: {
        title: ok ? 'Operational' : 'Down',
        subtitle: detail,
      },
      status: ok ? 'Ok' : 'Error',
      mode: 'Heartbeat',
    },
  })
})

Run this somewhere other than the API it checks. If the status endpoint lives inside the service it reports on, an outage takes the reporter down with it. A small separate service or a serverless function is enough.

Error rate, with an alert

response.jsondashboard.yourcompany.com/s/revenue
{
  "title": "API error rate",
  "actions": [
    {
      "title": "View incidents",
      "type": "link",
      "url": "https://status.example.com/incidents"
    }
  ],
  "data": {
    "header": {
      "title": "2.6%",
      "subtitle": "5xx, last 5 minutes",
      "badge": {
        "text": "+2.1%",
        "icon": "ArrowUp",
        "color": "Danger"
      }
    }
  },
  "alert": {
    "active": true,
    "level": "critical",
    "message": "Error rate above the 1% threshold"
  }
}

If your API exports Prometheus metrics, the numbers are one query away through Prometheus' HTTP API. The metric names below are the common convention (http_requests_total with a status label). Use whatever your instrumentation library actually exports.

const PROMETHEUS = process.env.PROMETHEUS_URL
const THRESHOLD = 0.01 // 1 %

async function promQuery(query) {
  const url = `${PROMETHEUS}/api/v1/query?query=${encodeURIComponent(query)}`
  const body = await (await fetch(url, { signal: AbortSignal.timeout(5000) })).json()
  // An instant vector; empty when there was no traffic in the window.
  return Number(body.data.result[0]?.value[1] ?? 0)
}

const errorRate = (offset) =>
  promQuery(
    `sum(rate(http_requests_total{status=~"5.."}[5m]${offset}))
     / sum(rate(http_requests_total[5m]${offset}))`
  )

app.get('/dashboard/error-rate', async (req, res) => {
  const now = await errorRate('')
  const hourAgo = await errorRate(' offset 1h')
  const delta = now - hourAgo
  const pct = (value) => `${(value * 100).toFixed(1)}%`

  res.json({
    title: 'API error rate',
    actions: [
      {
        title: 'View incidents',
        type: 'link',
        url: 'https://status.example.com/incidents',
      },
    ],
    data: {
      header: {
        title: pct(now),
        subtitle: '5xx, last 5 minutes',
        badge: {
          text: `${delta >= 0 ? '+' : '-'}${pct(Math.abs(delta))}`,
          icon: delta >= 0 ? 'ArrowUp' : 'ArrowDown',
          color: delta > 0 ? 'Danger' : 'Success',
        },
      },
    },
    alert: {
      active: now > THRESHOLD,
      level: 'critical',
      message: `Error rate above the ${pct(THRESHOLD)} threshold`,
    },
  })
})

When active is true, dashboardbase shows the alert on the widget and can send it as a push notification to the iOS and Android apps. Note the badge colours: on an error rate, up is bad.

p95 latency over the week

response.jsondashboard.yourcompany.com/s/revenue
{
  "title": "p95 latency",
  "actions": [
    {
      "title": "View traces",
      "type": "link",
      "url": "https://traces.example.com"
    }
  ],
  "data": {
    "header": {
      "title": "182ms",
      "subtitle": "Last 7 days",
      "badge": {
        "text": "+12ms",
        "icon": "ArrowUp",
        "color": "Danger"
      }
    },
    "labels": [
      "Thu",
      "Fri",
      "Sat",
      "Sun",
      "Mon",
      "Tue",
      "Wed"
    ],
    "datasets": [
      {
        "data": [
          {
            "value": 168,
            "postfix": "ms"
          },
          {
            "value": 172,
            "postfix": "ms"
          },
          {
            "value": 165,
            "postfix": "ms"
          },
          {
            "value": 190,
            "postfix": "ms"
          },
          {
            "value": 201,
            "postfix": "ms"
          },
          {
            "value": 178,
            "postfix": "ms"
          },
          {
            "value": 182,
            "postfix": "ms"
          }
        ],
        "label": "p95 latency"
      }
    ]
  }
}

The query is the standard histogram quantile, one point per day from Prometheus' range API (/api/v1/query_range with step=1d):

histogram_quantile(0.95, sum by (le) (rate(http_request_duration_seconds_bucket[1d])))

Multiply by 1,000 for milliseconds, round, and map each point to { "value": …, "postfix": "ms" }. If you don't run Prometheus, the same number can come from your APM's API or from request logs in your database; the widget doesn't care where it came from.

Dependencies and jobs

response.jsondashboard.yourcompany.com/s/revenue
{
  "title": "Dependencies and jobs",
  "actions": [
    {
      "title": "Open status page",
      "type": "link",
      "url": "https://status.example.com"
    }
  ],
  "data": {
    "columns": [
      {
        "text": "Service",
        "width": 55
      },
      {
        "text": "State",
        "width": 45
      }
    ],
    "rows": [
      [
        {
          "text": "Payments provider"
        },
        {
          "text": "Operational",
          "badge": {
            "text": "Operational",
            "color": "Success"
          }
        }
      ],
      [
        {
          "text": "Email queue (1,240 waiting)"
        },
        {
          "text": "Backlog",
          "badge": {
            "text": "Backlog",
            "color": "Warning",
            "fill": "Outline"
          }
        }
      ],
      [
        {
          "text": "Nightly export (last ok 3 days ago)"
        },
        {
          "text": "Failing",
          "badge": {
            "text": "Failing",
            "icon": "ArrowDown",
            "color": "Danger",
            "fill": "Solid"
          }
        }
      ]
    ]
  }
}

The job rows usually come from your own database: a max(finished_at) per job name, compared with how often each job should run. The dependency rows can come from each provider's public status API, where they have one.

Securing the endpoints

These endpoints describe your infrastructure, so don't leave them open. dashboardbase sends your workspace's Endpoint Secret as an x-dashboardbase-secret header on every request. Check it, return 401 without it, and fail at startup if the environment variable is missing. The Postgres dashboard guide has the full middleware. Give the dashboard read-only access to Prometheus or your database, never an admin token.

Reading it day to day

On a normal day the board is boring: pulses beating, error rate near zero, latency flat. That's the point. It's built so that anyone, not just the on-call engineer, can see from across the room when something isn't normal, and so the person on call hears about it from a push notification rather than from a customer.

When a tile goes red, the board's job is done. Open your monitoring tools to find out why.

When you need Grafana or Datadog instead

This board doesn't replace your monitoring stack. Tools like Grafana, Datadog and your cloud provider's dashboards are built for investigating: drilling into a single host, correlating logs with traces, querying any metric at any resolution. When you're debugging, use them.

What they're less suited to is the shared screen: a few numbers that a product manager, a support lead or a founder can read without knowing the query language. That's the gap this dashboard fills. If your data is mostly business numbers from your own APIs rather than time series, our Grafana alternative comparison goes through the trade-off in more detail.

FAQ

What should an API monitoring dashboard show? Up/down status for the few endpoints customers depend on, error rate (5xx share of requests), p95 latency, throughput, and the state of background jobs and third-party dependencies.

Why p95 latency instead of average response time? The average hides slow requests behind many fast ones. The 95th percentile tells you how slow things are for the unluckiest one in twenty users, which is what they notice.

What is a good API error rate? It depends on your traffic and your users. Set the threshold from your own normal week, and alert when you're clearly above it, rather than using a number from someone else's system.

Can I put an API monitoring dashboard on a TV? Yes. Pair the TV at www.dashboardbase.com/tv and approve it from your phone; the TV holds a display-only token. Heartbeat status widgets are made for it. See the TV dashboard guide.

Does dashboardbase monitor my API for me? No. It doesn't send synthetic requests or collect metrics. Your endpoints read the numbers from the monitoring you already have, and dashboardbase renders them and raises the alerts your responses ask for.

Next steps

  • Pick the five to ten endpoints customers would notice first, and write the status endpoint for one of them.
  • Add the error-rate tile with an alert, and set the threshold from a normal week.
  • Put delivery next to health: the engineering metrics dashboard adds deploys, PR cycle time and CI pass rate from GitHub.
  • Pair the office TV and put the board where the team can see it. For the shape of every other widget type, see API dashboard examples.

Your first dashboard in ten minutes

Return JSON from an endpoint you already own. We handle the charts, hosting, sharing and the mobile app — free for 14 days.