-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrangler.tail.toml
More file actions
70 lines (62 loc) · 3.21 KB
/
wrangler.tail.toml
File metadata and controls
70 lines (62 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# ============================================================================
# wrangler.tail.toml — Tail Worker configuration
# ============================================================================
#
# TWO ENVIRONMENTS ONLY:
#
# Local dev → `wrangler dev --config wrangler.tail.toml`
# Port 8788 (intentionally different from main worker on 8787).
# Secrets loaded from .dev.vars (gitignored, same file as
# the main worker — tail worker reads the same set).
#
# Production → `wrangler deploy --config wrangler.tail.toml`
# This file IS the production configuration.
# MUST be deployed before the main worker registers the
# [[tail_consumers]] binding in wrangler.toml — otherwise
# the main worker deploy will fail with an unknown service error.
#
# SECRETS (wrangler secret put --config wrangler.tail.toml):
# ERROR_WEBHOOK_URL — sensitive webhook URL for forwarding critical errors.
# wrangler secret put ERROR_WEBHOOK_URL --config wrangler.tail.toml
# Do NOT put it in [vars] — it would be visible in the Cloudflare dashboard.
# SENTRY_DSN — Sentry Data Source Name for tail-worker exception capture.
# wrangler secret put SENTRY_DSN --config wrangler.tail.toml
# ============================================================================
name = "adblock-tail"
main = "worker/tail.ts"
# Keep in sync with the main worker's compatibility_date in wrangler.toml.
compatibility_date = "2026-01-01"
# Keep in sync with the main worker's compatibility_flags in wrangler.toml.
compatibility_flags = ["nodejs_compat"]
# ─── KV: Tail log persistence ────────────────────────────────────────────────
# Stores structured tail log entries for later querying.
# Create with: wrangler kv:namespace create TAIL_LOGS --config wrangler.tail.toml
[[kv_namespaces]]
binding = "TAIL_LOGS"
id = "476d9c981b8d4e2eaa2442ae85e0c838"
# ─── Static runtime vars (non-secret) ────────────────────────────────────────
[vars]
# Log retention TTL in seconds. Default: 86400 (24 hours).
# Increase for longer audit trails; decrease to reduce KV storage costs.
LOG_RETENTION_TTL = "86400"
# ─── Observability ───────────────────────────────────────────────────────────
[observability]
enabled = true
head_sampling_rate = 1
[observability.logs]
enabled = true
destinations = [ "sentry-logs" ]
head_sampling_rate = 1
persist = true
invocation_logs = true
[observability.traces]
enabled = true
destinations = [ "sentry-traces" ]
persist = true
head_sampling_rate = 1
# ─── Local dev server ────────────────────────────────────────────────────────
# These settings apply ONLY to `wrangler dev`. Ignored on `wrangler deploy`.
# Port 8788 avoids conflict with the main worker on 8787.
[dev]
port = 8788
local_protocol = "http"