ingest-api: allow unknown event JSON fields for forward-compatible clients
- Relax Fastify/AJV schema on ingest events (additionalProperties: true) so CRM/deploy smokes sending extra keys no longer fail validation with 400. - Add integration test when ERROR_REPORTING_TEST_DATABASE_URL is set. - Document BIT-SMOKE / BIT-931 triage in RUNBOOK_INGEST_DEBUG; note in ingest-hardening-runbook. Paperclip-Agent: 0b1fcf92-5fe3-4ac0-9f29-df4ab72f5376 Paperclip-Issue: 35542fda-44d4-4154-b95d-1a7de3566204 Paperclip-Run: 3682ff13-02fc-4749-a460-6414830dccc7 Made-with: Cursor
This commit is contained in:
1 parent
d7f9642606
commit
d47a061399
4 files changed
+57
-1
No files matched your search
@@ -5,6 +5,29 @@
|
||||
|
||||
---
|
||||
|
||||
## 0. Deploy smoke: `BIT-SMOKE error hub ingest live check` (wdmi-store / CRM)
|
||||
|
||||
**Symptoms:** Hub incident titled like **`BIT-SMOKE error hub ingest live check`** (ex.: [BIT-931](/BIT/issues/BIT-931), `ERRSIG:0dfffa22f758`) — the application’s post-deploy probe could not complete a successful **`POST /v1/ingest/events`** (or treated the response as failure).
|
||||
|
||||
**Not the same as** feed/XML upload failures — those hit catalog APIs; see [RUNBOOK_REPORTER_WDMI_FEED_UPLOAD.md](RUNBOOK_REPORTER_WDMI_FEED_UPLOAD.md).
|
||||
|
||||
**Checks (in order)**
|
||||
|
||||
1. **From the reporter host** (same egress as the app), run [scripts/examples/ingest_smoke.sh](../scripts/examples/ingest_smoke.sh) with production `INGEST_API_BASE` and the **same** ingest key as the app (read token from a file; avoid shell history).
|
||||
2. **URL:** must be the ingest service base (no path suffix in env) — clients append `/v1/ingest/events` themselves (see [clients/php/ErrorReporter.php](../clients/php/ErrorReporter.php), [HTTP_CONTRACTS.md](HTTP_CONTRACTS.md)).
|
||||
3. **Credentials:** `Authorization: Bearer <token>` or `X-Api-Key`; key must be **active** and **unexpired** in `er_ingest_keys` (§2).
|
||||
4. **HTTP codes:** `401` / `429` / `5xx` / timeouts — use sections below; CRM cURL timeouts are short (e.g. 4s) — slow proxies can fail smokes before the hub responds.
|
||||
5. **HTTP 400 from schema validation** should be rare; the hub ignores unknown **event-level** JSON keys and only requires `schema_version`, `occurred_at`, `level`, `message`.
|
||||
|
||||
**After the root cause is fixed**
|
||||
|
||||
```bash
|
||||
./scripts/er-cli.sh list-open --project wdmi-store --q "ERRSIG:0dfffa22f758"
|
||||
./scripts/er-cli.sh resolve <unique_id> --note "ingest smoke restored; verified POST /v1/ingest/events from wdmi-store" --assigned-to "oncall"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 1. Quick health
|
||||
|
||||
```bash
|
||||
|
||||
@@ -16,6 +16,11 @@ Use this after deploying ingest API or changing fingerprint / noise / rate-limit
|
||||
|
||||
Per-key overrides: set `rate_limit_max` and/or `rate_limit_window_ms` on the key row; NULL means inherit the corresponding env default.
|
||||
|
||||
## Request schema (forward compatibility)
|
||||
|
||||
- Top-level body must remain `{ "events": [ … ] }` only (no extra root keys).
|
||||
- Each **event** object must include `schema_version`, `occurred_at`, `level`, and `message`. Additional event-level properties are **accepted and ignored** by the processor so integrators can attach metadata without breaking validation.
|
||||
|
||||
## Fingerprint quality
|
||||
|
||||
- Server-side fingerprint policy version is returned on each ingest response as `fingerprint_policy_version`.
|
||||
|
||||
Reference in new issue
Block a user