metrics

package
v0.0.0-...-e3e1183 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
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

View Source
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

View Source
const (
	GoVersion    = "go_version:"
	Version      = "version:"
	ListenerAddr = "listener_address:"
	StateCode    = "mosn_state_code"
)

mosn basic info metrics

View Source
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

View Source
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

View Source
const DownstreamType = "downstream"

DownstreamType represents downstream metrics type

View Source
const HealthCheckType = "healthcheck"

HealthCheckType represents health check metrics type

View Source
const MosnMetaType = "meta"

MosnMetaType represents mosn basic metrics type

View Source
const UpstreamType = "upstream"

UpstreamType represents upstream metrics type

Variables

View Source
var FlushMosnMetrics bool

FlushMosnMetrics marks output mosn information metrics or not, default is false

Functions

func AddListenerAddr

func AddListenerAddr(addr string)

AddListenerAddr adds a listener addr info

func GetAll

func GetAll() (metrics []types.Metrics)

GetAll returns all metrics data

func NewClusterStats

func NewClusterStats(clusterName string) types.Metrics

NewClusterStats returns a stats with namespace prefix cluster

func NewHealthStats

func NewHealthStats(serviceName string) types.Metrics

NewHealthStats returns a stats with namespace prefix service

func NewHostStats

func NewHostStats(clusterName string, addr string) types.Metrics

NewHostStats returns a stats that namespace contains cluster and host address

func NewListenerStats

func NewListenerStats(listenerName string) types.Metrics

NewListenerStats returns a stats with namespace prefix listsener

func NewMetrics

func NewMetrics(typ string, labels map[string]string) (types.Metrics, error)

NewMetrics returns a metrics Same (type + labels) pair will leading to the same Metrics instance

func NewMosnMetrics

func NewMosnMetrics() types.Metrics

NewMosnMetrics returns the basic metrics for mosn export the function for extension multiple calls will only make a metrics object

func NewNilMetrics

func NewNilMetrics(typ string, labels map[string]string) (types.Metrics, error)

func NewProxyStats

func NewProxyStats(proxyName string) types.Metrics

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 SetGoVersion

func SetGoVersion(version string)

SetGoVersion set the go version

func SetStateCode

func SetStateCode(code int64)

SetStateCode set the mosn's running state's code

func SetStatsMatcher

func SetStatsMatcher(all bool, exclusionLabels, exclusionKeys []string)

SetStatsMatcher sets the exclusion labels and exclusion keys if a metrics labels/keys contains in exclusions, it will be ignored

func SetVersion

func SetVersion(version string)

SetVersion set the mosn's version

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) Counter

func (m *NilMetrics) Counter(key string) gometrics.Counter

func (*NilMetrics) Each

func (m *NilMetrics) Each(f func(string, interface{}))

func (*NilMetrics) Gauge

func (m *NilMetrics) Gauge(key string) gometrics.Gauge

func (*NilMetrics) Histogram

func (m *NilMetrics) Histogram(key string) gometrics.Histogram

func (NilMetrics) Labels

func (s NilMetrics) Labels() map[string]string

func (NilMetrics) SortedLabels

func (s NilMetrics) SortedLabels() (keys, values []string)

func (NilMetrics) Type

func (s NilMetrics) Type() string

func (*NilMetrics) UnregisterAll

func (m *NilMetrics) UnregisterAll()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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