Help us shape the future of Go! Take the 2026 Go Developer Survey

metrics

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAPIPrometheusMetrics

func RegisterAPIPrometheusMetrics()

Types

type MetricPrometheusContext

type MetricPrometheusContext struct {
	Start      time.Time
	Attributes []string
	Metrics    *OpenstackPrometheusMetrics
}

MetricPrometheusContext indicates the context for OpenStack metrics.

func NewMetricPrometheusContext

func NewMetricPrometheusContext(resource string, request string) *MetricPrometheusContext

NewMetricPrometheusContext creates a new MetricContext.

func (*MetricPrometheusContext) Observe

Observe records the request latency and counts the errors.

func (*MetricPrometheusContext) ObserveRequest

func (mc *MetricPrometheusContext) ObserveRequest(err error) error

ObserveRequest records the request latency and counts the errors.

func (*MetricPrometheusContext) ObserveRequestIgnoreNotFound

func (mc *MetricPrometheusContext) ObserveRequestIgnoreNotFound(err error) error

ObserveRequestIgnoreNotFound records the request latency and counts the errors if it's not IsNotFound.

func (*MetricPrometheusContext) ObserveRequestIgnoreNotFoundorConflict

func (mc *MetricPrometheusContext) ObserveRequestIgnoreNotFoundorConflict(err error) error

ObserveRequestIgnoreNotFoundorConflict records the request latency and counts the errors if it's not IsNotFound or IsConflict.

type OpenstackPrometheusMetrics

type OpenstackPrometheusMetrics struct {
	Duration *prometheus.HistogramVec
	Total    *prometheus.CounterVec
	Errors   *prometheus.CounterVec
}

Jump to

Keyboard shortcuts

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