Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RequestPath is the path in the microVM hosting remote snapshotter metrics. RequestPath = "http://localhost/metrics" // MaxMetricsResponseSize is the limit in bytes for size of a metrics response from a remote snapshotter. MaxMetricsResponseSize = 32768 // 32 KB )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
HTTPClient defines the interface for the client getting metrics.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor is used for port and lifecycle management of metrics proxies.
func NewMonitor ¶
NewMonitor returns a new metrics proxy monitor.
type Proxy ¶
type Proxy struct { // Port is the port that the metrics proxy server listens on. Port int // Labels are labels used to apply to metrics. Labels map[string]string // contains filtered or unexported fields }
Proxy represents a metrics proxy server for getting and serving remote snapshotter metrics.
func NewProxy ¶
func NewProxy(host string, monitor *Monitor, labels map[string]string, dialer func(context.Context, string, string) (net.Conn, error)) (*Proxy, error)
NewProxy creates a new Proxy with initialized HTTP client and port. dialer is used as the DialContext underlying the metrics HTTP client's RoundTripper.
Reference: https://pkg.go.dev/net/http#Transport
Click to show internal directories.
Click to hide internal directories.