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 ContainerNamerInfo provided", ContainerMetricType) NotMatchPodError = fmt.Errorf("metric type %v, but no PodNamerInfo provided", PodMetricType) NotMatchNodeError = fmt.Errorf("metric type %v, but no NodeNamerInfo provided", NodeMetricType) NotMatchPromError = fmt.Errorf("metric type %v, but no PromNamerInfo provided", PromQLMetricType) )
Functions ¶
This section is empty.
Types ¶
type ContainerNamerInfo ¶
type GenericQuery ¶ added in v0.6.0
type GenericQuery struct {
Metric *Metric
}
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 MetricSource ¶
type MetricSource string
const ( PrometheusMetricSource MetricSource = "prom" MetricServerMetricSource MetricSource = "metricserver" GrpcMetricSource MetricSource = "grpc" )
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
GenericQuery *GenericQuery
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.