Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NotMatchWorkloadError = fmt.Errorf("metric type %v, but no WorkloadNamerInfo provided", WorkloadMetricType) NotMatchContainerError = fmt.Errorf("metric type %v, but no WorkloadNamerInfo provided", ContainerMetricType) NotMatchPodError = fmt.Errorf("metric type %v, but no WorkloadNamerInfo provided", PodMetricType) NotMatchNodeError = fmt.Errorf("metric type %v, but no WorkloadNamerInfo provided", NodeMetricType) NotMatchPromError = fmt.Errorf("metric type %v, but no WorkloadNamerInfo provided", PromQLMetricType) )
Functions ¶
This section is empty.
Types ¶
type ContainerNamerInfo ¶
type Metric ¶
type Metric struct { Type MetricType // such as cpu/memory, or http_requests MetricName string // Workload only support for MetricName cpu/memory Workload *WorkloadNamerInfo // Container only support for MetricName cpu/memory Container *ContainerNamerInfo // Pod only support for MetricName cpu/memory Pod *PodNamerInfo // Node only support for MetricName cpu/memory Node *NodeNamerInfo // Prom can support any MetricName, user give the promQL Prom *PromNamerInfo }
func (*Metric) BuildUniqueKey ¶
func (*Metric) ValidateMetric ¶
type MetricServerQuery ¶
type MetricServerQuery struct {
Metric *Metric
}
MetricServerQuery is used to do query for metric server
type MetricSource ¶
type MetricSource string
const ( PrometheusMetricSource MetricSource = "prom" MetricServerMetricSource MetricSource = "metricserver" )
type MetricType ¶
type MetricType string
const ( WorkloadMetricType MetricType = "workload" PodMetricType MetricType = "pod" ContainerMetricType MetricType = "container" NodeMetricType MetricType = "node" PromQLMetricType MetricType = "promql" )
type NodeNamerInfo ¶
type PodNamerInfo ¶
type PromNamerInfo ¶
type PrometheusQuery ¶
type PrometheusQuery struct {
Query string
}
PrometheusQuery is used to do query for prometheus
type Query ¶
type Query struct { Type MetricSource MetricServer *MetricServerQuery Prometheus *PrometheusQuery }
Query is used to do query for different data source. you can extends it with your data source query
Click to show internal directories.
Click to hide internal directories.