kubernetes: k8s.io/kubernetes/test/e2e/instrumentation/monitoring Index | Files

package monitoring

import "k8s.io/kubernetes/test/e2e/instrumentation/monitoring"


Package Files

accelerator.go custom_metrics_deployments.go custom_metrics_stackdriver.go metrics_grabber.go stackdriver.go stackdriver_metadata_agent.go


const (

    // MonitoringScope is the scope for Stackdriver Metadata API
    MonitoringScope = "https://www.googleapis.com/auth/monitoring"


var (
    CustomMetricName = "foo"

    UnusedMetricName = "unused"

    CustomMetricValue = int64(448)

    UnusedMetricValue = int64(446)

    StackdriverExporter = "stackdriver-exporter"

    HPAPermissions = &rbacv1.ClusterRoleBinding{
        ObjectMeta: metav1.ObjectMeta{
            Name: "custom-metrics-reader",
        RoleRef: rbacv1.RoleRef{
            APIGroup: "rbac.authorization.k8s.io",
            Kind:     "ClusterRole",
            Name:     "system:controller:horizontal-pod-autoscaler",
        Subjects: []rbacv1.Subject{
                APIGroup: "rbac.authorization.k8s.io",
                Kind:     "Group",
                Name:     "system:unauthenticated",

    StagingDeploymentsLocation = "" /* 129 byte string literal not displayed */

    AdapterForOldResourceModel = "adapter_old_resource_model.yaml"

    AdapterForNewResourceModel = "adapter_new_resource_model.yaml"

    AdapterDefault = AdapterForOldResourceModel

    ClusterAdminBinding = "e2e-test-cluster-admin-binding"

func CleanupAdapter Uses

func CleanupAdapter(adapterDeploymentFile string)

CleanupAdapter deletes Custom Metrics - Stackdriver adapter deployments.

func CleanupDescriptors Uses

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

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

func CreateAdapter Uses

func CreateAdapter(adapterDeploymentFile string) error

CreateAdapter creates Custom Metrics - Stackdriver adapter adapterDeploymentFile should be a filename for adapter deployment located in StagingDeploymentLocation

func CreateDescriptors Uses

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

CreateDescriptors creates descriptors for metrics: CustomMetricName and UnusedMetricName.

func PrometheusExporterDeployment Uses

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

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

func SimpleStackdriverExporterDeployment Uses

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

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

func StackdriverExporterDeployment Uses

func StackdriverExporterDeployment(name, namespace string, replicas int32, containers []CustomMetricContainerSpec) *appsv1.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 Uses

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

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

type CustomMetricContainerSpec Uses

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 Uses

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

Metadata has the information fetched from Stackdriver metadata API.

type Resource Uses

type Resource struct {
    // contains filtered or unexported fields

Resource contains the resource type and labels from Stackdriver metadata API.

Package monitoring imports 40 packages (graph) and is imported by 131 packages. Updated 2020-11-21. Refresh now. Tools for package owners.