framework

package
v2.0.0-beta.0...-3bc1883 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL