internal

package
v1.59.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MetricsStatePathToRoot = "prometheusMetricsAdapter.internal.customMetrics"

	ClusteredPart  = "cluster"
	NamespacedPart = "namespaced"
)
View Source
const (
	MetricDaemonSet   = "daemonset"
	MetricDeployment  = "deployment"
	MetricIngress     = "ingress"
	MetricNamespace   = "namespace"
	MetricPod         = "pod"
	MetricService     = "service"
	MetricStatefulSet = "statefulset"
)

Variables

View Source
var AllMetricsTypes = map[string]string{
	MetricDaemonSet:   "DaemonSet",
	MetricDeployment:  "Deployment",
	MetricIngress:     "Ingress",
	MetricNamespace:   "Namespace",
	MetricPod:         "Pod",
	MetricService:     "Service",
	MetricStatefulSet: "StatefulSet",
}

AllMetricsTypes type (in lower case) => kind

Functions

func ExtractMetricTypeFromKind

func ExtractMetricTypeFromKind(kind string) (string, error)

func MetricsTypesForNsAndCluster

func MetricsTypesForNsAndCluster() map[string]string

Types

type CustomMetric

type CustomMetric struct {
	Type      string
	Namespace string
	Name      string
	Query     string
}

type MetricsQueriesState

type MetricsQueriesState struct {
	State map[string]map[string]interface{}
}

MetricsQueriesState Examples for full path namespaced

prometheusMetricsAdapter.internal.customMetrics.pod.name.namespaced.ns1

cluster

prometheusMetricsAdapter.internal.customMetrics.pod.name.cluster

in this state we have all keys after 'customMetrics' we collect all current metrics and replace 'customMetrics' 'customMetrics' is map which should have (metric type) 'pod, ingress... etc' keys in constructor we create it

func NewMetricsQueryValues

func NewMetricsQueryValues() *MetricsQueriesState

func (*MetricsQueriesState) AddMetric

func (s *MetricsQueriesState) AddMetric(m *CustomMetric)

Jump to

Keyboard shortcuts

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