You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/observability.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,13 @@ This document describes recommended **logging and metrics** for the Edge Securit
15
15
16
16
## Structured JSON Logs (generated runtime)
17
17
18
-
When `observability.log_format: json` is set (default), the generated viewer-request / origin-request / Cloudflare Worker emit one JSON line per decision to `console.log`. Fields:
18
+
When `observability.log_format: json` is set (default), the generated viewer-request / origin-request / Cloudflare Worker emit denied, monitor, audit, and error decisions to `console.log`. Allowed requests are emitted according to `observability.sample_rate`. Fields:
audit_log_auth: true # emit audit events on auth gate success
54
54
audit_hash_sub: true # SHA-256 truncate sub to 16 hex (PII-safe)
55
55
```
@@ -58,6 +58,8 @@ observability:
58
58
59
59
At Lambda@Edge / Worker, if the incoming request does **not** carry `correlation_id_header`, the runtime mints one (`crypto.randomUUID` / `crypto.getRandomValues`) and sets it on the forwarded request. Downstream services then see a consistent ID across edge logs, WAF logs, and origin logs.
60
60
61
+
Allow sampling is deterministic. The runtime uses the incoming correlation ID when present, otherwise it uses the request method and URI path. Lambda@Edge and Workers capture that key before minting a missing correlation ID, so retries for the same method/path remain in the same sample bucket. `sample_rate: 0` disables allow logs; `1` emits every allowed request. Block, monitor, audit, and error logs are never sampled.
0 commit comments