Documentation 40

Guide · Grafana

How do I test a Grafana integration without a real server?

You do not need one. Point your client at a read-only Grafana replica that already holds the olympus-labs data set, and your code runs unchanged.

01 / The one change

Swap the base URL. Nothing else.

Your client talks to your Grafana server. Point it at grafana.sandboxapis.dev instead: same paths, same JSON, same headers, same status codes. No server to create, no seed script.

Grafana has no pinned host yet, so this page uses the live host, grafana.sandboxapis.dev, which re-rolls daily: assert on what a re-roll keeps, and switch to a pin when one is registered.

02 / Run it now

One request, no account.

request.sh
curl -s "https://grafana.sandboxapis.dev/api/search?type=dash-db"

It answers with every dashboard in the data set, one per service, each in its team's folder, in Grafana's own search-hit JSON.

With a real client, the verified quickstart for fetch (Node built-in) runs against the live host on every check. It prints every dashboard's uid (one per service), then the services whose error ratio the Prometheus data source returns for the data set's last 24 hours, one data frame each.

node
const grafana = "https://grafana.sandboxapis.dev";   // the only line that changes
const headers = {
  authorization: "Bearer any-token",                 // any token is accepted
  "content-type": "application/json",
};

const boards = await (await fetch(`${grafana}/api/search?type=dash-db`, { headers })).json();
console.log("dashboards:", boards.map((b) => b.uid).sort().join(", "));

const res = await fetch(`${grafana}/api/ds/query`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    queries: [{ refId: "A", datasource: { uid: "prometheus" }, expr: "service:http_request_errors:ratio" }],
    from: "now-24h",
    to: "now",
  }),
});
const { results } = await res.json();
const services = results.A.frames.map((f) => f.schema.fields[1].labels.service);
console.log("error ratio frames:", services.sort().join(", "));

What it prints always contains dashboards:, svc-pipeline-, error ratio frames: and pipeline-.

03 / Writes

A write gets Grafana's own error shape.

Every host is read-only. A write answers 403 with Grafana's own error body, naming what you tried, so your client's existing error handling meets a shape it knows.

403 · application/json
curl -s -X POST "https://grafana.sandboxapis.dev/api/dashboards/db" -H 'content-type: application/json' -d '{}'

{"message":"This universe is read-only. See what's covered at https://sandboxapis.dev/coverage. (You tried to write through POST /api/dashboards/db.) Tell us what you needed to write: https://sandboxapis.dev/feedback"}

Grafana's own error shape is a bare message object, and it is what this host answers too; the 403 means no client retries the refusal.

04 / Where it stops

Coverage is counted, not claimed.

103 of 181 Grafana read surfaces are served and verified against Grafana's own published spec. A call to one that is not covered returns a 404 with an X-SandboxAPIs-Coverage header, never invented data. The row-by-row list is on the Grafana reference and the coverage page.

Next: read the Grafana quickstart, or run the four-hop walk to watch one incident cross four services.

What this is not

Read this before you rely on it.

SandboxAPIs is read-only: a write returns the provider's own error unless your key has opted in to scratch writes, and those never reach anybody else. Coverage is bounded, and the manifest that says exactly where it stops is public. The data is a simulated company, not yours and not a copy of anybody's. And it reproduces what each vendor documents and publishes, not the vendor's undocumented behaviour, so keep one test against the real service for that.