Intelligence, Advanced Charting & Trading Platform
docs(risk): chartnova-stage2-observability-proposal-2026-10-15
davoodmehraban89 committed
Oct 15, 2026 at 19:40 UTC
91e719f0bf2ef6315c8e4ac07ef680700944604c
1 file changed
+32
docs/operations/chartnova-stage2-observability-proposal-2026-10-15.md
new
+32
@@ -0,0 +1,32 @@
1
+# Stage 2 — observability and read-only health checks (PROPOSAL, NOT IMPLEMENTED)
2
+
3
+**2026-10-15; NO new production instrumentation, accounts, payments, Worker changes, service configuration, external telemetry or outgoing notifications.** The incident root cause remains **تأییدنشده**.
4
+
5
+## Recommendation: start with native Cloudflare, no third party
6
+
7
+- **Workers Logs**: enable only after separate deployment/config approval and verify existing account configuration. Official current Free tier: **200,000 log events/day, 3-day retention, $0**, until Dec 1 2026; upcoming Free Observability quota advertised at **0.5 GB/day, 7 days** from December. Pricing will change; recheck before activation. Source: https://developers.cloudflare.com/workers/observability/logs/workers-logs/ and https://blog.cloudflare.com/one-observability-platform
8
+- **Workers Free**: official **100,000 requests/day**, **10ms CPU/request**, **5 Cron Triggers/account** (limits can change), and Worker KV **100,000 reads/day, 1,000 writes/day**. Verify actual account usage separately; do not write one KV record per request. Sources: https://developers.cloudflare.com/workers/platform/limits/ and https://developers.cloudflare.com/kv/platform/pricing/
9
+- Native logs avoid exposing browser/user telemetry to another vendor; use low-volume structured events + sampling, never a full Request/Response body.
10
+- Suggested structured fields: releaseVersion, deployedWorkerVersion, routeGroup, responseStatus, durationMs, incidentCode, dataProviderAlias, dataAgeSeconds, cacheStatus, serviceWorkerControlled, clientBuild, an **ephemeral** trace/correlation ID. Exclude: cookies, Authorization, API token, complete URL query parameters, chat IDs, personal IP, user financial preferences or precise location.
11
+- **Client exception tracing**: window error and unhandledrejection with sanitized filename/line/column, request failure status and release fingerprint; redaction before any transport. For iOS PWA offline, buffer max 10 minimal items *in ephemeral memory only*, not persistent private storage or unlimited retransmissions. Console from user device is preferable to broad always-on client collection until consent/privacy review.
12
+- **No change during Stage 2**: the current Worker has NO newly activated observability code from this proposal.
13
+
14
+## Sentry alternative (not preferred for zero-cost baseline)
15
+
16
+- Free **Developer** tier exists at **$0**; current numeric event, session replay, retention and uptime-monitor allowances were **not independently verified on the current official pricing page in this review: تأییدنشده**. Do not quote unofficial "5K/month" as a confirmed current 2026 quota.
17
+- Sentry adds a third-party network dependency, metadata transfer/retention and potential user privacy/jurisdiction problems; a blocked Sentry endpoint cannot be allowed to block site rendering. Use asynchronous, sampled errors only; disable session replay and user PII/headers by default.
18
+- If approved later, bind events to exact release/version ID; filter source maps containing secrets; set consent and data retention controls; avoid automatic billing upgrades.
19
+- Official product explanation: https://sentry.io/for/frontend/ ; official free-plan confirmation: https://www.sentry.help/en/articles/16738709-changes-to-legacy-developer-plans-september-2026 ; official pricing page (numeric quotas unverified here): https://sentry.io/pricing/
20
+
21
+## Two minimal health endpoints — design only
22
+
23
+1. GET /health/live (no auth/DB/provider): return HTTP 200 with constant service name, **deployed version**, build SHA and current server timestamp; Cache-Control: no-store; no account identifiers. A passing response proves HTTP process availability, **not source/price validity**.
24
+2. GET /health/ready (read-only cache metadata only; do NOT call vendor or write KV): for USD/GOLD18/XAU show availability, provider timestamps, age, quality state and currency/quote-side status *only if contract proven*. For STALE/INVALID return 503 or explicit degraded status, without leaking price payload or API keys. Independently record API response time and SW-controlled vs network response.
25
+3. Monitor both the apex and app subdomain separately; compare from at least two independent networks to detect origin-specific cache/proxy errors. Do not treat smoke from GitHub as an affected user-device proof.
26
+4. When ready check fails: clearly show STALE and suspend future price-alert evaluations (only after alert engine exists), rather than pretending live market data.
27
+
28
+**Cost and risk:** Within zero-cost Worker/KV budgets if polled conservatively; each health call counts towards request quotas, each cache read toward KV quota. New health endpoints and logging require explicit later **code review + production approval**. This Stage 2 did not implement them.
29
+
30
+## Not complete
31
+
32
+No live log collector, Sentry account, health routes, source freshness SLA, mobile consent, provider latency measurements or action on production. All remain **تأییدنشده**.