metric

package
v1.3.0-policy Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// ENIIPAllocActionSucceed represents a succeeded ip alloc request
	ENIIPAllocActionSucceed = "succeed"
	// ENIIPAllocActionFail represents a failed ip alloc request
	ENIIPAllocActionFail = "fail"
)

Variables

View Source
var (
	// OpenAPILatency aliyun open api latency
	OpenAPILatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "aliyun_openapi_latency",
			Help:    "aliyun openapi latency in ms",
			Buckets: []float64{50, 100, 200, 400, 800, 1600, 3200, 6400, 12800, 13800, 14800, 16800, 20800, 28800, 44800},
		},
		[]string{"api", "error"},
	)
	// MetadataLatency aliyun metadata latency
	MetadataLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "aliyun_metadata_latency",
			Help:    "aliyun metadata latency in ms",
			Buckets: prometheus.ExponentialBuckets(1, 2, 10),
		},
		[]string{"url", "error"},
	)
)
View Source
var (
	// ENIIPFactoryENICount amount of allocated terway multi-ip factory eni
	ENIIPFactoryENICount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "terway_eniip_factory_eni_count",
			Help: "amount of allocated terway multi-ip factory eni",
		},
		[]string{"name", "max_eni"},
	)

	// ENIIPFactoryIPCount amount of allocated terway multi-ip secondary ip
	ENIIPFactoryIPCount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "terway_eniip_factory_ip_count",
			Help: "amount of allocated terway multi-ip secondary ip",
		},

		[]string{"name", "eni", "max_ip"},
	)

	// ENIIPFactoryIPAllocCount counter of eniip factory ip allocation
	ENIIPFactoryIPAllocCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "terway_eniip_factory_ip_alloc_count",
			Help: "counter of eniip factory ip allocation",
		},

		[]string{"eni", "status"},
	)
)
View Source
var (
	// ResourcePoolTotal terway total source amount in the pool
	ResourcePoolTotal = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "terway_resource_pool_total_count",
			Help: "terway total resources amount in the pool",
		},

		[]string{"name", "type", "capacity", "max_idle", "min_idle"},
	)

	// ResourcePoolIdle terway amount of idle resource in the pool
	ResourcePoolIdle = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "terway_resource_pool_idle_count",
			Help: "terway amount of idle resources in the pool",
		},
		[]string{"name", "type", "capacity", "max_idle", "min_idle"},
	)

	// ResourcePoolDisposed terway resource count of begin disposed
	ResourcePoolDisposed = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "terway_resource_pool_disposed_count",
			Help: "terway resource count of being disposed",
		},
		[]string{"name", "type", "capacity", "max_idle", "min_idle"},
	)
)
View Source
var (
	// RPCLatency terway grpc latency for grpc by cni binary
	RPCLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "terway_rpc_latency",
			Help:    "terway rpc latency in ms",
			Buckets: []float64{50, 100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 26600, 27600, 29600, 33600, 41600, 57600, 89600, 110000, 120000},
		},
		[]string{"rpc_api", "error"},
	)
)

Functions

func MsSince

func MsSince(start time.Time) float64

MsSince returns milliseconds since start.

func RegisterPrometheus

func RegisterPrometheus()

RegisterPrometheus register metrics to prometheus server

Types

This section is empty.

Jump to

Keyboard shortcuts

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