metrics

package
v1.6.2-rc Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RpcLatency the latency of rpc call.
	RpcLatency = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name: "rpc_latency_ms",
			Help: "cello rpc call latency in ms",
		},
		[]string{"rpc_api", "error"},
	)

	// ResourceManagerErr error counter of resource manager.
	ResourceManagerErr = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "resource_manager_error_count",
			Help: "The number of errors encountered in eni manager",
		},
		[]string{"fn", "error"},
	)
)
View Source
var (
	// OpenAPILatency latency of openapi call.
	OpenAPILatency = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name: "openapi_latency_ms",
			Help: "cello openapi call latency in ms",
		},
		[]string{"api", "error", "code", "requestId"},
	)

	// OpenAPIErr error counter of openapi call.
	OpenAPIErr = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "openapi_error_count",
			Help: "The number of times openapi returns an error",
		},
		[]string{"api", "error", "code", "requestId"},
	)

	// MetadataLatency latency of metadata call.
	MetadataLatency = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name: "metadata_latency_ms",
			Help: "cello metadata call latency in ms",
		},
		[]string{"metadata", "error", "status"},
	)

	// MetadataErr error counter of metadata call.
	MetadataErr = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "metadata_error_count",
			Help: "The number of times metadata returns an error",
		},
		[]string{"metadata", "error"},
	)
)
View Source
var (
	// ResourcePoolMaxCap Gauge of resource pool maximum capacity.
	ResourcePoolMaxCap = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "resource_pool_max_cap",
			Help: "The max capacity of resource pool"},
		[]string{"name", "type"},
	)

	// ResourcePoolTarget Gauge of resource pool target.
	ResourcePoolTarget = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "resource_pool_target",
			Help: "The cache target of resource pool"},
		[]string{"name", "type"},
	)

	// ResourcePoolTargetMin Gauge of resource pool targetMin.
	ResourcePoolTargetMin = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "resource_pool_target_min",
			Help: "The min cache target of resource pool"},
		[]string{"name", "type"},
	)

	// ResourcePoolTotal Gauge of total resources in resource pool.
	ResourcePoolTotal = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "resource_pool_total",
			Help: "The total number of resource in pool"},
		[]string{"name", "type"},
	)

	// ResourcePoolAvailable Gauge of available resources in resource pool.
	ResourcePoolAvailable = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "resource_pool_available",
			Help: "The available number of resource in pool"},
		[]string{"name", "type"},
	)
)

Functions

func CelloReqErrCode

func CelloReqErrCode(err error) string

CelloReqErrCode return error code of api request.

func CelloReqId

func CelloReqId(err error) string

CelloReqId return requestId of api request.

func MetadataErrInc

func MetadataErrInc(metadata string, err error)

MetadataErrInc help to increment count of MetadataErr.

func MsSince

func MsSince(start time.Time) float64

MsSince returns milliseconds since start.

func OpenAPIErrInc

func OpenAPIErrInc(api string, err error)

OpenAPIErrInc help to increment count of OpenAPIErr.

func PrometheusRegister

func PrometheusRegister()

func ResourceManagerErrInc

func ResourceManagerErrInc(fn string, err error)

func ServeMetrics

func ServeMetrics(serveMux *http.ServeMux)

ServeMetrics sets up cello metrics.

Types

type MetricEC2Wrapper

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

MetricEC2Wrapper wrapper the ec2.EC2 for metrics.

func NewMetricEC2Wrapper

func NewMetricEC2Wrapper(p ec2.EC2) *MetricEC2Wrapper

func (*MetricEC2Wrapper) AssignIpv6Addresses

func (*MetricEC2Wrapper) AssignPrivateIpAddress

func (*MetricEC2Wrapper) AttachNetworkInterface

func (*MetricEC2Wrapper) CreateNetworkInterface

func (*MetricEC2Wrapper) DeleteNetworkInterface

func (*MetricEC2Wrapper) DescribeInstanceTypes

func (*MetricEC2Wrapper) DescribeInstances

func (*MetricEC2Wrapper) DescribeNetworkInterfaces

func (*MetricEC2Wrapper) DescribeSubnetAttributes

func (*MetricEC2Wrapper) DescribeSubnets

func (*MetricEC2Wrapper) DetachNetworkInterface

func (*MetricEC2Wrapper) UnAssignPrivateIpAddress

func (*MetricEC2Wrapper) UnassignIpv6Addresses

Jump to

Keyboard shortcuts

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