convex-sentinel

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- GENERATED from convex-agents content/capabilities/sentinel.json — do not edit by hand. -->
<!-- GENERATED from convex-agents content/capabilities/sentinel.json — do not edit by hand. -->

Capture production errors in your own deployment

在自有部署中捕获生产环境错误

Install
@convex-dev/sentinel
to capture production errors (server function failures, client JS/React crashes, OCC and scale signals) into a table in the user's OWN deployment, redacted at write time, then react to new ones. Data never leaves the user's deployment.
安装
@convex-dev/sentinel
以将生产环境错误(服务器函数失败、客户端JS/React崩溃、OCC和扩容信号)捕获到用户自有部署的数据库表中,写入时自动脱敏,之后可对新错误做出响应。数据永远不会离开用户的部署环境。

Workflow

工作流程

  1. Install the component:
    app.use(sentinel)
    in
    convex/convex.config.ts
    .
  2. Wire the client SDK: a React error boundary plus
    window.onerror
    /
    unhandledrejection
    and breadcrumbs.
  3. Redaction runs at write time and is on by default (default-deny on secret key names and value patterns).
  4. Read recent errors with the Convex CLI (
    convex data
    ,
    run-once-query
    ); react to new ones via the monitor's
    prod_error
    event.
  5. Optionally enable the self-healing cron:
    triage
    classifies each error and, for recurring non-transient ones, hands it to ai-runner to open a fix PR.
  1. 安装组件:在
    convex/convex.config.ts
    中添加
    app.use(sentinel)
  2. 接入客户端SDK:配置React错误边界,加上
    window.onerror
    /
    unhandledrejection
    监听和面包屑追踪。
  3. 脱敏在写入时自动执行且默认开启(默认拒绝存储包含敏感密钥名称和特定值模式的数据)。
  4. 使用Convex CLI(
    convex data
    run-once-query
    )查看近期错误;通过监控器的
    prod_error
    事件对新错误做出响应。
  5. 可选启用自愈定时任务:
    triage
    会对每个错误进行分类,对于重复出现的非临时性错误,将其交给ai-runner来创建修复PR。

Rules

规则

  • Redaction is mandatory and on by default — never store raw secrets; the agent's reads reach the model provider.
  • Data stays in the user's deployment; never send it to a third party.
  • Sample and cap to control volume and cost.
  • Capturing PROD errors needs a deployed cloud app (Tier 2); install works anonymously.
  • 脱敏是强制要求且默认开启——绝不存储原始敏感信息;Agent的读取操作仅会发送至模型提供商。
  • 数据始终保留在用户的部署环境中;绝不发送至第三方。
  • 通过采样和限流来控制数据量与成本。
  • 捕获生产环境错误需要已部署的云应用(Tier 2);匿名状态下即可完成安装。