Observability — Guidelines
Rules every ION service MUST follow to fit the platform observability substrate.
Signal shape
MUST
- Emit structured JSON logs with the required fields
(
timestamp,level,service,env,region,correlationId,message). - Emit RED metrics on every external API surface (request rate, error rate, duration histogram).
- Emit domain metrics for the bounded context’s key invariants (ingest lag, projection lag, event append latency).
- Emit traces via OTel or App Insights SDK; propagate
W3C
traceparenton every outbound HTTP call and Service Bus message.
MUST NOT
- Log unstructured free-text messages as the primary signal.
- Emit metrics without units or dimensions.
- Roll a per-service telemetry SDK — use the platform SDK.
Correlation
MUST
- Read
X-Correlation-Idat ingress; generate if missing. - Attach the correlation ID to the logger scope for the whole request.
- Propagate the ID on all outbound HTTP calls, Service Bus message properties, and Temporal workflow inputs.
MUST NOT
- Overwrite an inbound correlation ID.
- Rely on trace ID alone for cross-service correlation —
X-Correlation-Idis the primary key.
What NOT to log
MUST NOT
- Log authorization headers, user access or refresh tokens, capability headers, cookies, complete JWT claims, or any bearer credentials.
- Log request or response bodies, message payloads, customer content, or uploaded files. Emit bounded metadata and opaque resource references instead.
- Log customer secrets, keys, connection strings, or credential material.
MUST
- Minimize and redact known sensitive fields in application code before export.
- Treat ingest redaction as defense in depth, not as permission to emit sensitive payloads or credentials.
- Assume every log line will be read by a wide operator audience and shape it accordingly.
Retention
MUST
- Ship logs to the platform-shared Log Analytics workspace in the correct per-service table.
- Set retention per table via IaC (default hot 30 d, warm 90 d).
- Route audit-required signals to the audit pipeline (see Audit Logs) instead of relying on general log retention.
MUST NOT
- Store telemetry outside the platform LA workspace.
- Extend retention beyond need — cost + compliance surface grow with retention.
Alerting
MUST
- Define alerts as IaC (§ 25) — no portal-created rules on Beta / Prod.
- Attach a runbook URL to every alert.
- Route Critical and Warning to SRE, who triage at L1 and escalate to the owning team (incident management); Info to dashboards only.
- Base SLO alerts on burn-rate against a documented SLO.
SHOULD
- Prefer symptom-based alerts over cause-based (5xx spike, latency P95 breach, DLQ growth) — cause-based alerts age quickly.
- Silence flapping alerts within one shift with a tracked fix follow-up.
MUST NOT
- Page for
INFO-severity signals. - Add alerts without an owner + runbook.
Dashboards
MUST
- Provision dashboards via IaC (Grafana JSON in shared
tf-modules/). - Every system publishes a system dashboard covering SLO, RED, top errors, DLQ, projection lag.
- Every deployable service publishes a service dashboard covering RED + custom domain metrics.
SHOULD
- Cross-link runbooks, ADRs, service READMEs from dashboard panels.
Sampling
MUST
- Use head-based sampling where App Insights SDK supports it; retain error traces always.
- Document per-service sample rate in the service README.
MUST NOT
- Sample security-relevant events (auth failures, WAF blocks, audit-touching operations).
Access
MUST
- Grant LA read via Entra groups scoped to system + role.
- Restrict write (ingest) to service Managed Identities only.
MUST NOT
- Share LA queries or dashboards outside the tenant.
Anti-patterns
- Free-text log storms — unqueryable, unfilterable, drives cost.
- Missing correlation IDs — cross-service investigations fail.
- Portal-created alerts — untracked, will drift, no runbook.
- Cause-based alerts — “CPU > 80 %” without symptom impact pages needlessly.
- Logging bearer tokens or PII — instant security incident.
- Per-service Prometheus / ELK — violates § 21 and fragments the substrate.
- Alerts without runbooks — responders can’t act.
- Dashboards edited in the Grafana UI — untracked drift.
Related
- Architecture
- Implementation
- ADRs: 0019, 0020, 0024
- Principles: § 15, § 17, § 21, § 25
- Capabilities: Audit Logs, DR, API management