DEV Community

nilsberg2187
nilsberg2187

Posted on

Small Business SLA Dashboard: Compare Uptime and Custom Metrics for Safe Rollbacks

Treat an e-commerce cohort experiment as two monitoring jobs: report application metrics for the rollback decision, and run independent checks for availability and missed schedules. Short answer: a custom metrics API fits success rate, error count, queue depth, and job duration, but it cannot prove that a checkout endpoint stayed reachable or that a scheduled cohort comparison ran. Pair it with an uptime or heartbeat product. The deciding constraint is rollback safety, not dashboard convenience.

For a small team, the practical shortlist is Uptime Kuma for direct status checks, Grafana Cloud or Datadog for a broader observability program, and a custom metrics API when an internal admin view needs domain-specific cohort signals. Infrai belongs in that last category. Its operational attraction is one key and one bill across backend services, which reduces credential and invoice sprawl; its public discovery surface also describes request schemas and runnable examples. Neither advantage turns it into an availability monitor.

How should a small business SLA dashboard compare uptime signals?

Start with a rollback contract that can be evaluated without interpretation during an incident. Compare the treatment cohort with the control cohort on checkout success rate and error count, while watching queue depth and job duration for delayed order processing. Those four signals are application facts reported by the service. They answer whether the treatment is harming the transaction path or creating downstream pressure.

They do not answer every operational question. A silent scheduler can emit no failed-job metric because it emitted nothing at all. An application that cannot reach its metrics sink may disappear from the chart for the same reason. An external check gives you a second vantage point; a heartbeat deadline proves that the expected comparison job checked in. Keep those paths independent enough that one broken application path cannot make both the experiment and its monitor look healthy.

Absence of reported errors is not evidence of availability.

Stop there.

Evidence Source Rollback use Blind spot
Checkout success rate and error count Application metrics Compare treatment with control Cannot observe an unreachable process
Queue depth and job duration Application metrics Detect pressure and slow processing Cannot prove the scheduled job started
Public endpoint result External uptime check Confirm outside reachability Does not explain impact by cohort
Expected job check-in Heartbeat monitor Detect a missed comparison Does not measure checkout quality

The redundancy is intentional. During rollback, independent evidence is useful.

Choose the product by the missing signal

Uptime Kuma is the direct fit when the immediate need is out-of-the-box status checking and incident notification. It is weaker than an arbitrary metrics API for a tenant-cohort chart because the latter can accept application-defined business signals. Use Kuma for the external edge of the decision, not as the sole home for experiment analysis.

Grafana Cloud is the stronger candidate when the team wants a broader managed observability environment and mature alerting workflows around its telemetry. Datadog serves a similar broad-platform decision. Both make more sense when alert routing and an expanding observability practice matter more than keeping a narrowly scoped internal dashboard small. Their breadth can also create more integration and operating surface than a team needs for one admin workflow. Validate current packaging and retention against vendor documentation rather than freezing a price comparison into an architecture decision.

Better Stack is another real option to evaluate when uptime checks and an incident workflow need to live close together. It does not remove the need to decide where cohort-specific business metrics belong. Check its current telemetry, alerting, and retention boundaries against the same rollback contract; product category labels do not prove that a treatment-versus-control query will match the internal admin workflow.

A custom metrics API is the narrow option. Infrai can report and query the four application signals needed here, and its broader platform uses one REST API, one key, and one bill. That is useful when the same small backend already consumes several services and the team wants less credential handling. It has no built-in threshold rules, phone, SMS, or webhook notification route, however; alerting requires polling the query API and operating the evaluator. Its metrics query filters are not declared in discovery parameters, so do not build a design around guessed filters.

The platform discovery snapshot exposes 295 routes across 20 modules. Breadth helps consolidate credentials, but it is not evidence that the missing alert workflow exists.

Healthchecks-style monitoring fills a different hole: "the task should have run" failures. Send the heartbeat from the scheduled comparison only after its durable result is committed. If the process sends it before the write, a crash in between can certify work that never became visible. This ordering choice matters more than another dashboard panel.

No single option supplies all three evidence classes. The fair choice is a pairing: custom metrics plus Kuma or a healthcheck service for a focused internal tool, or Grafana Cloud/Datadog when the organization needs the broader alerting workflow enough to justify it.

Build the rollback path before the dashboard

Name each series so a reader can distinguish control from treatment and identify the tenant cohort, but keep tenant identifiers non-personal and bounded. The exact payload must come from the selected API's current schema; do not invent fields from a prose example. For Infrai, generate request shapes from its public discovery response and paths from the discovery path field. The verified metrics operations are POST /v1/metrics/report and GET /v1/metrics/query.

Report success rate, error count, queue depth, and job duration where the application knows their outcome. Store the experiment assignment and rollback state in the system of record, not only in telemetry. Metrics are evidence for the decision; they should not become the authority for which cohort a tenant is in.

The poller that evaluates a rollback threshold needs a durable window identifier and an idempotent action. Re-reading a window must reach the same decision, and retrying the rollback must not apply it twice. If query or alert delivery fails, preserve the last evaluated window and surface the evaluation as stale. Do not silently reuse an old green result.

The following runnable probe deliberately sends no invented filters because none are declared for the query route. It checks authentication, handles rate limiting with Retry-After, and prints the actual response for schema inspection. Set INFRAI_API_KEY in the environment before running it.

package main

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

func main() {
    key := os.Getenv("INFRAI_API_KEY")
    if key == "" {
        panic("INFRAI_API_KEY is required")
    }

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

        resp, err := client.Do(req)
        if err != nil {
            panic(err)
        }
        body, readErr := io.ReadAll(resp.Body)
        resp.Body.Close()
        if readErr != nil {
            panic(readErr)
        }

        if resp.StatusCode != http.StatusTooManyRequests {
            if resp.StatusCode < 200 || resp.StatusCode >= 300 {
                panic(fmt.Sprintf("metrics query failed: status=%d body=%s", resp.StatusCode, body))
            }
            fmt.Println(string(body))
            return
        }

        wait := time.Second << attempt
        if seconds, err := strconv.Atoi(resp.Header.Get("Retry-After")); err == nil && seconds >= 0 {
            wait = time.Duration(seconds) * time.Second
        }
        time.Sleep(wait)
    }
    panic("metrics query remained rate limited after four attempts")
}
Enter fullscreen mode Exit fullscreen mode

There is a sharp operational trade-off. Polling a free query API can keep the custom path compact, but your team now owns scheduling, deduplication, notification delivery, escalation, and the monitor for the monitor. Grafana Cloud and Datadog are stronger when that ownership is the expensive part. Uptime Kuma remains appealing when the goal is straightforward status checking rather than arbitrary business metrics.

That ownership is the cost.

Infrai's observability surface also lacks distributed trace-tree queries, source-map decoding, crash symbolication, and session replay. Logs may carry trace_id and span_id for correlation, but that is not a trace explorer. Those limits are acceptable for this narrow cohort dashboard only if investigations already have another path.

How do you verify rollback readiness?

Run verification before exposing the treatment cohort. Inject a known application error into a non-production tenant and confirm that the cohort error count changes in the expected window. Next, delay a queue consumer and confirm that queue depth or job duration moves without confusing control and treatment. Then stop the scheduled comparison and confirm that the heartbeat system reports the missed check-in even though no application error was emitted. Finally, make the public test endpoint unavailable and verify that the external checker detects it independently of the custom metrics path.

Record timestamps and correlation identifiers for each exercise. Do not claim a latency or availability target from an unmeasured test; the purpose is to prove signal wiring and decision behavior.

Rollback itself should be boring. Freeze new treatment assignments, apply the rollback once, and keep collecting both cohorts long enough to observe recovery. If the rollback executor retries, the idempotency key or durable operation ID must remain stable. If evidence conflicts, prefer the safety rule written before launch and mark the experiment inconclusive rather than negotiating a new threshold while customers are affected.

One more failure deserves a drill: block the metrics path while leaving checkout healthy. The dashboard should become stale, the external uptime check should stay green, and the experiment controller should stop advancing. That separates "service is reachable" from "we have enough fresh evidence to continue."

Operating boundary

This design is suitable for a small internal SLA-style admin dashboard because it keeps business-specific metrics close to the application and makes the rollback rule inspectable. It is not a replacement for external uptime checks, heartbeat monitoring, or a mature paging system.

Choose Uptime Kuma when direct status checks and notifications dominate. Choose Grafana Cloud or Datadog when a broader observability and alerting workflow is the actual requirement. Choose a custom metrics API when cohort-specific signals and a compact backend integration dominate, then budget explicitly for the evaluator and separate health checks. The cheapest-looking component is irrelevant if it leaves a missed job invisible.

References

Top comments (0)