Assign one owner
One thread/task calls bounded wait; independent snapshot readers do not own the wait lane.
Product knowledge · Advanced · Monitoring
Health and fresh liveness are direct observations. Optional Monitor collection adds bounded aggregates/events; an exporter copies facts out through an application-owned queue and deadline.
01 · Choose the observation
| Question | Correct surface | Do not infer |
|---|---|---|
| Which lifecycle state is the service in, and does it still admit requests? | Direct health snapshot | Ready does not prove the event loop made fresh progress. |
| Did the runtime acknowledge a fresh probe within its deadline? | Bounded fresh-liveness probe | A passing probe does not prove a dependency or business handler is healthy. |
| Which configuration/capability did Core accept? | Runtime information + effective configuration | Builder input is not an observed fact. |
| How are traffic/exchange/control/latency evolving? | Optional bounded Monitor | Disabling Monitor does not remove direct health; waiting never enables collection. |
02 · Ownership model
Owns health/progress, effective monitor policy, aggregates, the bounded event ring, cursor/loss accounting and wait/interrupt lifecycle.
Projects typed values, preserves exact integer/enum identity, copies host values with correct lifetime and never invents defaults or categories.
Chooses signals/cadence, maps metrics/alerts and owns exporter queue, batching, network I/O, credentials, retry and shutdown order.
Owns health endpoint exposure, scrape/service discovery, alert routing, retention, access control and replica-level interpretation.
03 · Direct health
CREATED, RUNNING, DRAINING or STOPPED; read it with readiness/admission instead of inferring from a process or socket.While live-control observation is unresolved, health/liveness/route snapshots can return CONTROL_UNRESOLVED without changing output. Never label the last confirmed cut as current.
04 · Fresh liveness
health snapshot = non-blocking state observed now
fresh liveness probe = ask the runtime progress lane to acknowledge within timeout
probe timeout ≠ business request timeout
probe pass ≠ downstream dependency health
probe failure = preserve structured evidence; never fabricate ready=trueUse a finite timeout appropriate to the scheduler/host. A liveness endpoint must not run unbounded work, call every dependency or reuse cached success as fresh proof.
05 · Collection policy
| Field | Meaning in SDK 2.3.0 |
|---|---|
| Collection | DISABLED, AGGREGATES or AGGREGATES_AND_EVENTS. The default is disabled. |
| Notification | POLL or SIGNAL; signal is valid only when reserved at startup. |
| Latency | NONE or fixed pre-reserved buckets; arbitrary histograms are not created mid-runtime. |
| Active event capacity | The portion used in the reserved ring; live apply cannot exceed reserved event capacity. |
| Aggregate/event categories | SDK 2.3.0 accepts LIFECYCLE, EXCHANGE, CONTROL, LATENCY bitmasks. Core's supported mask is authoritative. |
| Max events per read | Startup bound for each page; callers still choose a finite maximum and supply enough capacity. |
Policy apply uses an expected configuration generation. Invalid enum/category relationship, unsupported category, reservation exceeded, signal not reserved, generation conflict, invalid lifecycle, sequence exhaustion or internal failure preserves the complete previous policy.
06 · Identity map
Compare-and-apply identity for effective policy. If two controllers read one generation, only the first valid operation can advance it.
Context/interval for interpreting counters and resets. An epoch change splits a time series; it never substitutes for expected generation on apply.
Monotonic observation identity for policy/collection changes in the instance; not wall clock.
Cursor identity for the retained event stream; gaps/overwrite must be reported rather than hidden behind timestamps.
Export generation, epoch and sequence with the values. Never merge samples from two epochs into one continuous interval.
07 · Aggregate snapshot
| Group | Fields to understand |
|---|---|
| Quality | collecting, stale, partial, snapshot/change sequence and observed monotonic time. Never export stale/partial as a complete fresh sample. |
| Traffic/exchange | Admitted requests/bytes; completed, failed, timed out, disconnected, cancelled; response status-family counters. |
| Event channel | Retained, overwritten and dropped events; signal notifications, coalesced signals and signal failures. |
| Failure/latency | Bounded stable failure rows and reserved fixed latency buckets; preserve the numeric identity of an unknown reason. |
| Effective context | Complete monitor config + direct health embedded in the snapshot so the sample retains generation/epoch/lifecycle context. |
Traffic/response/failure/signal are snapshot fields, not separate policy categories in SDK 2.3.0. The snapshot does not report live connector queue depth. Export that metric separately if the connector exposes it.
08 · Event cursor
wait(finite timeout)
→ read(after_sequence, finite maximum, finite output capacity)
→ process retained events in sequence
→ record oldest / latest / remaining / overwritten
→ advance cursor only from returned facts| Fact | Reading law |
|---|---|
| Event | Preserve kind, sequence/change sequence, config generation, collection epoch, monotonic time, category, stable failure reason and exchange identity. |
| Oldest/latest | Define the retained window; never infer continuity merely because latest increased. |
| Overwritten | Report the history gap, mark the interval incomplete and resync with a snapshot; never recreate missing events. |
| Remaining | Shows another page remains in the retained ring; continue bounded reads rather than growing a page without limit. |
| Queue-shaped fields | Use them only when the exact producer/capability confirms them; field presence does not prove every category emits queue depth. |
09 · Wait and shutdown
One thread/task calls bounded wait; independent snapshot readers do not own the wait lane.
Notifications can coalesce. Always read a snapshot/page after wake; never count wakeups as event count.
Keep monitoring alive when it must observe accepted work during the finite drain interval.
The lifecycle owner signals stop, interrupts the waiter from another thread, joins with a bound, then closes the runtime.
A wait timeout only means no wake occurred in that window. Signal failure or monitor pressure must not block HTTP traffic or change an exchange terminal.
10 · Data boundary
11 · Application exporter
CoAkka HTTP Runtime snapshot/page
→ copy bounded typed values
→ finite application queue
→ batch + finite network deadline
→ Prometheus / OpenTelemetry / logs / local dashboard
queue full / backend down → count exporter drop; never block HTTP workThe application owns metric names, labels/cardinality, backend TLS/auth, batching, retry/backoff, total budget and shutdown. The runtime does not retry the exporter, hold credentials or convert exporter failure into request failure.
12 · Failure law
| Observed fact | Next safe action |
|---|---|
| Health/liveness observation unresolved | Keep output unknown and recover the exact control operation; never declare current/ready locally. |
| Policy generation conflict | Read new effective config, merge/reconsider intent and apply against the current generation. |
| Unsupported/reservation refusal | Keep old policy; select a supported subset or replace the service with a new reservation. |
| Stale/partial snapshot | Carry the quality flag and never use it as a complete fresh interval; read again at bounded cadence. |
| Overwritten/dropped event | Record the gap, resync the aggregate snapshot and repair reader/exporter capacity; never claim event completeness. |
| Wait interrupted/timeout | Separate lifecycle interrupt from an empty wait; neither is a request/runtime terminal. |
| Exporter queue/backend failure | Drop/buffer by finite policy, surface it separately and protect the HTTP path. |
13 · Evidence record
Run a local request and see which counters change when the service drains.
14 · Integration checklist