connect icon indicating copy to clipboard operation
connect copied to clipboard

`nats_jetstream` output does not detect disconnect

Open njkleiner opened this issue 1 year ago • 0 comments

The nats_jetstream output does not appear to implement logic for detecting that a message publishing failure is caused by the connection to the NATS server having been lost. Consequently, according to the Prometheus metrics and the /ready health check endpoint, the output continues to appear as "up", which is clearly wrong.

From taking a quick look at the code, it would appear that fixing this is as simple as inspecting the error returned here after a message could not be published and conditionally returning service.ErrNotConnected.

Note that the nats output already appears to implement this logic, so I'm assuming this is simply an oversight and not intended behavior.

njkleiner avatar Mar 11 '25 15:03 njkleiner