# Functional Design Plan — U4 Observability Integration **Unit**: U4 Observability Integration **Round**: R2 (with U3 Security Headers & CSP) **Requirements**: FR-13, FR-14, FR-15, FR-16, FR-19 **Components**: C-08, C-09, C-14, C-15, U4 portion of C-16 **Scope boundary**: this stage designs *behaviour* — what is reported, when, and what happens when a service is absent or unreachable. The *pattern* decisions (structured-log shape, correlation-ID mechanism per OPEN-01, alert-rule design) belong to this unit's NFR Design, which follows. --- ## Step 1: Analyze unit context - [x] Read the U4 definition from `unit-of-work.md` - [x] Read FR-13 through FR-16 and FR-19 from `requirements.md` - [x] Read the reference project's Sentry and Umami implementation for the frontend - [x] Note the coupling to U3: the origins this unit introduces must be permitted by U3's CSP ## Step 2: Design backend error and log reporting - [x] Define behaviour when no Sentry DSN is configured - [x] Define behaviour when Sentry is configured but unreachable - [x] Define what is sent and what is deliberately withheld — see Question 2 - [x] Define the production log level — see Question 3 - [x] Define environment and release tagging ## Step 3: Design security event emission - [x] Define which events are emitted for alerting — see Question 4 - [x] Define what context each event carries, and what it must never carry - [x] Confirm no event carries a password, token or PII ## Step 4: Design frontend observability - [x] Define Sentry initialisation and the absent-DSN path - [x] Define the transport route to Sentry — see Question 1 - [x] Define Umami inclusion behaviour and its absent-configuration path — see Question 5 - [x] Define behaviour in local development ## Step 5: Design the same-origin API base URL - [x] Define resolution when `VITE_API_BASE_URL` is absent or empty - [x] Define resolution when an explicit absolute URL is supplied - [x] Define validation behaviour for a malformed value - [x] Confirm the local master and slave development setups keep working ## Step 6: Define business rules - [x] Enumerate reporting rules - [x] Enumerate degradation rules - [x] Enumerate configuration-resolution rules - [x] Identify error and edge-case scenarios ## Step 7: Generate artifacts - [x] Generate `business-logic-model.md` - [x] Generate `business-rules.md` - [x] Generate `domain-entities.md` - [x] Generate `frontend-components.md` - [x] Validate all diagrams against the Mermaid standards - [x] Verify Security Baseline compliance for this unit's design