metrics

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Metrics *prometheus.Registry

	RunningWorkflows = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "running_workflows",
			Help: "Number of currently running workflows",
		},
	)

	PendingWorkflows = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "pending_workflows",
			Help: "Number of currently pending workflows",
		},
	)

	RequestTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "request_total",
			Help: "Number of requests",
		},
		[]string{"method", "handler", "status"},
	)

	CPU = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "cpu",
			Help: "CPU usage",
		},
		[]string{"service", "pod"},
	)

	Memory = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "memory",
			Help: "Memory usage",
		},
		[]string{"service", "pod"},
	)

	ResponseTime = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "api_response_time",
			Help:    "The API response time in seconds",
			Buckets: prometheus.LinearBuckets(0.2, 0.2, 10),
		},
		[]string{"method", "handler", "status"},
	)
)

Functions

func RegisterRequest

func RegisterRequest(startTime int64, method, handler string, status int)

func SetCPUUsage

func SetCPUUsage(serviceName, podName string, value int64)

func SetMemoryUsage

func SetMemoryUsage(serviceName, podName string, value int64)

func SetPendingWorkflows

func SetPendingWorkflows(value int64)

func SetRunningWorkflows

func SetRunningWorkflows(value int64)

func UpdatePodMetrics

func UpdatePodMetrics() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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