Problem
BrokerActor.connectionState is protected (src/io/broker/BrokerActor.ts:432) — no other actor can ask a broker "are you connected?". So are subscriberCountForTopic and outboundBufferSize. The only channel is subscribing to BrokerConnected/BrokerDisconnected on the EventStream (src/io/broker/BrokerEvents.ts) and keeping your own copy.
And src/io/ has zero metric call sites: no broker_messages_published_total, no broker_reconnect_attempts_total, no buffer-depth gauge — even though BrokerBufferOverflow / BrokerReconnectAttempt events already fire at exactly the right places.
Proposed behaviour
Add a common { kind: 'status', replyTo } command handled by BrokerActor, returning { state, bufferSize, desiredSubscriptions, lastError }, and emit counters/gauges from the existing lifecycle hooks.
Acceptance criteria
/health can report broker connectivity without app code.
- The Prometheus endpoint shows reconnect and publish counters.
Related: #467, #440
Problem
BrokerActor.connectionStateis protected (src/io/broker/BrokerActor.ts:432) — no other actor can ask a broker "are you connected?". So aresubscriberCountForTopicandoutboundBufferSize. The only channel is subscribing toBrokerConnected/BrokerDisconnectedon the EventStream (src/io/broker/BrokerEvents.ts) and keeping your own copy.And
src/io/has zero metric call sites: nobroker_messages_published_total, nobroker_reconnect_attempts_total, no buffer-depth gauge — even thoughBrokerBufferOverflow/BrokerReconnectAttemptevents already fire at exactly the right places.Proposed behaviour
Add a common
{ kind: 'status', replyTo }command handled byBrokerActor, returning{ state, bufferSize, desiredSubscriptions, lastError }, and emit counters/gauges from the existing lifecycle hooks.Acceptance criteria
/healthcan report broker connectivity without app code.Related: #467, #440