metrics

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 9 Imported by: 9

Documentation

Index

Constants

View Source
const (
	LabelServerNode = "polaris_server_instance"
	LabelNamespace  = "namespace"
	LabelService    = "service"
	LabelGroup      = "group"
	LabelVersion    = "version"
	LabelApi        = "api"
	LabelApiType    = "api_type"
	LabelProtocol   = "protocol"
	LabelErrCode    = "err_code"
)
View Source
const (
	ActionGetConfigFile           = "GET_CONFIG_FILE"
	ActionListConfigFiles         = "LIST_CONFIG_FILES"
	ActionListConfigGroups        = "LIST_CONFIG_GROUPS"
	ActionPublishConfigFile       = "PUBLISH_CONFIG_FILE"
	ActionDiscoverInstance        = "DISCOVER_INSTANCE"
	ActionDiscoverServices        = "DISCOVER_SERVICES"
	ActionDiscoverRouterRule      = "DISCOVER_ROUTER_RULE"
	ActionDiscoverRateLimit       = "DISCOVER_RATE_LIMIT"
	ActionDiscoverCircuitBreaker  = "DISCOVER_CIRCUIT_BREAKER"
	ActionDiscoverFaultDetect     = "DISCOVER_FAULT_DETECT"
	ActionDiscoverServiceContract = "DISCOVER_SERVICE_CONTRACT"
)

Variables

This section is empty.

Functions

func AddConfigurationClientConn added in v1.14.0

func AddConfigurationClientConn()

AddConfigurationClientConn add configuration client connection number

func AddDiscoveryClientConn added in v1.14.0

func AddDiscoveryClientConn()

AddDiscoveryClientConn add discovery client connection number

func AddSDKClientConn added in v1.15.0

func AddSDKClientConn()

AddSDKClientConn add client connection number

func GetClientInstanceTotal added in v1.15.1

func GetClientInstanceTotal() prometheus.Gauge

func GetConfigFileTotal added in v1.15.1

func GetConfigFileTotal() *prometheus.GaugeVec

func GetConfigGroupTotal added in v1.15.1

func GetConfigGroupTotal() *prometheus.GaugeVec

func GetHttpHandler

func GetHttpHandler() http.Handler

GetHttpHandler 获取 handler

func GetInstanceAbnormalCountl added in v1.15.1

func GetInstanceAbnormalCountl() *prometheus.GaugeVec

func GetInstanceCount added in v1.15.1

func GetInstanceCount() *prometheus.GaugeVec

func GetInstanceIsolateCountl added in v1.15.1

func GetInstanceIsolateCountl() *prometheus.GaugeVec

func GetInstanceOnlineCountl added in v1.15.1

func GetInstanceOnlineCountl() *prometheus.GaugeVec

func GetMetricsPort added in v1.14.0

func GetMetricsPort() int32

func GetRegistry

func GetRegistry() *prometheus.Registry

GetRegistry 获取 metrics 的 registry

func GetReleaseConfigFileTotal added in v1.15.1

func GetReleaseConfigFileTotal() *prometheus.GaugeVec

func GetServiceAbnormalCountl added in v1.15.1

func GetServiceAbnormalCountl() *prometheus.GaugeVec

func GetServiceCount added in v1.15.1

func GetServiceCount() *prometheus.GaugeVec

func GetServiceOfflineCountl added in v1.15.1

func GetServiceOfflineCountl() *prometheus.GaugeVec

func GetServiceOnlineCountl added in v1.15.1

func GetServiceOnlineCountl() *prometheus.GaugeVec

func InitMetrics

func InitMetrics()

InitMetrics 初始化 metrics 的所有指标

func RecordCacheUpdateCost added in v1.14.2

func RecordCacheUpdateCost(cost time.Duration, cacheTye string, total int64)

RecordCacheUpdateCost record per cache update cost time

func RemoveConfigurationClientConn added in v1.14.0

func RemoveConfigurationClientConn()

RemoveConfigurationClientConn remove configuration client connection number

func RemoveDiscoveryClientConn added in v1.14.0

func RemoveDiscoveryClientConn()

RemoveDiscoveryClientConn remove discovery client connection number

func RemoveSDKClientConn added in v1.15.0

func RemoveSDKClientConn()

RemoveSDKClientConn remove client connection number

func ReportAddBatchJob added in v1.17.2

func ReportAddBatchJob(label string, count int64)

ReportAddBatchJob .

func ReportDropInstanceRegisTask

func ReportDropInstanceRegisTask()

ReportDropInstanceRegisTask Record the number of registered tasks discarded

func ReportFinishBatchJob added in v1.17.2

func ReportFinishBatchJob(label string, count int64)

ReportFinishBatchJob .

func ReportInstanceRegisCost

func ReportInstanceRegisCost(cost time.Duration)

ReportInstanceRegisCost Total time to report the short-term registered task of the reporting instance

func ReportRedisIsAlive added in v1.14.0

func ReportRedisIsAlive()

ReportRedisIsAlive report redis alive status is health

func ReportRedisIsDead added in v1.14.0

func ReportRedisIsDead()

ReportRedisIsDead report redis alive status is dead

func ReportRedisReadFailure added in v1.14.0

func ReportRedisReadFailure()

ReportRedisReadFailure report redis exec read operatio failure

func ReportRedisWriteFailure added in v1.14.0

func ReportRedisWriteFailure()

ReportRedisWriteFailure report redis exec write operatio failure

func ResetConfigurationClientConn added in v1.14.0

func ResetConfigurationClientConn()

ResetConfigurationClientConn reset configuration client connection number

func ResetDiscoveryClientConn added in v1.14.0

func ResetDiscoveryClientConn()

ResetDiscoveryClientConn reset discovery client connection number

func ResetSDKClientConn added in v1.15.0

func ResetSDKClientConn()

Conn reset client connection number

func ResourceOfConfigFile added in v1.18.0

func ResourceOfConfigFile(group, name string) string

func ResourceOfConfigFileList added in v1.18.0

func ResourceOfConfigFileList(group string) string

func SetMetricsPort added in v1.14.0

func SetMetricsPort(port int32)

Types

type CallMetric added in v1.15.0

type CallMetric struct {
	Type             CallMetricType
	API              string
	Protocol         string
	Code             int
	Times            int
	Success          bool
	Duration         time.Duration
	Labels           map[string]string
	TrafficDirection TrafficDirection
}

func (CallMetric) GetLabels added in v1.15.0

func (m CallMetric) GetLabels() map[string]string

type CallMetricType added in v1.15.0

type CallMetricType string

CallMetricType .

const (
	// SystemCallMetric Time consuming statistics of some asynchronous tasks inside
	SystemCallMetric CallMetricType = "system"
	// ServerCallMetric Apiserver-layer interface call consumption statistics
	ServerCallMetric CallMetricType = "api"
	// RedisCallMetric Redis call time consumption statistics
	RedisCallMetric CallMetricType = "redis"
	// StoreCallMetric Store call time consumption statistics
	StoreCallMetric CallMetricType = "store"
	// ProtobufCacheCallMetric PB encode cache call/hit statistics
	ProtobufCacheCallMetric CallMetricType = "pbCacheCall"
	// XDSResourceBuildCallMetric
	XDSResourceBuildCallMetric CallMetricType = "xds"
)

type ClientDiscoverMetric added in v1.18.0

type ClientDiscoverMetric struct {
	ClientIP  string
	Action    string
	Namespace string
	Resource  string
	Revision  string
	Timestamp int64
	CostTime  int64
	Success   bool
}

func (ClientDiscoverMetric) String added in v1.18.0

func (c ClientDiscoverMetric) String() string

type ConfigMetricType added in v1.15.0

type ConfigMetricType string
const (
	ConfigGroupMetric ConfigMetricType = "config_group"
	FileMetric        ConfigMetricType = "file"
	ReleaseFileMetric ConfigMetricType = "release_file"
)

type ConfigMetrics added in v1.15.0

type ConfigMetrics struct {
	Type    ConfigMetricType
	Total   int64
	Release int64
	Labels  map[string]string
}

type DiscoveryMetric added in v1.15.0

type DiscoveryMetric struct {
	Type     DiscoveryMetricType
	Total    int64
	Abnormal int64
	Offline  int64
	Online   int64
	Isolate  int64
	Labels   map[string]string
}

type DiscoveryMetricType added in v1.15.0

type DiscoveryMetricType string
const (
	ClientMetrics   DiscoveryMetricType = "client"
	ServiceMetrics  DiscoveryMetricType = "service"
	InstanceMetrics DiscoveryMetricType = "instance"
)

type TrafficDirection added in v1.18.0

type TrafficDirection string
const (
	// TrafficDirectionInBound .
	TrafficDirectionInBound TrafficDirection = "INBOUND"
	// TrafficDirectionOutBound .
	TrafficDirectionOutBound TrafficDirection = "OUTBOUND"
)

Jump to

Keyboard shortcuts

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