Documentation ¶
Index ¶
- Variables
- func CreateMetricsListener(listeners *gracenet.Net, laddr string) (net.Listener, error)
- func GetMetricsDefaultAddress(runtimeType string) string
- func GetMetricsKnownAddresses(runtimeType string) []string
- func RegisterBuildInfo(buildType, buildTime, version string)
- func ServeMetrics(l net.Listener, ctx context.Context, config Config, log *zerolog.Logger) (err error)
- type Config
- type HistogramConfig
- type ReadyServer
Constants ¶
This section is empty.
Variables ¶
var Runtime = "host"
This variable is set at compile time to allow the default local address to change.
Functions ¶
func CreateMetricsListener ¶
CreateMetricsListener will create a new net.Listener by using an known set of ports when the default address is passed with the fallback of choosing a random port when none is available.
In case the provided address is not the default one then it will be used as is.
func GetMetricsKnownAddresses ¶
GetMetricsKnownAddresses returns the addresses used by the metrics server to bind at startup time to allow a semi-deterministic approach to know where the server is listening at. The ports were selected because at the time we are in 2024 and they do not collide with any know/registered port according https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers.
func RegisterBuildInfo ¶
func RegisterBuildInfo(buildType, buildTime, version string)
Types ¶
type Config ¶
type Config struct { ReadyServer *ReadyServer DiagnosticHandler *diagnostic.Handler QuickTunnelHostname string Orchestrator orchestrator ShutdownTimeout time.Duration }
type HistogramConfig ¶
type ReadyServer ¶
type ReadyServer struct {
// contains filtered or unexported fields
}
ReadyServer serves HTTP 200 if the tunnel can serve traffic. Intended for k8s readiness checks.
func NewReadyServer ¶
func NewReadyServer( clientID uuid.UUID, tracker *tunnelstate.ConnTracker, ) *ReadyServer
NewReadyServer initializes a ReadyServer and starts listening for dis/connection events.
func (*ReadyServer) ServeHTTP ¶
func (rs *ReadyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP responds with HTTP 200 if the tunnel is connected to the edge.