Skip to main content

Release Throughput & Backlog Health Report

The analytical data product owned by Work Planning & Release. It is built entirely from this service's own domain events (never another service's database) and served read-only. See ADR-0011 for the decision. The REST contract of the reader, cmd/wes-reports, is apis/openapi-reports.yaml (ADR-0038), rendered as the Reports API reference.

Name & owner​

  • Report: Release Throughput & Backlog Health.
  • Owner: the Work Planning & Release service/team (the same team that owns the OLTP write model).

Grain​

One row per (process path × hour bucket), where hourBucket is the UTC hour the row aggregates. Metrics per row:

MetricMeaning
workReleasedCount of WorkReleased in the bucket — work admitted into the path.
workUnitCompletedCount of WorkUnitCompleted in the bucket — released work finished.
backlogThresholdBreachedCount of BacklogThresholdBreached — backlog crossed its alarm threshold.
pathThrottledCount of PathThrottled — flow balancing throttled upstream release.
rateDeviationDetectedCount of RateDeviationDetected — actual throughput diverged from plan. Reserved: always 0 today (see below).

rateDeviationDetected is reserved​

RateDeviationDetected is declared in the event catalogue and in apis/asyncapi.yaml, and the projector counts it, but no use case raises it: no ADR defines when a rate deviation is detected (ADR-0003 calls the rule unbuilt, ADR-0020 defers it). The column is kept so the report's shape does not change when a rule is decided, and it reads 0 in every row until then. Do not build an alert or dashboard on it. The architecture fitness test TestRateDeviationDetectedStaysReserved fails if production code starts raising the event, so this page and the AsyncAPI "Reserved" markers are updated together with the ADR that introduces the rule (gap fix D26, 2026-10-12).

Inputs (analytics topic events)​

Consumed from warehouse.wes.analytics (the dedicated analytics topic, separate from the integration topic — CloudEvents 1.0, see ADR-0027):

CloudEvents typeContributes
com.warehouse.wes.work-planning.workunit.WorkReleasedworkReleased
com.warehouse.wes.work-planning.workunit.WorkUnitCompletedworkUnitCompleted
com.warehouse.wes.work-planning.workpool.BacklogThresholdBreachedbacklogThresholdBreached
com.warehouse.wes.work-planning.workpool.PathThrottledpathThrottled
com.warehouse.wes.work-planning.workpool.RateDeviationDetectedrateDeviationDetected (reserved: never published today)

Every event carries its own path_id (the report's key dimension) directly, so no repo-lookup enrichment is needed. WorkUnitCreated, LaborReassignmentFlagged and PathCapacityChanged are published to the topic but do not currently move this report; the projector acknowledges them without projecting. It acknowledges the same way the historical ChargeForecastReceived, ShiftPlanCommitted and PathPlanDriftDetected still in the topic; they are retired and no longer published (ADR-0049).

Every message is a CloudEvents 1.0 structured-mode event: specversion 1.0, id (UUID), source /warehouse/wes-work-planning, type (above), subject = the aggregate id, time (domain occurred-at, UTC), datacontenttype application/json, dataschema urn:warehouse:wes-work-planning:analytics:<EventName>:v1, and a snake_case data. The Kafka message key is the aggregate id — the PathId for path-scoped events, the work-unit id for work-unit events — and every message carries content-type: application/cloudevents+json; charset=UTF-8. The projector dispatches on the full type, ignores unknowns, dedupes on the CloudEvents id (idempotent projections), and logs-and-skips anything that is not a valid CloudEvent.

Interface​

REST (served by cmd/wes-reports, read-only)​

GET /reports/throughput?from=<RFC3339>&to=<RFC3339>&pathId=&granularity=hour
GET /reports/throughput/freshness
GET /healthz
  • from, to — required, RFC3339, [from, to) compared against hourBucket.
  • pathId — optional exact-match filter.
  • granularity — optional, defaults to hour.

Response (200):

{
"rows": [
{
"pathId": "pick-zone-a",
"hourBucket": "2026-08-26T14:00:00Z",
"workReleased": 42,
"workUnitCompleted": 39,
"backlogThresholdBreached": 1,
"pathThrottled": 0,
"rateDeviationDetected": 2
}
]
}

Freshness (200):

{ "lagSeconds": 4.2 }

Errors use RFC 7807 application/problem+json, consistent with the OLTP API (ADR-0005).

MCP (curated, read-only)​

Tool get_release_throughput_report — same filters as the REST endpoint; it calls the reports REST rather than opening the analytical database. Exposed by the existing cmd/mcp server (Streamable HTTP) when REPORTS_BASE_URL is set, consistent with ADR-0008.

Freshness SLA​

  • Definition: lagSeconds = now − age of the most recently applied event.
  • Target: p95 event-to-report lag < 30s under normal load.
  • Exposed: GET /reports/throughput/freshness.
  • Breaching the SLA is an operational signal (projector lag / consumer down), not a correctness bug — the report catches up when the projector does.
  • Empty-store note: max(occurred_at) over an empty read model is a single NULL row; the reader reads that as zero lag, not an error.

Versioning​

  • Additive fields (new optional row metric, new query filter) are non-breaking.
  • A breaking change to a row's shape or meaning is a new endpoint/tool version.
  • The analytics event contract versions independently via the CloudEvents dataschema (urn:warehouse:wes-work-planning:analytics:<EventName>:v<N>) and the analytics topic name.

Runbook notes​

  • Three processes, one writer. cmd/wes-projector is the only writer of the analytical DB; cmd/wes-reports connects read-only. The OLTP cmd/wes never opens the analytical DB.
  • Fresh group reads full history. The projector's consumer starts a brand-new group at the earliest offset (StartOffset: FirstOffset), so a fresh projector or a backfill sees the whole topic rather than only events produced after it joined.
  • Empty on first deploy. The report is empty until events flow. To backfill history, replay warehouse.wes.analytics from earliest into a fresh projector; Kafka retention must cover the desired window.
  • Eventual consistency. The report is a projection, not a real-time view; it meets the freshness SLA, not transactional consistency.