What is Better Stack?
Better Stack is an observability platform with its own cloud. It checks your sites and APIs from outside and opens an incident when one fails, pages whoever is on call, and publishes the outage on a status page. It stores your logs and metrics and draws them on dashboards, and it collects your exceptions through the Sentry protocol. Better Stack Cloud rents servers, networks, volumes and managed databases to run the things being watched.
Take one small app: an API running as a Service on a Cloud server, an uptime monitor checking its /health, a status page showing that monitor, a telemetry source receiving the API’s logs, and an error-tracking application receiving its exceptions. Everything lives in one team. The server sits in one availability zone; everything else belongs to the team, wherever it runs.
- ApiUpchecks →Api
- status.example.comshows →ApiUp
- Apiships logs →Logs
- Apireports →Errors
A team holds everything you create in Better Stack: monitors, heartbeats, on-call schedules, status pages, telemetry sources, dashboards, error-tracking applications and Cloud servers. A team’s id looks like t123 and appears in Better Stack’s URLs. An organization can have several teams.
Every team-scoped resource takes a teamId. Leave it out and the resource goes to the team your credentials select. Changing it replaces the resource.
export const Health = BetterStack.Incidents.Monitor("Health", { url: "https://api.example.com/health", monitorType: "status", teamId: "t123",});API tokens
Section titled “API tokens”An API token is how Alchemy reaches your team. A global API token works with every product and can reach several teams, so you pick one with a team id. A team API token works with only the product it was created for: an Incidents token with uptime monitoring, on-call, status pages and team members; a Telemetry token with sources, collectors, dashboards, metrics and error tracking; a Cloud token with Cloud’s servers, networking, storage, managed services and Kubernetes (Better Stack’s provider docs).
Store one in a profile once, in Setup.
The five APIs
Section titled “The five APIs”Better Stack exposes each product through its own API, and the provider is split the same way into five namespaces:
| Namespace | API | What it manages |
|---|---|---|
Incidents |
uptime.betterstack.com |
monitors, heartbeats, on-call, escalation, severities, status pages, alert integrations |
Telemetry |
telemetry.betterstack.com |
sources, collectors, dashboards, alerts, explorations, extracted metrics |
Errors |
errors.betterstack.com |
applications, releases, issue-tracker integrations |
Cloud |
<zone>.betterstackcloud.com |
servers, Services, volumes, networks, firewalls, load balancers, managed databases, Kubernetes |
Account |
betterstack.com |
teams and team members |
Resource type ids follow the namespace: BetterStack.Incidents.Monitor, BetterStack.Cloud.Server.
Availability zones
Section titled “Availability zones”Better Stack Cloud runs in availability zones, such as us-west-2a, and each zone has its own API host. A Cloud resource lives in one zone: set availabilityZone on it, or a default zone in your profile. Changing the zone replaces the resource. Monitors, sources and the other non-Cloud resources have no zone.
export const Box = BetterStack.Cloud.Server("Box", { serverType: "AM1", image: "ubuntu-26-04", availabilityZone: "us-west-2a",});Monitors and incidents
Section titled “Monitors and incidents”A monitor checks a URL, host or port on a schedule, from outside, and opens an incident when the check fails: HTTP status and keyword checks, ping, TCP and UDP, mail ports, DNS, and Playwright scenarios.
export const ApiUp = BetterStack.Incidents.Monitor("ApiUp", { url: "https://api.example.com/health", monitorType: "status", checkFrequency: 60,});A heartbeat works the other way round: your job calls its secret URL, and Better Stack opens an incident when the calls stop.
export const NightlyBackup = BetterStack.Incidents.Heartbeat("NightlyBackup", { period: 86400, grace: 3600,});See Monitors and Heartbeats.
On-call and escalation
Section titled “On-call and escalation”An incident notifies people. An on-call schedule says who is on call when, an escalation policy says who is notified next if nobody acknowledges, and severities decide how loudly. Alert integrations let incidents come in from other tools (Datadog, Grafana, Prometheus, CloudWatch, email, webhooks) and go out to others (PagerDuty, webhooks, email).
See On-call schedules and Integrations.
Status pages
Section titled “Status pages”A status page is a page for your users that shows the current status of your monitors and heartbeats, grouped into sections.
See Status pages.
Telemetry
Section titled “Telemetry”A source is where logs, metrics and traces go in. It has an ingest token that can only write into that one source, and the host to send to. Collectors gather data from your hosts and clusters for you, dashboards chart it, and alerts watch a query and notify you.
export const Logs = BetterStack.Telemetry.Source("Logs", { platform: "http" });See Sources & ingest and Dashboards.
Error tracking
Section titled “Error tracking”An error-tracking application receives exceptions over the Sentry protocol: you configure the official Sentry SDK for your platform with the application’s DSN. A release marks a version, so errors can be told apart by the code that raised them.
export const Errors = BetterStack.Errors.Application("Errors", { platform: "node_errors" });See Applications.
Better Stack Cloud
Section titled “Better Stack Cloud”A Cloud server is a virtual machine in one zone. Around it Better Stack Cloud offers volumes, private networks, firewalls, load balancers, certificates, reserved IPs, managed Postgres, MySQL, ClickHouse, Kafka and Valkey (Managed databases), Kubernetes clusters and an object cache. In Alchemy, a Service is your Effect program running on a server as a systemd unit.
State: where Alchemy keeps its record
Section titled “State: where Alchemy keeps its record”Better Stack has no storage for Alchemy’s own record of what each Stack created. Keep it on disk with Alchemy.localState(), or share it with your team and CI through another provider’s state store, such as Cloudflare.state(). See State Store.
How betterstack-alchemy models these concepts
Section titled “How betterstack-alchemy models these concepts”Each concept is something your Stack declares. Your profile’s token picks what Alchemy can reach and your team id picks where it goes; BetterStack.providers() deploys into it. Monitors, heartbeats, schedules, status pages, sources, dashboards, applications and servers are resources in the namespace of their API. A Service is your program on a server, deployed over SSH and run by systemd, and it can be wired to the source, monitor, heartbeat and application that watch it in the same Stack.
Next, build one: the tutorial puts these ideas to work, one step at a time.