Add CORS preflight synthetic monitor for cross-origin frontend→API health #293
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-platform#293
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Discovered during QA review of
pal-e-deployments#125. The CORS misconfig surfaced as user-visible "Failed to fetch" — observability didn't catch it because we have no synthetic that exercises a cross-origin preflight.Repo
forgejo_admin/pal-e-platformUser Story
As an on-call engineer, I want an alert to fire within 5 minutes when any frontend↔API CORS preflight starts failing in production, so that user-visible "Failed to fetch" outages are surfaced by observability instead of by users.
Context
Existing
blackbox-exporterprobes hit endpoints directly with GET — they never exercise the browser's actual CORS preflight pattern (OPTIONSwithOriginheader). When thepal-e-app → pal-e-docspreflight broke (seepal-e-deployments#124), pod logs showedOPTIONS /boards 400for hours but no alert fired. We need a synthetic that mimics the real frontend call pattern, per-pair, so drift between an app's allowed-origin config and its actual hostname is caught before it reaches users.Per
feedback_dora_thesis.md, observability + kanban are the two DORA pillars. This is observability hardening.File Targets
~/pal-e-platform/modules/observability/blackbox.tf(or equivalent) — add CORS-preflight probe targets~/pal-e-platform/modules/observability/prometheusrule.tf(or k8s YAML) — add alert rule forprobe_success{job="cors-preflight"} == 0~/pal-e-platform/modules/observability/alertmanager.tf(or values file) — confirm alert routes to existing channelconvention-cors-synthetic) — document the pattern so future frontend↔api pairs add it by defaultTest Expectations
{frontend_origin → api_host}pairConstraints
kube-prometheus-stack+blackbox-exporter(already deployed inmonitoringnamespace) — do NOT introduce a new probe sidecarpal-e-app↔pal-e-docs,westside-app↔basketball-api,mcd-tracker-app↔mcd-tracker-api. Other pairs as discovered.Acceptance Criteria
moduleconfig supportsOPTIONSwith customOriginandAccess-Control-Request-*headersprobe_success == 0withfor: 5mconvention-cors-syntheticwritten + linked fromdefinition-appChecklist
Same as Acceptance Criteria above; tracked there.
Out of Scope
Environment
monitoringkube-prometheus-stack,blackbox-exporter,Alertmanager,Lokipal-e-app.tail5b443a.ts.net,pal-e-docs.tail5b443a.ts.net,westsidekingsandqueens.tail5b443a.ts.net,basketball-api.tail5b443a.ts.net,mcd-tracker-app.tail5b443a.ts.net,mcd-tracker-api.tail5b443a.ts.netRelated
forgejo_admin/pal-e-deployments#124— concrete bug this would have caughtfeedback_dora_thesis.md— observability is half of DORAdefinition-app— naming convention for app/api pairs