NuRaft icon indicating copy to clipboard operation
NuRaft copied to clipboard

Monitoring data exposed for cluster?

Open lingpeng0314 opened this issue 2 years ago • 4 comments

Does Nuraft have any monitoring data exposed to monitor the status of raft quorum? like Prometheus format metrics or some events?

lingpeng0314 avatar Jun 08 '22 03:06 lingpeng0314

NuRaft has its own stats defined like this https://github.com/eBay/NuRaft/blob/9d7c4cb04d0fe0e18e6b2ae4fbef503bfa7da8f0/src/buffer.cxx#L89-L96

and then gathered like this https://github.com/eBay/NuRaft/blob/9d7c4cb04d0fe0e18e6b2ae4fbef503bfa7da8f0/tests/unit/asio_service_test.cxx#L2573-L2580

but not that many. If you want to export metrics to external components like Prometheus, you can put it in your event callbacks, state machine, or log store code. In eBay, we are reporting Raft-related metrics to Prometheus in that way.

greensky00 avatar Jun 09 '22 16:06 greensky00

@greensky00 I see. Thanks for reply.

lingpeng0314 avatar Jun 15 '22 05:06 lingpeng0314

@greensky00 The metrics you exported are in project Jungle? i didn't find related code block in repo. want to have an sample.

lingpeng0314 avatar Jun 15 '22 05:06 lingpeng0314

Jungle is another building block that is used for implementing log store and state machine. Metrics are defined in the upper layer that is using NuRaft and Jungle as a component, but that is not open-sourced.

greensky00 avatar Jun 16 '22 16:06 greensky00