monitoring

package
v1.10.7 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Scope for Stackdriver Metadata API
	MonitoringScope = "https://www.googleapis.com/auth/monitoring"
)

Variables

View Source
var (
	CustomMetricName    = "foo"
	UnusedMetricName    = "unused"
	CustomMetricValue   = int64(448)
	UnusedMetricValue   = int64(446)
	StackdriverExporter = "stackdriver-exporter"
	// HPAPermissions is a ClusterRoleBinding that grants unauthenticated user permissions granted for
	// HPA for testing purposes, i.e. it should grant permission to read custom metrics.
	HPAPermissions = &rbac.ClusterRoleBinding{
		ObjectMeta: metav1.ObjectMeta{
			Name: "custom-metrics-reader",
		},
		RoleRef: rbac.RoleRef{
			APIGroup: "rbac.authorization.k8s.io",
			Kind:     "ClusterRole",
			Name:     "system:controller:horizontal-pod-autoscaler",
		},
		Subjects: []rbac.Subject{
			{
				APIGroup: "rbac.authorization.k8s.io",
				Kind:     "Group",
				Name:     "system:unauthenticated",
			},
		},
	}
)

Functions

func CheckCadvisorHealthOnAllNodes

func CheckCadvisorHealthOnAllNodes(c clientset.Interface, timeout time.Duration)

func CleanupAdapter added in v1.9.0

func CleanupAdapter() error

CleanupAdapter deletes Custom Metrics - Stackdriver adapter deployments.

func CleanupDescriptors added in v1.9.0

func CleanupDescriptors(service *gcm.Service, projectId string)

CleanupDescriptors deletes descriptors for metrics: CustomMetricName and UnusedMetricName. TODO: Cleanup time series as well

func CreateAdapter added in v1.9.0

func CreateAdapter() error

CreateAdapter creates Custom Metrics - Stackdriver adapter.

func CreateDescriptors added in v1.9.0

func CreateDescriptors(service *gcm.Service, projectId string) error

CreateDescriptors creates descriptors for metrics: CustomMetricName and UnusedMetricName.

func PrometheusExporterDeployment added in v1.10.0

func PrometheusExporterDeployment(name, namespace string, replicas int32, metricValue int64) *extensions.Deployment

PrometheusExporterDeployment is a Deployment of simple application with two containers one exposing a metric in prometheus fromat and second a prometheus-to-sd container that scrapes the metric and pushes it to stackdriver.

func Query

func Query(c clientset.Interface, query string) (*influxdb.Response, error)

Query sends a command to the server and returns the Response

func SimpleStackdriverExporterDeployment added in v1.10.0

func SimpleStackdriverExporterDeployment(name, namespace string, replicas int32, metricValue int64) *extensions.Deployment

SimpleStackdriverExporterDeployment is a Deployment of simple application that exports a metric of fixed value to Stackdriver in a loop.

func StackdriverExporterDeployment added in v1.9.0

func StackdriverExporterDeployment(name, namespace string, replicas int32, containers []CustomMetricContainerSpec) *extensions.Deployment

StackdriverExporterDeployment is a Deployment of an application that can expose an arbitrary amount of metrics of fixed value to Stackdriver in a loop. Each metric is exposed by a different container in one pod. The metric names and values are configured via the containers parameter.

func StackdriverExporterPod added in v1.9.0

func StackdriverExporterPod(podName, namespace, podLabel, metricName string, metricValue int64) *corev1.Pod

StackdriverExporterPod is a Pod of simple application that exports a metric of fixed value to Stackdriver in a loop.

Types

type CustomMetricContainerSpec added in v1.10.0

type CustomMetricContainerSpec struct {
	Name        string
	MetricName  string
	MetricValue int64
}

CustomMetricContainerSpec allows to specify a config for StackdriverExporterDeployment with multiple containers exporting different metrics.

type Metadata added in v1.10.0

type Metadata struct {
	Results []map[string]interface{}
}

type Resource added in v1.10.0

type Resource struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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