← 返回
数据分析 Key 中文

Sentry Observability

Add observability to your OpenClaw instance — errors, logs, and traces sent to Sentry. Set up monitoring with the Sentry plugin, then investigate issues with...
为OpenClaw实例添加可观测性——错误、日志和追踪发送至Sentry。使用Sentry插件设置监控,随后调查问题...
sergical
数据分析 clawhub v1.1.0 1 版本 99921.3 Key: 需要
★ 0
Stars
📥 1,269
下载
💾 9
安装
1
版本
#latest

概述

Sentry — OpenClaw Observability

See what your OpenClaw instance is doing: errors, structured logs, and performance traces — all in Sentry.

Two halves: setup (get telemetry flowing) and investigation (query it with the CLI).


Setup

1. Authenticate

sentry auth login

OAuth device flow — follow the browser prompt. Credentials stored in ~/.sentry/cli.db.

Alternatives (one-liners):

  • sentry auth login --token — paste an auth token directly
  • SENTRY_AUTH_TOKEN= — env var, useful in CI

2. Create a Project

Create a dedicated Sentry project for your OpenClaw instance:

sentry api /teams/<org>/<team>/projects/ \
  --method POST \
  --field name="my-openclaw" \
  --field platform=node

Don't know your org/team slugs? List them:

sentry api /organizations/                          # list orgs
sentry api /organizations/<org>/teams/              # list teams in org

3. Get the DSN

sentry project view <org>/my-openclaw --json | jq -r '.dsn'

Or via the keys endpoint:

sentry api /projects/<org>/my-openclaw/keys/ | jq '.[0].dsn.public'

4. Configure OpenClaw

Add the DSN to your openclaw.json:

{
  "plugins": {
    "entries": {
      "sentry": {
        "enabled": true,
        "config": {
          "dsn": "https://examplePublicKey@o0.ingest.sentry.io/0",
          "enableLogs": true
        }
      }
    }
  }
}

> Note: Config goes under plugins.entries.sentry.config, not directly under sentry.

Then install the Sentry plugin. See references/plugin-setup.md for the full plugin implementation using @sentry/node.

> Log buffer gotcha: Sentry's structured logs buffer up to 100 items before auto-flushing. For low-volume services like OpenClaw, logs may sit in the buffer for a long time. The plugin should call _INTERNAL_flushLogsBuffer(client) periodically (e.g. every 30s) and before Sentry.flush() on shutdown. See references/plugin-setup.md for the implementation.

5. Verify

Restart your OpenClaw gateway, then check Sentry for incoming events:

sentry issue list <org>/my-openclaw --limit 5

Investigation

Once telemetry is flowing, use the CLI to query your OpenClaw's errors, traces, and events.

List Issues

sentry issue list <org>/<project>
sentry issue list <org>/<project> --query "is:unresolved" --sort freq --limit 20
sentry issue list <org>/                              # all projects in org

View an Issue

sentry issue view <short-id>                          # e.g. MY-OPENCLAW-42
sentry issue view <short-id> --json                   # structured output

AI Root Cause Analysis

sentry issue explain <issue-id>                       # Seer analyzes the root cause
sentry issue explain <issue-id> --force               # force fresh analysis
sentry issue plan <issue-id>                          # generate a fix plan (run explain first)

Structured Logs

sentry log list <org>/<project>                       # last 100 logs
sentry log list <org>/<project> --limit 50            # last 50
sentry log list <org>/<project> -q 'level:error'      # filter by level
sentry log list <org>/<project> -q 'database'         # filter by message
sentry log list <org>/<project> -f                    # stream in real-time (2s poll)
sentry log list <org>/<project> -f 5                  # stream with 5s poll
sentry log list <org>/<project> --json                # structured output

View a specific log entry:

sentry log view <log-id>                              # 32-char hex ID
sentry log view <log-id> --json
sentry log view <log-id> --web                        # open in browser

Inspect Events

sentry event view <event-id>                          # full stack trace + context
sentry event view <event-id> --json

Direct API Calls

sentry api /projects/<org>/<project>/issues/ --paginate
sentry api /issues/<id>/ --method PUT --field status=resolved
sentry api /issues/<id>/ --method PUT --field assignedTo="user@example.com"

Workflow: Investigate an Error

  1. sentry issue list / --query "is:unresolved" --sort date --limit 5
  2. sentry issue view — context, affected users, timeline
  3. sentry issue explain — AI root cause analysis
  4. sentry issue plan — concrete fix steps
  5. Fix → sentry api /issues// --method PUT --field status=resolved

Reference

  • Full CLI commands: references/cli-commands.md
  • Plugin implementation: references/plugin-setup.md
  • CLI docs: https://cli.sentry.dev
  • Sentry API: https://docs.sentry.io/api/
  • Node SDK: https://docs.sentry.io/platforms/javascript/guides/node/

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-29 03:14 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Reflect Notes

sergical
追加每日笔记并在 Reflect 中创建笔记。用于捕捉想法、待办事项,或将信息同步至知识图谱。
★ 1 📥 3,166
data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 164 📥 59,789
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 64,958