Skip to content

Commit 00ba926

Browse files
committed
chore(changeset): perf-timing per-request gating (#2408)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011upHdyr5AnNc6dWAu63qxD
1 parent a44c4a5 commit 00ba926

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
"@objectstack/observability": minor
3+
"@objectstack/plugin-hono-server": minor
4+
"@objectstack/runtime": minor
5+
---
6+
7+
feat(observability): admin-gated per-request `Server-Timing` via `X-OS-Debug-Timing` (#2408)
8+
9+
Perf-tuning mode was previously global-only (`serverTiming` option /
10+
`OS_SERVER_TIMING`), which discloses internal phase durations — a mild
11+
backend-fingerprinting surface — to every caller. This adds the per-request
12+
gating path from the design so an operator can pull a single request's
13+
`Server-Timing` breakdown on a live environment without turning the header on
14+
for everyone.
15+
16+
- **observability**: a request-scoped disclosure gate (`runWithPerfDisclosure`,
17+
`allowPerfDisclosure`, `isPerfDisclosureAllowed`, `PerfDisclosureGate`) kept
18+
separate from the pure `PerfTiming` collector and pinned to its own
19+
`Symbol.for` store so the middleware and dispatcher share it across module
20+
copies.
21+
- **plugin-hono-server**: the Server-Timing middleware is registered by default
22+
(unless `serverTiming: false`). It runs the collector when timing is global
23+
**or** the request sends `X-OS-Debug-Timing: 1`, and emits the header only
24+
when the gate is open. `OS_PERF_TIMING=1` now also enables global mode.
25+
- **runtime**: after resolving the execution context, the dispatcher opens the
26+
gate for admin/service/system principals, so ordinary callers never receive
27+
the header even if they send the debug header.
28+
29+
Existing global-mode behavior is unchanged.

0 commit comments

Comments
 (0)