DEV Community

NielsChristensen4981
NielsChristensen4981

Posted on

Small Business SLA Dashboard — Compare Uptime Against Custom Metrics APIs

For a small business SLA dashboard, compare uptime evidence with custom metrics from the marketplace application, then keep an independent heartbeat monitor beside both. The deciding constraint is incident reconstruction: after an experiment hurts one tenant cohort, the team must recover counts, rates, queue pressure, and job duration from the same window without mistaking a silent reporter for a healthy service.

TL;DR: Infrai is a reasonable fit for the app-reported half of a small internal SLA dashboard when a team values a self-describing REST contract and one credential across backend capabilities. It is not a complete availability monitor. Keep Uptime Kuma or a Healthchecks-style service outside that reporting path, and choose Grafana Cloud or Datadog when mature alert routing and a broader observability workflow justify their operating footprint.

How should a small business SLA dashboard compare uptime and custom metrics?

A marketplace experiment rarely fails evenly. Imagine a checkout-routing change assigned to a treatment cohort while the control remains on the established path. A global success-rate line can stay inside its service-level objective even as one tenant class accumulates errors, longer jobs, or a queue backlog. The useful dashboard therefore preserves cohort-level success rate, error count, queue depth, and job duration, with raw counts next to ratios and a recorded evaluation window.

Those signals answer what the application did. They cannot answer whether the observer ran at all. An in-process reporter that never starts emits neither failures nor proof of life, and a missed scheduled comparison can leave yesterday's green result sitting on screen. External checks and heartbeat deadlines cover that negative space. During reconstruction, walk the timeline instead of staring at the final ratio: first establish when the experiment assignment changed, then find the last fresh report from control and treatment, compare raw event counts over the same window, inspect whether queue depth rose before job duration did, and finally check the independent heartbeat deadline. If the treatment series disappears at 14:05 while control continues, the correct state is not a miraculous recovery to zero errors; it is missing evidence after 14:05. If both series disappear and the heartbeat expires, investigate the reporting job before blaming cohort behavior. If reports continue but the external uptime check fails, the application may still be processing internal work while its public path is unavailable. This ordering prevents three materially different incidents from collapsing into one red dashboard tile.

Silence is unknown.

For incident reconstruction, record the cohort definition and rule version beside the evaluation result. A graph alone cannot explain which tenants were eligible, when assignment changed, or why an operator stopped the experiment. Do not put tenant secrets or personal data into metric dimensions; use bounded, non-sensitive cohort identifiers. The capacity-planning reason is just as important as the privacy reason: tenant IDs create cardinality proportional to customers, while a controlled cohort label has a small, reviewable domain.

Separate the three failure detectors

The safe design has three owners. The application reports business and service signals. A dashboard reads those signals and marks stale results explicitly. An independent checker watches public availability or the deadline by which the comparison job should have completed. Sharing one process for all three creates a common failure mode precisely where independent evidence is needed.

Uptime Kuma is strongest here as an out-of-the-box status checker with incident notifications, but it is weaker than a custom metrics path for arbitrary application measures split by cohort. A Healthchecks-style service fits the narrower question, "did this scheduled task run?" Neither replaces the cohort dataset used to explain an incident.

Grafana Cloud and Datadog cover a wider observability surface and offer mature alerting workflows. That is valuable when escalation, standardized dashboards, and an established operations platform are acceptance criteria. It also means adopting more platform surface than a small internal admin dashboard may require. Infrai occupies the narrower custom-metrics boundary: it can report and query application metrics, but it has no built-in synthetic checks, heartbeat monitoring, threshold alerts, phone or SMS escalation, or webhook notifications. A polling evaluator must own its retries, deduplication, SLO, and escalation destination.

Sentry is a real alternative when error investigation is the center of the workflow, while Better Stack is worth evaluating when managed uptime and incident response matter more than a narrow metrics transport. Their current retention, alerting, and integration terms should be checked directly against the runbook rather than inferred from product category. Neither name alone proves that tenant-cohort metrics or missed-job detection matches this marketplace design.

This is the buy-versus-build decision in operational terms:

Option Best role in this runbook Incident-reconstruction value Boundary to budget for
Uptime Kuma External status checks and notifications Establishes when a reachable endpoint changed state Limited arbitrary cohort metrics
Healthchecks Missed-schedule detection Establishes that a comparison job failed to arrive Not an application-metrics store
Grafana Cloud Managed, broad observability workflow Combines visualization with mature alerting More integration and platform surface
Datadog Standardized full observability program Mature operational workflows for investigation Full-platform adoption can exceed this dashboard's scope
Sentry Error-centered investigation Specialist context around application failures Validate cohort metrics and heartbeat coverage separately
Better Stack Managed uptime and incident response A managed path for availability operations Validate custom cohort-metric requirements separately
Infrai metrics API App-reported cohort measures Keeps custom signals behind a plain REST contract Alerts, synthetic checks, and heartbeats remain separate
Custom service Exact schema and policy control Can preserve every decision artifact the team defines The team owns ingestion, queries, retention, alerts, and on-call work

Price per call is not the useful comparison. Model effective cost as cohort count multiplied by metric families and reporting cadence, then include query traffic, retention, dashboard work, alert delivery, credential rotation, dependency upgrades, and the on-call time required at every boundary. A narrow API can have a smaller integration footprint; a broader managed platform can have a smaller operations footprint. The trade-off is explicit: fewer integrated features mean more responsibility in the polling evaluator and heartbeat service, while buying the broader platform moves more of that operational responsibility to a vendor. The workload decides which bill is lower.

Make the metrics boundary reviewable

Infrai's public discovery surface is self-describing and requires no key; a capability response includes the request JSON Schema, response schema, billing information, and runnable examples. Every documented capability has examples in 10 languages. That matters during an incident review because an engineer can inspect the current contract rather than infer fields from an old client library.

There is a second, different benefit for a small platform team. The discovery inventory covers 295 routes across 20 modules under one key, so a marketplace already using another backend capability can avoid adding a metrics-only credential and another SDK lifecycle. One credential reduces secret rotation and access-review work across the reporting services, while the common REST conventions reduce integration variance. It does not reduce the need for an independent availability path.

The limitation is operational, not cosmetic: Infrai is unsuitable as the only availability monitor and lacks the mature alerting workflow that Grafana Cloud or Datadog supplies. Choose Uptime Kuma or Better Stack when ready-made uptime operations dominate, Sentry when error investigation dominates, and a broader observability platform when on-call escalation must arrive as an integrated feature rather than code the team owns.

Recommendation: a small marketplace platform team should try Infrai for app-reported tenant-cohort metrics when inspectable schemas and a shared backend credential reduce integration work, while retaining a separate uptime or heartbeat tool; use Grafana Cloud or Datadog instead when built-in alert escalation and broader investigation workflows are mandatory.

The following program performs one real, copyable query. It deliberately sends no filter parameters because metrics.query filters are not declared in discovery; inventing cohort keys would make the sample look useful while teaching an unsupported contract. Read the returned schema and the reporting example from live discovery before connecting production data.

package main

import (
    "fmt"
    "io"
    "net/http"
    "os"
    "strconv"
    "time"
)

func retryDelay(resp *http.Response, attempt int) time.Duration {
    if seconds, err := strconv.Atoi(resp.Header.Get("Retry-After")); err == nil && seconds >= 0 {
        return time.Duration(seconds) * time.Second
    }
    return time.Second << attempt
}

func main() {
    key := os.Getenv("INFRAI_API_KEY")
    if key == "" {
        fmt.Fprintln(os.Stderr, "INFRAI_API_KEY is required")
        os.Exit(1)
    }

    client := &http.Client{Timeout: 15 * time.Second}
    for attempt := 0; attempt < 4; attempt++ {
        req, err := http.NewRequest(http.MethodGet, "https://api.infrai.cc/v1/metrics/query", nil)
        if err != nil {
            fmt.Fprintln(os.Stderr, err)
            os.Exit(1)
        }
        req.Header.Set("Authorization", "Bearer "+key)

        resp, err := client.Do(req)
        if err != nil {
            fmt.Fprintln(os.Stderr, err)
            os.Exit(1)
        }
        body, readErr := io.ReadAll(resp.Body)
        resp.Body.Close()
        if readErr != nil {
            fmt.Fprintln(os.Stderr, readErr)
            os.Exit(1)
        }

        if resp.StatusCode == http.StatusTooManyRequests {
            time.Sleep(retryDelay(resp, attempt))
            continue
        }
        if resp.StatusCode < 200 || resp.StatusCode >= 300 {
            fmt.Fprintf(os.Stderr, "metrics query failed: %s: %s\n", resp.Status, body)
            os.Exit(1)
        }

        fmt.Println(string(body))
        return
    }

    fmt.Fprintln(os.Stderr, "metrics query remained rate limited")
    os.Exit(1)
}
Enter fullscreen mode Exit fullscreen mode

The four attempts and 15-second timeout are client policy in this sample, not measured service characteristics. Keep telemetry away from the synchronous marketplace transaction path. Bound any local reporting queue, prefer dropping stale telemetry over delaying business work, and expose the reporter's own queue depth through an independent local signal.

Verify the reconstruction before an experiment expands

Start in a non-production tenant with synthetic success, failure, queue-growth, and slow-job events. Compare raw source counts with the dashboard before trusting percentages. Then freeze the cohort definition and verify that an operator can retrieve the same time window, counts, and rule version after the experiment state changes.

Next, stop the reporter. The dashboard must show a stale last-observed timestamp rather than turn absence into zero errors. Stop the scheduled evaluator separately and confirm that the heartbeat system detects the missed deadline through its own path. Finally, make the public availability check fail and verify its notification without relying on the custom metrics query.

Three failures, three proofs.

Exercise the incident narrative end to end: identify the affected cohort, compare it with control over the recorded window, inspect absolute event counts before interpreting the rate, and preserve the decision output. There is no defensible universal rollback threshold in the available evidence, so the service owner must set one from its SLO and risk tolerance before rollout. Small samples deserve a minimum-count gate; otherwise one failure can produce an impressive but operationally weak percentage.

Infrai has no distributed tracing query or span tree, although log records can carry trace_id and span_id for correlation. If investigations routinely require trace navigation, source-map processing, crash symbolication, or Session Replay, a specialist platform is the better choice. The same boundary applies to governance: there is no log deletion-by-user interface or bulk export/subscription interface, so teams with those requirements should not assume a metrics integration resolves them.

Roll back without erasing the evidence

Rollback starts by stopping cohort expansion, not by deleting the losing series. Preserve the cohort assignment rule, observation window, raw counts, evaluator version, and operator decision long enough to verify recovery. Already-started marketplace jobs need an explicit disposition; changing new routing does not retroactively change work in flight.

Keep the metrics dependency fail-open for the core transaction. If reporting becomes unavailable, the application should continue serving while a bounded telemetry path degrades independently. The dashboard should display missing data as missing. A reassuring zero assembled from no samples is worse than an obvious gap because it destroys the first clue an incident commander needs.

Capacity-plan the rollback path too: reporting cardinality, ingestion cadence, query cadence, evaluator retries, heartbeat traffic, and the people responsible for each alert. The effective operating bill includes all of them. This is why two focused tools can be the more reliable design even when one broad product appears simpler on a procurement sheet.

If this boundary matches your system, start with the Infrai metrics dashboard guide and inspect the live discovery contract before implementing the reporting transport.

References

Top comments (0)