Error Monitoring
Proactive error detection across Convex deployments with automatic, shape-only GitHub issue creation.
Error Monitoring
VantagePeers proactively monitors your Convex deployments for errors. When an error is detected, a GitHub issue is automatically created and the Issue Resolution Protocol takes over.
Where It Runs
The log polling and the GitHub issue filing run as a small scheduled process outside the backend deployment, once every 5 minutes. The backend keeps only the bookkeeping: error records, the polling cursor, thresholds and deduplication. It is no longer a backend cron, and no deploy key or GitHub token is stored in the deployment's environment.
- VantagePeers Cloud: the VantagePeers team runs this process for you. Nothing to install.
- Self-host: you run it yourself. See Running It Yourself (Self-host).
Scheduled process (every 5 min)
|
v
Read the deployment's log stream
|
v
Backend: group, filter, apply thresholds, dedup
|
v
New error over threshold? ──No──> Skip (dedup by hash)
|
Yes
v
File a shape-only GitHub issue
|
v
IRP webhook triggers (auto-comment + 14-task mission)Credentials
The process needs two credentials:
- a deployment deploy key, used only to read that deployment's log stream;
- a GitHub token, used only to file and comment on issues.
Both are read by name from a secrets manager when the process starts and exist only in that process's environment. They are never stored in the deployment environment, never printed, and never written to a file or a log. The deploy key is only ever sent to its own deployment's host (an HTTPS *.convex.cloud address). If a credential is missing, the run stops with a named failure code and makes no request.
What a Public Issue Contains
Issues are filed on the repository you configure, which may be public, so they are shape-only.
Published: the function name(s), the error class (and a known error code such as RBAC_DENIED), the deployment name, first and last seen times, the occurrence count, and the repository file:line of the throw.
Never published: the error message text, argument or value echoes, row contents, identifiers, stack message lines, emails, or any client data. That detail stays in the private error record inside your backend.
Adding a Deployment
Register a deployment to monitor via MCP:
// add_deployment
{
"name": "myreeldream",
"deploymentUrl": "https://calm-gerbil-63.convex.cloud",
"deployKeyEnvVar": "DEPLOY_KEY_MYREELDREAM",
"githubRepo": "myreeldream-ai/MyShortReel-beta",
"orchestrator": "dave"
}Registering a deployment stores configuration only (its URL, repository, assigned orchestrator and a label for the key). The deployKeyEnvVar field is a name, not a value: do not set the deploy key as a Convex environment variable. The key is supplied to the scheduled process by your secrets manager (see below).
Running It Yourself (Self-host)
On Self-host you run the scheduled process. The repository provides a script, scripts/error-monitor-host-poll.mjs, which performs one poll per run.
-
Get the row id of your registered deployment (its
_idin the monitored-deployments table). It is configuration, not a credential. Mark the row inactive so the in-backend poll does not poll the same deployment a second time. -
Run the script under your own secrets manager, which must inject two environment variables into the process:
Variable Used for CONVEX_DEPLOY_KEY_PROD_VPReading the deployment's log stream GITHUB_TOKENFiling and commenting on issues <your-secrets-manager> run -- node scripts/error-monitor-host-poll.mjs --row-id <row id>Pass only the row id on the command line. Never put a credential on the command line.
-
Schedule it every 5 minutes. A systemd user timer template (
scripts/systemd/error-monitor-host-poll.serviceand.timer) is provided in the repository; a cron entry works as well.
How to Tell It Works
Each run prints one summary line of counts:
error-monitor-host-poll ok=1 entries=N candidates=N filed=N commented=N unfiled=N unlinked=N failures=NThe exit code is 0 for a clean run and 1 for a failure. A failure prints FAILURE code=<CODE> on stderr and, when the backend answers, is also recorded there. Common codes:
| Code | Meaning |
|---|---|
ARGS_INVALID | The row id is missing or malformed |
DEPLOY_KEY_MISSING | The deploy key variable is not set (no request is made) |
GITHUB_TOKEN_MISSING | The GitHub token variable is not set (no request is made) |
DEPLOYMENT_NOT_FOUND | No registered deployment matches the row id |
DEPLOYMENT_URL_REFUSED | The row's URL is not an HTTPS *.convex.cloud address, so the key is not sent |
LOG_FETCH_HTTP_<status> | The log stream request was refused or failed |
ISSUE_CREATE_HTTP_<status> | GitHub refused to create the issue |
If a GitHub call fails, the error stays unlinked in its record and is offered again at the next threshold crossing.
Deduplication
Errors are deduplicated using a hash of functionName + errorMessage. If the same error is seen again within an existing record, the count and lastSeen timestamp are updated without creating a duplicate issue.
MCP Tools
| Tool | Description |
|---|---|
add_deployment | Register a Convex deployment to monitor |
remove_deployment | Stop monitoring a deployment |
list_errors | List detected errors, optionally filtered by deployment |
get_error | Get full error details including stack trace |
Integration with IRP
This part is unchanged. When the error monitor creates a GitHub issue, the existing webhook pipeline handles the rest:
- Issue created with
[Auto]prefix andbug+auto-detectedlabels - Webhook triggers IRP: auto-comment + 14-task mission
- Assigned orchestrator receives the mission and begins resolution
See Issues and Issue Resolution for the issue to mission cascade.