metrics

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 8 Imported by: 13

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"
	DownstreamRequest200Total    = "request_200_total"
	DownstreamRequest206Total    = "request_206_total"
	DownstreamRequest302Total    = "request_302_total"
	DownstreamRequest304Total    = "request_304_total"
	DownstreamRequest400Total    = "request_400_total"
	DownstreamRequest403Total    = "request_403_total"
	DownstreamRequest404Total    = "request_404_total"
	DownstreamRequest416Total    = "request_416_total"
	DownstreamRequest499Total    = "request_499_total"
	DownstreamRequest500Total    = "request_500_total"
	DownstreamRequest502Total    = "request_502_total"
	DownstreamRequest503Total    = "request_503_total"
	DownstreamRequest504Total    = "request_504_total"
	DownstreamRequestOtherTotal  = "request_other_code"
)

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 (
	CdsUpdateSuccessTotal = "cds_update_success"
	CdsUpdateRejectTotal  = "cds_update_reject"
	LdsUpdateSuccessTotal = "ls_update_success"
	LdsUpdateRejectTotal  = "lds_update_reject"
)

metrics key in listener/proxy

View Source
const DownstreamType = "downstream"

DownstreamType represents downstream metrics type

View Source
const HealthCheckType = "healthcheck"

HealthCheckType represents health check metrics type

View Source
const MaxLabelCount = 20
View Source
const MosnMetaType = "meta"

MosnMetaType represents mosn basic metrics type

View Source
const (
	TLSConnpoolChanged = "connpool_changed"
)

tls metrics key

View Source
const TLSType = "mosn_tls"

TLSType represents tls metrics type

View Source
const UpstreamType = "upstream"

UpstreamType represents upstream metrics type

View Source
const XdsType = "xds"

DownstreamType represents downstream metrics type

Variables

View Source
var (
	// FlushMosnMetrics marks output mosn information metrics or not, default is false
	FlushMosnMetrics bool

	// LazyFlushMetrics marks flush data with lazy mode
	LazyFlushMetrics bool
)
View Source
var (
	ErrLabelCountExceeded = fmt.Errorf("label count exceeded, max is %d", MaxLabelCount)
)

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 GetMetricsFilter added in v0.18.0

func GetMetricsFilter(filter string) (metrics types.Metrics)

filter is type.labels see example in `GetProxyTotal`

func GetProxyTotal added in v0.14.0

func GetProxyTotal() (metrics types.Metrics)

GetProxyTotal returns proxy global 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 NewLazyCounter added in v0.20.0

func NewLazyCounter(ctor func() gometrics.Counter) (gometrics.Counter, error)

NewLazyCounter build lazyCounter

func NewLazyGauge added in v0.20.0

func NewLazyGauge(ctor func() gometrics.Gauge) (gometrics.Gauge, error)

NewLazyGauge build lazyGauge

func NewLazyHistogram added in v0.20.0

func NewLazyHistogram(ctor func() gometrics.Histogram) (gometrics.Histogram, error)

NewLazyHistogram build lazyHistogram

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 NewTLSStats added in v0.14.0

func NewTLSStats(name string) types.Metrics

NewTLSStats returns a TLSMetrics named ${name}

func NewXdsStats added in v0.14.0

func NewXdsStats() types.Metrics

NewXdsStats 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 SetMetricsFeature added in v0.20.0

func SetMetricsFeature(flushMosn, lazyFlush bool)

SetMetricsFeature enabled metrics feature

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