cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.25k stars 1.1k forks source link

Support observe backend health status #225

Open vicanso opened 2 months ago

vicanso commented 2 months ago

What is the problem your feature solves, or the need it fulfills?

I want to get the status change of backend, and send a notification. Now it only prints a warn log. https://github.com/cloudflare/pingora/blob/main/pingora-load-balancing/src/lib.rs#L229, I can get status change from logger. Is it possible to support callback function to observe it?

Describe the solution you'd like

Supports to set callbacks like TlsAcceptCallbacks.

Describe alternatives you've considered

What other solutions, features, or workarounds have you considered that might also solve the issue? What are the tradeoffs for these alternatives compared to what you're proposing?

Additional context

This could include references to documentation or papers, prior art, screenshots, or benchmark results.