mirror of
https://github.com/tiennm99/claude-status-webhook.git
synced 2026-04-17 11:20:30 +00:00
feat: enable Cloudflare Workers observability (logs + traces)
Add observability config to wrangler.jsonc with logs and traces enabled, 100% sampling, and persistence. Free tier feature — no code changes needed.
This commit is contained in:
@@ -97,6 +97,15 @@ Binding: `claude-status` queue
|
||||
- **403/400 handling**: subscriber removed from KV, message acknowledged
|
||||
- **Network errors**: `msg.retry()` for transient failures
|
||||
|
||||
## Observability
|
||||
|
||||
Enabled via `wrangler.jsonc` `observability` config. Automatic — no code changes required.
|
||||
|
||||
- **Logs**: All `console.log`/`console.error` calls, request metadata, exceptions. Persisted with invocation logs enabled. Free tier: 200k logs/day, 3-day retention.
|
||||
- **Traces**: Automatic instrumentation of fetch calls, KV reads, queue operations. Persisted.
|
||||
- **Sampling**: 100% (`head_sampling_rate: 1`) for both logs and traces — reduce for high-volume scenarios
|
||||
- **Dashboard**: Cloudflare Dashboard → Workers → Observability
|
||||
|
||||
## Security
|
||||
|
||||
- **Statuspage webhook auth**: URL path secret validated with timing-safe SHA-256 comparison
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
humanizeStatus,
|
||||
STATUS_URL,
|
||||
} from "./status-fetcher.js";
|
||||
|
||||
/**
|
||||
* Register info commands: /help, /status, /history, /uptime
|
||||
*/
|
||||
|
||||
@@ -23,6 +23,21 @@
|
||||
"max_retries": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
"observability": {
|
||||
"enabled": false,
|
||||
"head_sampling_rate": 1,
|
||||
"logs": {
|
||||
"enabled": true,
|
||||
"head_sampling_rate": 1,
|
||||
"persist": true,
|
||||
"invocation_logs": true
|
||||
},
|
||||
"traces": {
|
||||
"enabled": true,
|
||||
"persist": true,
|
||||
"head_sampling_rate": 1
|
||||
}
|
||||
}
|
||||
// Secrets (set via `wrangler secret put`):
|
||||
// BOT_TOKEN - Telegram bot token
|
||||
|
||||
Reference in New Issue
Block a user