Documentation ¶
Index ¶
- Constants
- Variables
- func AddListenerAddr(addr string)
- func GetAll() (metrics []types.Metrics)
- func NewClusterStats(clusterName string) types.Metrics
- func NewHealthStats(serviceName string) types.Metrics
- func NewHostStats(clusterName string, addr string) types.Metrics
- func NewListenerStats(listenerName string) types.Metrics
- func NewMetrics(typ string, labels map[string]string) (types.Metrics, error)
- func NewMosnMetrics() types.Metrics
- func NewNilMetrics(typ string, labels map[string]string) (types.Metrics, error)
- func NewProxyStats(proxyName string) types.Metrics
- func ResetAll()
- func SetGoVersion(version string)
- func SetStateCode(code int64)
- func SetStatsMatcher(all bool, exclusionLabels, exclusionKeys []string)
- func SetVersion(version string)
- type NilMetrics
- func (m *NilMetrics) Counter(key string) gometrics.Counter
- func (m *NilMetrics) Each(f func(string, interface{}))
- func (m *NilMetrics) Gauge(key string) gometrics.Gauge
- func (m *NilMetrics) Histogram(key string) gometrics.Histogram
- func (s NilMetrics) Labels() map[string]string
- func (s NilMetrics) SortedLabels() (keys, values []string)
- func (s NilMetrics) Type() string
- func (m *NilMetrics) UnregisterAll()
Constants ¶
const ( DownstreamConnectionTotal = "connection_total" DownstreamConnectionDestroy = "connection_destroy" DownstreamConnectionActive = "connection_active" DownstreamBytesReadTotal = "bytes_read_total" DownstreamBytesReadBuffered = "bytes_read_buffered" DownstreamBytesWriteTotal = "bytes_write_total" DownstreamBytesWriteBuffered = "bytes_write_buffered" DownstreamRequestTotal = "request_total" DownstreamRequestActive = "request_active" DownstreamRequestReset = "request_reset" DownstreamRequestTime = "request_time" DownstreamRequestTimeTotal = "request_time_total" DownstreamProcessTime = "process_time" DownstreamProcessTimeTotal = "process_time_total" DownstreamRequestFailed = "request_failed" )
metrics key in listener/proxy
const ( HealthCheckAttempt = "attempt" HealthCheckSuccess = "success" HealthCheckFailure = "failure" HealthCheckActiveFailure = "active_failure" HealthCheckPassiveFailure = "passive_failure" HealthCheckNetworkFailure = "network_failure" HealthCheckVeirfyCluster = "verify_cluster" HealthCheckHealthy = "healty" )
health check metrics key
const ( GoVersion = "go_version:" Version = "version:" ListenerAddr = "listener_address:" StateCode = "mosn_state_code" )
mosn basic info metrics
const ( UpstreamConnectionTotal = "connection_total" UpstreamConnectionClose = "connection_close" UpstreamConnectionActive = "connection_active" UpstreamConnectionConFail = "connection_con_fail" UpstreamConnectionRetry = "connection_retry" UpstreamConnectionLocalClose = "connection_local_close" UpstreamConnectionRemoteClose = "connection_remote_close" UpstreamConnectionLocalCloseWithActiveRequest = "connection_local_close_with_active_request" UpstreamConnectionRemoteCloseWithActiveRequest = "connection_remote_close_with_active_request" UpstreamConnectionCloseNotify = "connection_close_notify" UpstreamRequestTotal = "request_total" UpstreamRequestActive = "request_active" UpstreamRequestLocalReset = "request_local_reset" UpstreamRequestRemoteReset = "request_remote_reset" UpstreamRequestTimeout = "request_timeout" UpstreamRequestFailureEject = "request_failure_eject" UpstreamRequestPendingOverflow = "request_pending_overflow" UpstreamRequestDuration = "request_duration_time" UpstreamRequestDurationTotal = "request_duration_time_total" UpstreamResponseSuccess = "response_success" UpstreamResponseFailed = "response_failed" )
key in cluster/host
const ( UpstreamRequestRetry = "request_retry" UpstreamRequestRetryOverflow = "request_retry_overflow" UpstreamLBSubSetsFallBack = "lb_subsets_fallback" UpstreamLBSubsetsCreated = "lb_subsets_created" UpstreamBytesReadTotal = "connection_bytes_read_total" UpstreamBytesReadBuffered = "connection_bytes_read_buffered" UpstreamBytesWriteTotal = "connection_bytes_write" UpstreamBytesWriteBuffered = "connection_bytes_write_buffered" )
key in cluster
const DownstreamType = "downstream"
DownstreamType represents downstream metrics type
const HealthCheckType = "healthcheck"
HealthCheckType represents health check metrics type
const MosnMetaType = "meta"
MosnMetaType represents mosn basic metrics type
const UpstreamType = "upstream"
UpstreamType represents upstream metrics type
Variables ¶
var FlushMosnMetrics bool
FlushMosnMetrics marks output mosn information metrics or not, default is false
Functions ¶
func NewClusterStats ¶
NewClusterStats returns a stats with namespace prefix cluster
func NewHealthStats ¶
NewHealthStats returns a stats with namespace prefix service
func NewHostStats ¶
NewHostStats returns a stats that namespace contains cluster and host address
func NewListenerStats ¶
NewListenerStats returns a stats with namespace prefix listsener
func NewMetrics ¶
NewMetrics returns a metrics Same (type + labels) pair will leading to the same Metrics instance
func NewMosnMetrics ¶
NewMosnMetrics returns the basic metrics for mosn export the function for extension multiple calls will only make a metrics object
func NewNilMetrics ¶
func NewProxyStats ¶
NewProxyStats returns a stats with namespace prefix proxy
func ResetAll ¶
func ResetAll()
ResetAll is only for test and internal usage. DO NOT use this if not sure.
func SetStatsMatcher ¶
SetStatsMatcher sets the exclusion labels and exclusion keys if a metrics labels/keys contains in exclusions, it will be ignored
Types ¶
type NilMetrics ¶
type NilMetrics struct {
// contains filtered or unexported fields
}
NilMetrics is an implementation of types.Metrics it stores nothing except the metrics type and labels
func (*NilMetrics) Each ¶
func (m *NilMetrics) Each(f func(string, interface{}))
func (NilMetrics) SortedLabels ¶
func (s NilMetrics) SortedLabels() (keys, values []string)
func (*NilMetrics) UnregisterAll ¶
func (m *NilMetrics) UnregisterAll()