metrics

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const EnvPodIP = "POD_IP"

Variables

View Source
var (
	DummyRegistry  = prometheus.NewRegistry()
	DetailRegistry = prometheus.NewRegistry()
	Registry       = prometheus.NewRegistry()
	Prefix         = "model_csi_"
)
View Source
var (
	NodeNotReady = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: Prefix + "node_not_ready",
		},
	)

	NodeOpFailed = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: Prefix + "node_op_failed",
		},
		[]string{opLabel},
	)

	NodeOpSucceed = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: Prefix + "node_op_succeed",
		},
		[]string{opLabel},
	)

	NodePullLayerTooLong = prometheus.NewCounter(
		prometheus.CounterOpts{
			Name: Prefix + "node_pull_layer_too_long",
		},
	)

	NodeOpLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:    Prefix + "node_op_latency_in_seconds",
		Buckets: LatencyInSecondsBuckets,
	}, []string{opLabel})

	NodePullOpLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:    Prefix + "node_pull_op_latency_in_seconds",
		Buckets: LatencyInSecondsBuckets,
	}, []string{opLabel, sizeLabel})

	NodeCacheSizeInBytes = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: Prefix + "node_cache_size_in_bytes",
		},
	)

	NodeMountedStaticImages = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: Prefix + "node_mounted_static_images",
		},
	)

	NodeMountedDynamicImages = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: Prefix + "node_mounted_dynamic_images",
		},
	)

	ControllerOpFailed = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: Prefix + "controller_op_failed",
		},
		[]string{opLabel},
	)

	ControllerOpSucceed = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: Prefix + "controller_op_succeed",
		},
		[]string{opLabel},
	)

	ControllerOpLatency = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:    Prefix + "controller_op_latency_in_seconds",
		Buckets: LatencyInSecondsBuckets,
	}, []string{opLabel})
)
View Source
var LatencyInSecondsBuckets = prometheus.ExponentialBuckets(1, 2, 16)
View Source
var SizeInMBBuckets = prometheus.ExponentialBuckets(1, 2, 24)

Functions

func ControllerOpObserve

func ControllerOpObserve(op string, start time.Time, err error)

func GetAddrByEnv

func GetAddrByEnv(addr string, local bool) string

func NodeOpObserve

func NodeOpObserve(op string, start time.Time, err error)

func NodePullOpObserve

func NodePullOpObserve(op string, size int64, start time.Time, err error)

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(addr string) (*Server, error)

func (*Server) Serve

func (s *Server) Serve(stop <-chan struct{})

Jump to

Keyboard shortcuts

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