📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

Your team has forty Grafana dashboards, and during the last outage nobody could tell from them what was broken. Design a service dashboard that on-call engineers actually use during an incident: what goes at the top, how it is laid out, which queries drive it, how it links to traces and logs, and how you keep dashboards from rotting.

Covers designing incident-ready service dashboards: SLO and RED at the top, dependencies and USE below, deploy and change annotations, consistent templates as code, drill-down links to traces and logs, query performance, ownership and review to avoid dashboard sprawl.

Senior Architecture Advanced dashboards grafana incident-response metrics observability slo

🎯 Key points

  • Answer 'are users hurting, since when, and where' in the first screen
  • Top row: SLO compliance and error budget burn (the user-facing target), then RED: rate, 5xx ratio, p50/p95/p99 with SLO lines
  • Second row: RED for each dependency (SQL, HTTP, Service Bus) to localise the fault
  • Lower rows: USE for runtime, pods and database; collapsed by default
  • Deploy, feature-flag and config annotations on every time series panel
  • Same template for every service via variables, stored as code, backed by recording rules
  • Every alert links to the dashboard with the service pre-selected; panels link to traces and logs
  • Owner, post-incident 'what was missing?' review and usage data to delete unused dashboards

⏱ 30-second answer

An incident dashboard must answer three questions in the first screen: are users hurting, since when, and where. So the top row is SLO status and error budget, then RED for the service (rate, 5xx ratio, p50/p95/p99) with the SLO threshold drawn on the panels. The next row is RED for each dependency (database, downstream APIs, queues) so you can see where the fault starts. Below that, USE panels for the runtime, pods and database, collapsed by default.

Every time series carries deploy and feature-flag annotations, because most incidents follow a change, and panels link to traces and logs filtered to the same service and time window. One template as code with service and region variables serves every service.

The trade-off: fewer panels make it faster to read, but you need drill-down paths for the detail you removed.

🗣 Full answer (senior)

How I would answer this in an interview

"I design it backwards from the questions on-call asks at 3 am: are users affected, how badly, since when, and is it us or something we depend on. If the first screen doesn't answer those in ten seconds, the dashboard has failed, however many panels it has.

So the top row is the user's view: SLO compliance and remaining error budget, then RED: request rate, 5xx ratio and p50, p95, p99 latency, with the SLO threshold drawn as a line. The second row is RED for each dependency, SQL, the payment API, Service Bus, using http.client.request.duration and dependency data, so I can see whether our latency rise matches a dependency's. Below that, collapsed, the USE rows: CPU against the limit and throttling, memory and GC pause, thread pool queue length, database CPU and connection waits. Every time series has annotations for deploys, feature-flag changes and config changes, because the most useful incident question is 'what changed?'. And every panel links to Application Insights or Tempo with the service and time range filled in, plus exemplars from the latency histogram straight to a slow trace.

For example, at [company] we had [40] dashboards built by different people, and during [an outage] the team spent [20] minutes finding the right one. I replaced them with one Grafana template stored as JSON in Git with service, environment and region variables, provisioned through the pipeline, and linked it from every alert. [Time to identify the failing component dropped from about 20 to 5 minutes over the next quarter.]

The mistake I see is the 'everything' dashboard: sixty panels of CPU and memory with no SLO, no annotations and no links. It looks thorough and tells you nothing in an incident."


Layout

Row 1  SLO: availability 99.9% (30d) | error budget left | burn rate 1h / 6h
Row 2  RED: requests/s | 5xx ratio | p50 / p95 / p99 with SLO line     [annotations: deploys, flags]
Row 3  Dependencies RED: Azure SQL | payments API | Service Bus (rate, errors, p95, queue age)
Row 4  (collapsed) USE runtime: thread pool queue | GC pause | exceptions/s
Row 5  (collapsed) USE platform: CPU vs limit + throttling | memory vs limit | restarts | DB CPU, waits
Row 6  Links: runbook | traces (filtered) | logs (filtered) | dependency dashboards

Design rules

Rule Why
Symptoms first, causes below On-call needs impact before diagnosis
Max ~12 panels visible without scrolling Reading speed under stress
Same template for every service Anyone on call can read any service
Units, thresholds and SLO lines on every panel No mental maths at 3 am
Consistent colours (red = bad only) Colour shouldn't need a legend
Recording rules for heavy queries Panels load in seconds during an incident, when everyone opens them at once
Annotations for deploys, flags and config 'What changed?' answered on the graph

Production example

After introducing the template, a payments incident showed p95 rising on the API row at 14:02, the payment dependency's p95 rising on row 3 at the same minute, and no deploy annotation: the on-call engineer identified the provider as the cause in 4 minutes and enabled the fallback flag, where a similar incident the quarter before took 35 minutes.

🔍 What the interviewer is checking

Checks that the candidate designs dashboards around incident questions and operates them as maintained artefacts, not panel collections.

Green flags

  • Starts from the questions on-call asks and puts SLO and RED first
  • Includes dependency RED and change annotations
  • Uses templates as code, variables and links from alerts
  • Has a plan for ownership and deleting unused dashboards

Red flags

  • Leads with CPU and memory
  • One bespoke dashboard per person or per service
  • No link from dashboards to traces and logs

📚 Learn in depth

1. Why most dashboards fail in incidents

Dashboards usually grow by accretion: each incident adds a panel, nobody removes one. Under stress people read the top-left first and stop scrolling quickly, so a dashboard whose first screen shows host CPU tells them nothing about users. Cognitive load is the constraint, not screen space.

2. The question flow the layout follows

Are users hurting?      ──► SLO + error budget burn          (row 1)
How, since when?        ──► RED with annotations              (row 2)
Us or a dependency?     ──► dependency RED                    (row 3)
Which resource?         ──► USE runtime / platform / DB       (rows 4-5, collapsed)
Which requests exactly? ──► exemplars, trace and log links    (row 6)

This mirrors RED-then-USE triage, and the same flow works for every service, which is what makes a single template possible.

3. Making it fast under load

During an incident, twenty people open the same dashboard at once. Raw histogram_quantile over a 30-day SLO window across all pods is expensive. Precompute with recording rules (Prometheus or Azure Monitor managed Prometheus rule groups): for example service:http_requests:rate5m and service:http_request_duration_seconds:p95_5m. Panels then read a handful of series. Keep default time ranges short (last 3 hours) and SLO panels on precomputed 30-day ratios.

4. Annotations: the 'what changed?' answer

Annotate deploys (from the pipeline), feature-flag changes (from Azure App Configuration or LaunchDarkly webhooks), config changes and scaling events. Grafana supports annotations through its HTTP API or from a query against a data source (for example a KQL query over deployment events). A rise in p95 that starts a minute after a deploy annotation is usually the whole diagnosis.

5. Correlation and drill-down

  • Exemplars: the OpenTelemetry SDK can attach trace ids to histogram samples; Grafana shows them as dots on the latency panel that open the trace in Tempo or Jaeger.
  • Data links: panel links to Application Insights transaction search or Log Analytics with ${service} and the time range filled in.
  • Consistent resource attributes (service.name, deployment.environment, cloud.region) across metrics, traces and logs make those links work.

6. Dashboards as code and their lifecycle

Store dashboard JSON (or Grafonnet/Jsonnet, or the Grafana Terraform provider) in Git; provision through the pipeline; disallow editing in production or sync changes back by PR. Give each dashboard an owner and a 'last reviewed' date. After each significant incident, ask what on-call looked for and couldn't find, and what they never looked at. Delete dashboards nobody has viewed in 90 days.

7. Accessibility and reading under stress

Use units on every axis, the SLO threshold as a line, red only for 'bad', and avoid red/green as the only distinction (colour-blind engineers). Prefer time series for rates and latency, single stats only for SLO status.

Try it yourself

  1. Take your busiest service's dashboard and time how long a colleague needs to say whether users are affected right now.
  2. Rebuild it with the six-row layout and variables for service and environment; repeat the test.
  3. Add recording rules for rate, 5xx ratio and p95 and compare panel load time.
  4. Post a deploy annotation from your pipeline using the Grafana API snippet below.
  5. Enable exemplars on the request duration histogram and open a trace from a slow dot.
  6. List dashboards with no views in 90 days and propose deleting them.

💻 Code

Recording rules that make the panels cheap, and a pipeline step that posts deploy annotations to Grafana.

# Prometheus / Azure Monitor managed Prometheus recording rules
groups:
  - name: service-red
    interval: 1m
    rules:
      - record: service:http_requests:rate5m
        expr: sum by (service_name) (rate(http_server_request_duration_seconds_count[5m]))
      - record: service:http_errors:ratio5m
        expr: |
          sum by (service_name) (rate(http_server_request_duration_seconds_count{http_response_status_code=~"5.."}[5m]))
          / sum by (service_name) (rate(http_server_request_duration_seconds_count[5m]))
      - record: service:http_request_duration_seconds:p95_5m
        expr: histogram_quantile(0.95, sum by (service_name, le) (rate(http_server_request_duration_seconds_bucket[5m])))
// DeployAnnotator: run from the release pipeline after a deployment succeeds
namespace Ops.Tools;

using System.Net.Http.Headers;
using System.Net.Http.Json;

public sealed record GrafanaAnnotation(long Time, string[] Tags, string Text);

public sealed class DeployAnnotator(HttpClient http)
{
    public async Task AnnotateAsync(string service, string version, string environment, CancellationToken ct)
    {
        var annotation = new GrafanaAnnotation(
            Time: DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
            Tags: ["deploy", service, environment],       // dashboards filter annotations by these tags
            Text: $"Deployed {service} {version} to {environment}");

        using var response = await http.PostAsJsonAsync("api/annotations", annotation, ct);
        response.EnsureSuccessStatusCode();
    }
}

public static class Program
{
    public static async Task Main(string[] args)
    {
        using var http = new HttpClient { BaseAddress = new Uri(Environment.GetEnvironmentVariable("GRAFANA_URL")!) };
        // Service account token from the pipeline's secret store, never committed
        http.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("GRAFANA_TOKEN"));

        using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
        await new DeployAnnotator(http).AnnotateAsync(args[0], args[1], args[2], cts.Token);
    }
}
# Pipeline step after a successful deployment
dotnet run --project tools/DeployAnnotator -- orders-api 2026.11.22.3 prod-aue

⚠ Common mistakes

  • Mistake: Leading with CPU, memory and host panels. Why it is wrong: they are causes and often look normal during user-facing incidents. Instead: SLO and RED first, USE collapsed below.
  • Mistake: A bespoke dashboard per service and per engineer. Why it is wrong: on-call must learn a new layout for every service under stress. Instead: one template with variables, stored as code.
  • Mistake: No deploy or feature-flag annotations. Why it is wrong: the most common cause, a change, is invisible on the graph. Instead: annotate from the pipeline and flag system.
  • Mistake: Heavy raw queries on every panel. Why it is wrong: dashboards time out exactly when everyone opens them. Instead: recording rules and short default ranges.
  • Mistake: Average latency or a single 'health' gauge. Why it is wrong: hides the tail and the cause. Instead: p50/p95/p99 with the SLO line and request count.
  • Mistake: Dashboards that can't drill down. Why it is wrong: you see the spike but can't find the requests behind it. Instead: exemplars and data links to traces and logs with the time range filled in.
  • Mistake: Editing dashboards by hand in production. Why it is wrong: changes are lost or drift between environments. Instead: provision from Git and change by PR.
  • Mistake: Never deleting dashboards. Why it is wrong: sprawl makes the right one impossible to find. Instead: owners, review dates and deletion of unused ones.

🏛 Senior insight: trade-offs

Dashboards are a product with users (on-call engineers), and they rot like any unowned product. The senior move is to treat them as code: a small number of templates in Git, provisioned by the pipeline, each with an owner and a review after every major incident ('what did you look for that wasn't there?'). Grafana's usage insights or view counts show which dashboards nobody opens; delete those. Alerts should link to the dashboard with the right variables, so the dashboard becomes the entry point to the incident rather than something you search for.

Also be clear about what dashboards are not for: they are for humans looking at a known service. Detection belongs to alerts, and open-ended investigation belongs to traces, logs and ad-hoc queries.

Dashboard type When it fits Cost When not to
Service template (SLO + RED + deps + USE) Every production service, linked from alerts One template to maintain Exploring unknown problems
Overview / estate (all services' SLOs) Incident commander, status meetings Recording rules across services Diagnosing one service
Business dashboard (orders/min, revenue) Product and incident impact statements Custom business metrics Technical diagnosis
Ad-hoc Explore / KQL Novel questions Query cost and time Repeated questions (make a panel)

🔗 Follow-ups the interviewer may ask

  1. When: Candidate structures the dashboard as RED then USE. Why: Checks they understand the method behind the layout.
    How to answer

    RED is for services that handle requests: Rate (requests per second), Errors (failed requests, usually 5xx and timeouts, as a ratio) and Duration (latency distribution, p50/p95/p99). It answers 'are users hurting?'. 4xx responses are normally the caller's mistake, so track them separately rather than in the error ratio.

    USE is for resources: for each CPU, memory, disk, connection pool, thread pool or database, check Utilisation (how busy), Saturation (how much work is queued) and Errors. It answers 'which resource is the bottleneck?'.

    In a microservice system you apply RED to every service and to its outbound dependencies, which lets you follow a problem downstream, then USE on the resources of the service at fault. In .NET, RED comes almost entirely from the built-in http.server.request.duration histogram; USE comes from System.Runtime (thread pool queue, GC), the container or node, and the database. The trade-off: RED is simple and user-centred but says nothing about cause, so you need USE underneath it to diagnose.

  2. When: Candidate says alerts should link to the dashboard. Why: Checks they can design the alerting that leads people to the dashboard.
    How to answer

    Alert on symptoms users feel, such as the request error-rate or latency SLI, failed synthetic journeys or orders per minute dropping, because causes like CPU at 80% often hurt nobody and miss failures with no resource signal at all. The best symptom alert is SLO burn rate: how fast you are spending the error budget. With a 99.9% SLO, a 14.4× burn over 1 hour (confirmed over 5 minutes) spends 2% of a 30-day budget and pages; 6× over 6 hours pages; slower burns raise a ticket.

    Every alert needs who gets paged (the owning team's rotation), the threshold and window, a severity that decides page versus ticket, a dashboard link and a runbook with the first mitigation steps. Cause metrics stay on dashboards for diagnosis. The trade-off: fewer pages means a slightly later warning for slow-building problems, which tickets cover.

  3. When: Candidate puts p95 and p99 on the latency panel. Why: Checks they compute fleet percentiles correctly in those panels.
    How to answer

    An average mixes fast and slow requests into one number that describes almost nobody. If 95 requests take 50 ms and 5 take 3 s, the average is (95 × 50 + 5 × 3,000) / 100 ≈ 198 ms, which looks fine while 1 in 20 customers waits 3 seconds. Percentiles describe the distribution: p50 is the typical request, p95/p99 is the slow tail people complain about.

    Percentiles come from a histogram: count requests into buckets, then find the bucket where 99% of the count is reached and interpolate (put bucket boundaries close to your SLO threshold so the estimate is tight). Because a percentile is not additive, you cannot average p99 across pods or time windows; you merge the bucket counts first and then take the quantile, which is what histogram_quantile(0.99, sum by (le) (rate(...[5m]))) does.

    The trade-off: high percentiles need enough traffic and well-chosen buckets to be trustworthy, so chart the request count next to them and alert on SLO burn rate rather than a raw p99.

🛠 Real-world problems: how you handle them

Replacing 40 ad-hoc dashboards with one incident template
Situation
[company] ran [30] .NET services on AKS with [40] Grafana dashboards built by different engineers; a [payments outage] took [35] minutes to localise because on-call couldn't find a useful view.
Signals
Post-incident review noted 'searched dashboards for 20 minutes'; Grafana usage data showed [25] dashboards with no views in 90 days; panels timed out during the incident.
Investigation
Interviewed on-call engineers about the questions they ask first; reviewed the last [5] incident timelines for which panels were used; checked Grafana query inspector for slow panels and found raw 30-day `histogram_quantile` queries.
Resolution
Built one service template (SLO, RED, dependency RED, collapsed USE, links) with variables, backed by recording rules, provisioned from Git; added deploy and feature-flag annotations from the pipeline and App Configuration; linked every alert to the template with the service pre-selected; archived unused dashboards.
Prevention
Dashboards as code with PR review; owner and review date on each; 'what was missing?' question in every postmortem template; quarterly cleanup of unviewed dashboards.

How to tell it (STAR)

**S:** At [company] we had [40] Grafana dashboards and during a payments outage on-call spent 20 of 35 minutes just finding the right view. **T:** After the postmortem I took the action to make dashboards useful in incidents. **A:** I asked on-call what they look for first, then built one template: SLO and RED at the top, dependency RED, collapsed USE rows and links to traces and logs, backed by recording rules and provisioned from Git. I added deploy and feature-flag annotations from the pipeline, linked every alert to it and archived the [25] dashboards nobody used. **R:** In the next payments incident the cause was clear in 4 minutes instead of 35, and dashboard count fell from [40] to [8].

↩ Usually asked after

More in Metrics

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me