hashicorp/raft

Improve observability by adding opentracing and/or structured logging

Closed this issue · 4 comments

The current use of stdlib's log.Logger for emitting events is not very convenient with regard to observability/tracing.

Some ideas for improving this aspect would be:

  • Add opentracing support (e.g. by adding a Config.Tracer configuration option and instrumenting the code accordingly)

  • Replace stdlib's log.Logger with hclog.Logger (backward-compatibility with Config.Logger and Config.LogOutput should not be too hard)

  • Add more events that can be observed with raft.Observer (as per #249)

Is there interest for any of the above? I could work on that if desired.

Hi @freeekanayaka ! This issue resurfaced in #320 , but I wanted to add a little context over here for clarity. Your right, the lib could benefit from increased traceability. Leveled logging would definitely help. The second option you provide is perfect I think: we'd greatly appreciate a PR to use hclog.Logger as long as it's backwards-compatible.
Thank you for your insights. I'll have to think more about the other two suggestions as well.

Hello @RobbieMcKinstry, unfortunately I'm not using hashicorp/raft anymore, because I had to switch to a C implementation of raft (see here). So I'll have to backtrack on this proposal, hope somebody else can pick it up.

Thanks for letting me know! Sad to see you go, but that's looks like a cool C implementation!

Closing this issue as it was resolved by #321