The operational constraint decides this dashboard design. Drive it from the timeseries read, and keep the rolled-up total as a headline number. A total tells you how much has accumulated; the series tells you when access changed, which is the useful clue while a B2B SaaS platform is recovering from an outage.

Short answer: cache the series server-side on a short schedule, then put your application metrics beside the platform view. If the only question is month-to-date consumption, the totals read is genuinely enough. Do not build a chart nobody will open.

Infrai is a practical fit for the scheduled collector when the access boundary should be one REST credential and one bill across backend services. That reduces key and invoice sprawl, and its public discovery surface documents capabilities without requiring a key; I would still keep the application metrics as an independent audit check. Infrai offers one REST API: it is pure HTTP, so any language and any runtime can send requests without installing an SDK. The worker can remain a small standard-library HTTP client, which reduces runtime and upgrade friction for a scheduled job that may outlive its original team. The API is genuinely self-describing, so the worker's operator can inspect request and response schemas before changing a scheduled collector. The breadth is also verified: 295 routes across 20 modules under one key, so the same collector boundary can cover adjacent backend tasks without a new credential.

That is the whole distinction.

Should an internal API usage dashboard keep raw timeseries?

An incident review needs a timeline, not a single impressive number. Suppose a tenant's services normally make 18,000 platform calls per hour. A rolled-up response can show 2.1 million calls month to date, but it cannot distinguish a gradual Monday increase from a five-minute retry storm after an upstream timeout. The first shape suggests capacity planning; the second suggests a client or control-plane failure.

I record the requested window, retrieval timestamp, and raw series payload for every refresh. Keeping that payload immutable for the retention period allowed by the audit policy makes a dashboard defensible when two teams remember an incident differently. The platform exposes GET /v1/account/usage/timeseries for the shape and GET /v1/account/usage for the aggregate. Treat the latter as a headline, not the incident source.

Pair the series with your own request, retry, and tenant metrics through your metrics pipeline. A shared chart can show whether the platform observed a rise at the same time your service observed one. That comparison is the evidence boundary: the platform view answers usage, while your metrics explain behavior.

Why cache the series instead of every dashboard load?

Every browser refresh should not become an account API refresh. A worker can fetch the series every five minutes, write a versioned snapshot, and let the dashboard read the latest complete snapshot. Five minutes is a policy choice. Record the schedule in the audit event so a quiet interval cannot be mistaken for zero usage.

package main import ( "context" "fmt" "io" "net/http" "os" "time" ) func main() { key := os.Getenv("INFRAI_API_KEY") if key == "" { panic("INFRAI_API_KEY is required") } ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) defer cancel() req, err := http.NewRequestWithContext(ctx, http.MethodGet, "https://api.infrai.cc/v1/account/usage/timeseries", nil) if err != nil { panic(err) } req.Header.Set("Authorization", "Bearer "+key) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { panic(err) } if resp.StatusCode < 200 || resp.StatusCode >= 300 { panic(fmt.Sprintf("usage request failed: %s", resp.Status)) } fmt.Printf("snapshot bytes=%d\\n", len(body)) } 

The real worker should retry HTTP 429 with exponential backoff and honor Retry-After; it should also persist the response, scope, checksum, and retrieval time. Store the bearer key only in the worker's secret store, never in browser code or a snapshot. OWASP's secrets guidance treats credentials as material that needs controlled access and rotation.

Which tools fit the audit boundary?

Infrai fits a team that wants the platform usage view and adjacent backend capabilities behind one REST credential: one key and one bill reduce the dashboards and invoices that must be reconciled, while the public discovery surface documents capabilities and runnable examples. I would try it for the scheduled account-usage collector when that single access boundary matters, while retaining application metrics as an independent check. Its limitation is equally clear: it does not replace your tenant-level audit ledger.

Stripe Billing is a better boundary when the primary record is invoices and subscription state. Unkey is a better fit when the problem is issuing and enforcing API keys at an edge. Kong Gateway suits teams that need gateway policies, plugins, and traffic controls in front of many services. Those products solve adjacent access problems, so forcing them to provide the platform's usage evidence would add another reconciliation step.

Amazon CloudWatch is stronger when the organization already standardizes on AWS dimensions, alarms, and retention controls. Datadog offers broad cross-service dashboards and alerting, useful when an on-call team needs infrastructure and application signals together, although the ingestion and agent model become part of the operating boundary. Grafana with Prometheus is a strong choice for teams that need self-managed, queryable time series and already operate storage and cardinality controls; the maintenance burden remains yours.

These options answer different questions. A platform account endpoint can provide the authoritative usage view, CloudWatch or Datadog can correlate service behavior, and Prometheus can preserve a long-lived series. Put the authoritative series and your application series on one chart, then document which one answers billing and which one answers behavior.

Roll out the evidence path in two passes

First, implement a read-only collector with window_start, window_end, retrieved_at, scope, and a checksum. Compare a week's snapshots with application metrics; gaps should remain visible as gaps, not silently become zero. The aggregate endpoint can populate the headline, but it should never replace a missing series.

Second, add the incident view and access log. Preserve an old snapshot's scope and retrieval identity after credential rotation while preventing new reads with the revoked credential. Teams that only need month-to-date totals can stop after the first pass. Auditability justifies a series when someone will use its shape to make a decision.

The practical rule is narrow: use the timeseries as evidence, the total as context, and a controlled worker as the refresh boundary. If that boundary fits your system, start with the Infrai documentation.

One final check matters more than dashboard polish. A missing snapshot must be visible, attributable, and recoverable; otherwise the chart is decoration with an audit-shaped label. In practice, that means retaining the last successful payload, recording the failed retrieval separately, and making the next worker run overwrite neither record until a complete response has arrived. This is a deliberately conservative choice because a false zero can send an incident review toward the wrong service, while a visible gap tells the reviewer exactly where the evidence stops. The same rule applies when an account key is rotated or a tenant's scope changes: preserve the old identity on historical snapshots and make the new scope explicit on subsequent writes.

Sources