Documentation ¶
Index ¶
- Constants
- func GetContainerCpuUsageQueryExp(namespace string, workloadName string, kind string, containerName string, ...) string
- func GetContainerMemUsageQueryExp(namespace string, workloadName string, kind string, containerName string, ...) string
- func GetExtraFilters(extraFilters string, baseFilter string) string
- type PromDatasource
Constants ¶
View Source
const ( // ContainerCpuUsageQueryExpr is used to query container cpu usage by promql ContainerCpuUsageQueryExpr = `rate(container_cpu_usage_seconds_total{container!="POD",namespace="%s",pod=~"%s",container="%s"%s}[30s])` // ContainerMemUsageQueryExpr is used to query container cpu usage by promql ContainerMemUsageQueryExpr = `container_memory_working_set_bytes{container!="POD",namespace="%s",pod=~"%s",container="%s"%s}` )
View Source
const (
WorkloadSuffixRuleForDeployment = `[a-z0-9]+-[a-z0-9]{5}$`
)
Variables ¶
This section is empty.
Functions ¶
func GetExtraFilters ¶
Types ¶
type PromDatasource ¶
type PromDatasource interface { datasource.Datasource GetPromClient() promapiv1.API }
func NewPrometheus ¶
func NewPrometheus(config *datasourceprometheus.PromConfig) (PromDatasource, error)
NewPrometheus return a prometheus data source
Click to show internal directories.
Click to hide internal directories.