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. -->
<!-- 由 convex-agents content/capabilities/sentinel.json 生成——请勿手动编辑。 -->

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
    和 breadcrumbs。
  3. 写入时自动执行脱敏,且默认启用(对密钥名称和值模式采用默认拒绝策略)。
  4. 使用 Convex CLI(
    convex data
    、
    run-once-query
    )读取最近的错误;通过 monitor 的
    prod_error
    事件响应新增错误。
  5. 可选择启用自愈 cron:
    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; install works anonymously.
  • 脱敏是强制要求且默认启用——绝不能存储原始密钥;Agent 读取的数据会传递给模型提供商。
  • 数据始终保留在用户的部署中,绝不能发送给第三方。
  • 对数据进行采样并设置上限,以控制数据量和成本。
  • 捕获 PROD 错误需要已部署的云应用;安装组件时可匿名进行。