{"skill":{"slug":"sentry-observability","displayName":"Sentry Observability","summary":"Add observability to your OpenClaw instance — errors, logs, and traces sent to Sentry. Set up monitoring with the Sentry plugin, then investigate issues with...","description":"---\nname: sentry\ndescription: \"Add observability to your OpenClaw instance — errors, logs, and traces sent to Sentry. Set up monitoring with the Sentry plugin, then investigate issues with the `sentry` CLI.\"\nmetadata:\n  {\n    \"openclaw\":\n      {\n        \"emoji\": \"🐛\",\n        \"requires\": { \"bins\": [\"sentry\"] },\n        \"install\":\n          [\n            {\n              \"id\": \"npm\",\n              \"kind\": \"npm\",\n              \"package\": \"sentry\",\n              \"global\": true,\n              \"bins\": [\"sentry\"],\n              \"label\": \"Install Sentry CLI (npm)\",\n            },\n          ],\n      },\n  }\n---\n\n# Sentry — OpenClaw Observability\n\nSee what your OpenClaw instance is doing: errors, structured logs, and performance traces — all in Sentry.\n\nTwo halves: **setup** (get telemetry flowing) and **investigation** (query it with the CLI).\n\n---\n\n## Setup\n\n### 1. Authenticate\n\n```bash\nsentry auth login\n```\n\nOAuth device flow — follow the browser prompt. Credentials stored in `~/.sentry/cli.db`.\n\nAlternatives (one-liners):\n- `sentry auth login --token <TOKEN>` — paste an auth token directly\n- `SENTRY_AUTH_TOKEN=<token>` — env var, useful in CI\n\n### 2. Create a Project\n\nCreate a dedicated Sentry project for your OpenClaw instance:\n\n```bash\nsentry api /teams/<org>/<team>/projects/ \\\n  --method POST \\\n  --field name=\"my-openclaw\" \\\n  --field platform=node\n```\n\nDon't know your org/team slugs? List them:\n\n```bash\nsentry api /organizations/                          # list orgs\nsentry api /organizations/<org>/teams/              # list teams in org\n```\n\n### 3. Get the DSN\n\n```bash\nsentry project view <org>/my-openclaw --json | jq -r '.dsn'\n```\n\nOr via the keys endpoint:\n\n```bash\nsentry api /projects/<org>/my-openclaw/keys/ | jq '.[0].dsn.public'\n```\n\n### 4. Configure OpenClaw\n\nAdd the DSN to your `openclaw.json`:\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"sentry\": {\n        \"enabled\": true,\n        \"config\": {\n          \"dsn\": \"https://examplePublicKey@o0.ingest.sentry.io/0\",\n          \"enableLogs\": true\n        }\n      }\n    }\n  }\n}\n```\n\n> **Note:** Config goes under `plugins.entries.sentry.config`, not directly under `sentry`.\n\nThen install the Sentry plugin. See `references/plugin-setup.md` for the full plugin implementation using `@sentry/node`.\n\n> **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.\n\n### 5. Verify\n\nRestart your OpenClaw gateway, then check Sentry for incoming events:\n\n```bash\nsentry issue list <org>/my-openclaw --limit 5\n```\n\n---\n\n## Investigation\n\nOnce telemetry is flowing, use the CLI to query your OpenClaw's errors, traces, and events.\n\n### List Issues\n\n```bash\nsentry issue list <org>/<project>\nsentry issue list <org>/<project> --query \"is:unresolved\" --sort freq --limit 20\nsentry issue list <org>/                              # all projects in org\n```\n\n### View an Issue\n\n```bash\nsentry issue view <short-id>                          # e.g. MY-OPENCLAW-42\nsentry issue view <short-id> --json                   # structured output\n```\n\n### AI Root Cause Analysis\n\n```bash\nsentry issue explain <issue-id>                       # Seer analyzes the root cause\nsentry issue explain <issue-id> --force               # force fresh analysis\nsentry issue plan <issue-id>                          # generate a fix plan (run explain first)\n```\n\n### Structured Logs\n\n```bash\nsentry log list <org>/<project>                       # last 100 logs\nsentry log list <org>/<project> --limit 50            # last 50\nsentry log list <org>/<project> -q 'level:error'      # filter by level\nsentry log list <org>/<project> -q 'database'         # filter by message\nsentry log list <org>/<project> -f                    # stream in real-time (2s poll)\nsentry log list <org>/<project> -f 5                  # stream with 5s poll\nsentry log list <org>/<project> --json                # structured output\n```\n\nView a specific log entry:\n\n```bash\nsentry log view <log-id>                              # 32-char hex ID\nsentry log view <log-id> --json\nsentry log view <log-id> --web                        # open in browser\n```\n\n### Inspect Events\n\n```bash\nsentry event view <event-id>                          # full stack trace + context\nsentry event view <event-id> --json\n```\n\n### Direct API Calls\n\n```bash\nsentry api /projects/<org>/<project>/issues/ --paginate\nsentry api /issues/<id>/ --method PUT --field status=resolved\nsentry api /issues/<id>/ --method PUT --field assignedTo=\"user@example.com\"\n```\n\n### Workflow: Investigate an Error\n\n1. `sentry issue list <org>/<project> --query \"is:unresolved\" --sort date --limit 5`\n2. `sentry issue view <short-id>` — context, affected users, timeline\n3. `sentry issue explain <issue-id>` — AI root cause analysis\n4. `sentry issue plan <issue-id>` — concrete fix steps\n5. Fix → `sentry api /issues/<id>/ --method PUT --field status=resolved`\n\n---\n\n## Reference\n\n- Full CLI commands: `references/cli-commands.md`\n- Plugin implementation: `references/plugin-setup.md`\n- CLI docs: https://cli.sentry.dev\n- Sentry API: https://docs.sentry.io/api/\n- Node SDK: https://docs.sentry.io/platforms/javascript/guides/node/\n","tags":{"latest":"1.1.0"},"stats":{"comments":0,"downloads":1326,"installsAllTime":1,"installsCurrent":1,"stars":0,"versions":2},"createdAt":1771307771052,"updatedAt":1778491563795},"latestVersion":{"version":"1.1.0","createdAt":1771342035429,"changelog":"Added structured logs docs (sentry log list/view), log buffer flush gotcha, updated plugin reference with real implementation, fixed config path docs","license":null},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"sergical","userId":"s178sgyrx7bw5bj5znkqcfem618857v3","displayName":"Sergiy Dybskiy","image":"https://avatars.githubusercontent.com/u/3760543?v=4"},"moderation":null}