Documentation
¶
Overview ¶
Package client provides clients for the per-AgentSet metrics daemon. The controller (or any other in-cluster caller) uses one of these to talk to a daemon without caring whether transport is gRPC or REST.
Two clients are available:
gRPC — preferred for in-cluster calls. NewGRPCClient(address)
REST — useful for debugging with curl-friendly clients. NewRESTClient(address)
Both satisfy DaemonClient and accept addresses in the form "host:port" (the REST client prepends "https://" if missing).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DaemonClient ¶
type DaemonClient interface {
io.Closer
// GetAgentDeployMetrics fetches the current windowed metrics for
// the named AgentDeploy. A non-zero lookbackSeconds adds a
// "custom" window in the response (clamped to the daemon's
// retention).
GetAgentDeployMetrics(ctx context.Context, name string, lookbackSeconds int64) (*pb.AgentDeployMetrics, error)
}
DaemonClient is the controller-facing surface of the metrics daemon. Both NewGRPCClient and NewRESTClient return a DaemonClient so callers can pick a transport without changing call sites.
func NewGRPCClient ¶
func NewGRPCClient(address string) (DaemonClient, error)
NewGRPCClient dials address (host:port) with TLS skip-verify and returns a DaemonClient. Close the client when done to release the underlying connection.
func NewRESTClient ¶
func NewRESTClient(address string) (DaemonClient, error)
NewRESTClient builds a REST DaemonClient targeting address (host:port or full URL). If no scheme is present, "https://" is assumed — the daemon only listens on TLS.