Monitors with the official Sentry SDKs
Python, Node.js and other Sentry SDKs send check-ins to Belvador with their own crons API; which ones are tested and which are not.
The official Sentry SDKs have a crons API that sends the same check-ins Belvador understands. Point the SDK at your Belvador DSN and use that API as documented by Sentry; no Belvador package is needed.
Which SDKs are tested#
| SDK | Status |
|---|---|
Python sentry-sdk | Tested: a test in this repository runs it against a local Belvador edge and node |
Node.js @sentry/node | Tested the same way |
| Go, PHP, Ruby, Java, .NET | Same protocol, not tested by Belvador. They should work; tell us at hello@belvador.dev if one does not |
The full table, generated from the same source as the tests, is in Capabilities by runtime.
Python#
Set up the SDK as in Python, then decorate the job:
from sentry_sdk.crons import monitor@monitor(monitor_slug="nightly-invoices", monitor_config={"schedule": {"type": "crontab", "value": "0 2 * * *"}, "timezone": "UTC"})def nightly_invoices(): ... # your jobmonitor_config creates the monitor from code on the first check-in (see creating from code). Leave it out to use a monitor created in Belvador. Celery beat tasks can use Sentry's Celery integration with monitor_beat_tasks=True; the check-ins are the same.
Node.js#
Set up the SDK as in Node.js, then wrap the job:
import * as Sentry from "@sentry/node";await Sentry.withMonitor("nightly-invoices", async () => { // Your job.}, { schedule: { type: "crontab", value: "0 2 * * *" }, timezone: "UTC" });Other languages#
Use your SDK's "crons" or "check-in" function with the monitor slug. Two rules keep it working with Belvador:
Send
in_progressat the start andokorerrorwith the same check-in id at the end. A singleokwithout a start works as a heartbeat.Keep
monitor_configwithin Belvador's limits: schedulecrontab(5 fields) orinterval,checkin_margin1–1440,max_runtime1–10080, thresholds 1–720. Amax_runtimeabove 7 days is cut to 7 days like Sentry does; any other value outside these ranges makes Belvador ignore thatmonitor_config— the check-in itself is still recorded.
Without any SDK, use HTTP check-ins.
What Sentry features do not apply#
Belvador receives errors and check-ins only. Performance traces, profiles, replays and logs that a Sentry SDK may send are not stored: your node counts them as unsupported and drops them. Turn them off in the SDK to save bandwidth (traces_sample_rate=0 in Python, tracesSampleRate: 0 in Node.js).
Posts on this topic
All postsSpotted something wrong or missing? Tell us: hello@belvador.dev