metrics

package
v0.0.0-...-02374a7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label keys
	StatusKey    string = "status"
	FormatKey    string = "format"
	ConnErrorKey string = "connection_error"
	TypeKey      string = "type"

	// Label values
	TotalsVal      string = "total"
	ErrorVal       string = "error"
	KeyNotFoundVal string = "key_not_found"
	MissingKeyVal  string = "missing_key"
	BadRequestVal  string = "bad_request"
	JsonVal        string = "json"
	XmlVal         string = "xml"
	CustomKey      string = "custom_key"
	InvFormatVal   string = "invalid_format"
	CloseVal       string = "close"
	AcceptVal      string = "accept"

	// Metric names
	PutRequestMet  string = "puts_request"
	PutReqDurMet   string = "puts_request_duration"
	GetRequestMet  string = "gets_request"
	GetReqDurMet   string = "gets_request_duration"
	PutBackendMet  string = "puts_backend"
	PutBackDurMet  string = "puts_backend_duration"
	PutBackSizeMet string = "puts_backend_request_size_bytes"
	PutTTLSeconds  string = "puts_backend_request_ttl"
	GetBackendMet  string = "gets_backend"
	GetBackendErr  string = "gets_backend_error"
	GetBackDurMet  string = "gets_backend_duration"
	ConnOpenedMet  string = "connection_opened"
	ConnClosedMet  string = "connection_closed"

	MetricsPrometheus = "Prometheus"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PrometheusConnectionMetrics

type PrometheusConnectionMetrics struct {
	ConnectionsErrors *prometheus.CounterVec
	ConnectionsClosed prometheus.Counter
	ConnectionsOpened prometheus.Counter
}

type PrometheusMetrics

func CreatePrometheusMetrics

func CreatePrometheusMetrics(cfg config.PrometheusMetrics) *PrometheusMetrics

func (PrometheusMetrics) Export

func (m PrometheusMetrics) Export(cfg config.Metrics)

func (*PrometheusMetrics) GetEngineRegistry

func (m *PrometheusMetrics) GetEngineRegistry() interface{}

func (*PrometheusMetrics) GetMetricsEngineName

func (m *PrometheusMetrics) GetMetricsEngineName() string

func (*PrometheusMetrics) RecordAcceptConnectionErrors

func (m *PrometheusMetrics) RecordAcceptConnectionErrors()

func (*PrometheusMetrics) RecordCloseConnectionErrors

func (m *PrometheusMetrics) RecordCloseConnectionErrors()

func (*PrometheusMetrics) RecordConnectionClosed

func (m *PrometheusMetrics) RecordConnectionClosed()

func (*PrometheusMetrics) RecordConnectionOpen

func (m *PrometheusMetrics) RecordConnectionOpen()

func (*PrometheusMetrics) RecordGetBackendBadRequest

func (m *PrometheusMetrics) RecordGetBackendBadRequest()

func (*PrometheusMetrics) RecordGetBackendDuration

func (m *PrometheusMetrics) RecordGetBackendDuration(duration time.Duration)

func (*PrometheusMetrics) RecordGetBackendError

func (m *PrometheusMetrics) RecordGetBackendError()

func (*PrometheusMetrics) RecordGetBackendTotal

func (m *PrometheusMetrics) RecordGetBackendTotal()

func (*PrometheusMetrics) RecordGetBadRequest

func (m *PrometheusMetrics) RecordGetBadRequest()

func (*PrometheusMetrics) RecordGetDuration

func (m *PrometheusMetrics) RecordGetDuration(duration time.Duration)

func (*PrometheusMetrics) RecordGetError

func (m *PrometheusMetrics) RecordGetError()

func (*PrometheusMetrics) RecordGetTotal

func (m *PrometheusMetrics) RecordGetTotal()

func (*PrometheusMetrics) RecordKeyNotFoundError

func (m *PrometheusMetrics) RecordKeyNotFoundError()

func (*PrometheusMetrics) RecordMissingKeyError

func (m *PrometheusMetrics) RecordMissingKeyError()

func (*PrometheusMetrics) RecordPutBackendDuration

func (m *PrometheusMetrics) RecordPutBackendDuration(duration time.Duration)

func (*PrometheusMetrics) RecordPutBackendError

func (m *PrometheusMetrics) RecordPutBackendError()

func (*PrometheusMetrics) RecordPutBackendInvalid

func (m *PrometheusMetrics) RecordPutBackendInvalid()

func (*PrometheusMetrics) RecordPutBackendJson

func (m *PrometheusMetrics) RecordPutBackendJson()

func (*PrometheusMetrics) RecordPutBackendSize

func (m *PrometheusMetrics) RecordPutBackendSize(sizeInBytes float64)

func (*PrometheusMetrics) RecordPutBackendTTLSeconds

func (m *PrometheusMetrics) RecordPutBackendTTLSeconds(duration time.Duration)

func (*PrometheusMetrics) RecordPutBackendXml

func (m *PrometheusMetrics) RecordPutBackendXml()

func (*PrometheusMetrics) RecordPutBadRequest

func (m *PrometheusMetrics) RecordPutBadRequest()

func (*PrometheusMetrics) RecordPutDuration

func (m *PrometheusMetrics) RecordPutDuration(duration time.Duration)

func (*PrometheusMetrics) RecordPutError

func (m *PrometheusMetrics) RecordPutError()

func (*PrometheusMetrics) RecordPutKeyProvided

func (m *PrometheusMetrics) RecordPutKeyProvided()

func (*PrometheusMetrics) RecordPutTotal

func (m *PrometheusMetrics) RecordPutTotal()

type PrometheusRequestStatusMetric

type PrometheusRequestStatusMetric struct {
	Duration      prometheus.Histogram
	RequestStatus *prometheus.CounterVec
	ErrorsByType  *prometheus.CounterVec
}

type PrometheusRequestStatusMetricByFormat

type PrometheusRequestStatusMetricByFormat struct {
	Duration           prometheus.Histogram
	PutBackendRequests *prometheus.CounterVec
	RequestLength      prometheus.Histogram
	RequestTTLDuration prometheus.Histogram
}

Jump to

Keyboard shortcuts

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