@openstatus/health-upstash
v0.1.4
Published
Upstash Redis probe for @openstatus/health
Readme
@openstatus/health-upstash
Redis probe for Upstash for
@openstatus/health. Sends
GET {url}/ping over the REST API with the token as a bearer header, so it
needs no Redis client and runs on every runtime fetch does.
deno add jsr:@openstatus/health jsr:@openstatus/health-upstash
npm install @openstatus/health @openstatus/health-upstashimport { createHealthHandler, readEnv } from "@openstatus/health";
import { upstashProbe } from "@openstatus/health-upstash";
const url = readEnv("UPSTASH_REDIS_REST_URL");
const token = readEnv("UPSTASH_REDIS_REST_TOKEN");
Deno.serve(
createHealthHandler({
probes: [
// the factory validates `url` and `token` at construction, so pass
// placeholders and let `skip` keep the unconfigured check from running.
upstashProbe({
url: url ?? "http://localhost:8079",
token: token ?? "unconfigured",
skip: () => url == null,
}),
],
}),
);url and token are the UPSTASH_REDIS_REST_URL / UPSTASH_REDIS_REST_TOKEN
pair the Upstash console gives you. Like every probe here, this one never
reads the environment itself — pass the values in, and use skip for
environments where Redis is not configured.
upstashProbe({
url,
token,
// optional overrides from the Probe contract
name: "cache",
critical: true,
timeoutMs: 1000,
skip: () => env.CACHE_DISABLED === "true",
});Non-critical by default: a Redis used as a cache degrades the report instead
of taking the service down. Set critical: true when Redis holds sessions or
rate limits that requests cannot proceed without.
About openstatus
openstatus is the open-source uptime monitoring
and status page platform. This package is part of
@openstatus/health, the /health
endpoints behind openstatus's own services, extracted so any JavaScript server
can expose one. Point an
openstatus monitor
at the endpoint and assert on status in the body to be alerted on
degraded before it becomes unhealthy.
Source: github.com/openstatusHQ/health. Issues and PRs welcome.
