prometheus

package
v0.5.16 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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 GetContainerCpuUsageQueryExp

func GetContainerCpuUsageQueryExp(namespace string, workloadName string, kind string, containerName string, extraFilters string) string

func GetContainerMemUsageQueryExp

func GetContainerMemUsageQueryExp(namespace string, workloadName string, kind string, containerName string, extraFilters string) string

func GetExtraFilters

func GetExtraFilters(extraFilters string, baseFilter string) string

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

Jump to

Keyboard shortcuts

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