sidecar

package
v0.0.0-...-ecf1725 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SidecarAllInOneDownloadConfig = map[api.ResourceKind]bool{
	api.ResourceKindPod:  true,
	api.ResourceKindNode: false,
}

SidecarAllInOneDownloadConfig holds config information specifying whether given native Sidecar resource type supports list download.

Functions

func CreateSidecarClient

func CreateSidecarClient(host string, k8sClient kubernetes.Interface) (
	metricapi.MetricClient, error)

CreateSidecarClient creates new Sidecar client. When sidecarHost param is empty string the function assumes that it is running inside a Kubernetes cluster and connects via service proxy. sidecarHost param is in the format of protocol://address:port, e.g., http://localhost:8002.

func DataPointsFromMetricJSONFormat

func DataPointsFromMetricJSONFormat(raw []metricapi.MetricPoint) (dp metricapi.DataPoints)

DataPointsFromMetricJSONFormat converts all the data points from format used by sidecar to our format.

Types

type RequestInterface

type RequestInterface interface {
	DoRaw(context.Context) ([]byte, error)
	AbsPath(segments ...string) *rest.Request
}

RequestInterface is an interface that allows to make operations on pure request object. Separation is done to allow testing.

type SidecarRESTClient

type SidecarRESTClient interface {
	// Creates a new GET HTTP request to sidecar, specified by the path param, to the V1 API
	// endpoint. The path param is without the API prefix, e.g.,
	// /model/namespaces/default/pod-list/foo/metrics/memory-usage
	Get(path string) RequestInterface
	HealthCheck() error
}

SidecarRESTClient is used to make raw requests to sidecar.

Jump to

Keyboard shortcuts

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