Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Framework ¶
type Framework struct {
KsmClient *KSMClient
}
The Framework stores a pointer to the KSMClient
func New ¶
func New(ksmHTTPMetricsURL, ksmTelemetryURL string) (*Framework, error)
New returns a new Framework given the kube-state-metrics service URLs. It delegates the url validation errs to NewKSMClient func.
func (*Framework) ParseMetrics ¶
func (f *Framework) ParseMetrics(metrics func(io.Writer) error) (map[string]*dto.MetricFamily, error)
ParseMetrics uses a prometheus TextParser to parse metrics, given a function that fetches and writes metrics.
type KSMClient ¶
type KSMClient struct {
// contains filtered or unexported fields
}
The KSMClient is the Kubernetes State Metric client.
func NewKSMClient ¶
func NewKSMClient(ksmHTTPMetricsAddress, ksmTelemetryAddress string) (*KSMClient, error)
NewKSMClient retrieves a new KSMClient the kube-state-metrics service URLs. In case of error parsing the provided addresses, it returns an error.
func (*KSMClient) IsHealthz ¶
func (k *KSMClient) IsHealthz() (bool, error)
IsHealthz makes a request to the /healthz endpoint to get the health status.
func (*KSMClient) Metrics ¶
func (k *KSMClient) Metrics(w io.Writer) error
Metrics makes a request to the /metrics endpoint on the "http-metrics" port, and writes its content to the writer w.
func (*KSMClient) TelemetryMetrics ¶
func (k *KSMClient) TelemetryMetrics(w io.Writer) error
TelemetryMetrics makes a request to the /metrics endpoint on the "telemetry" port, and writes its content to the writer w.