metrics

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 3

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

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

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

func (*MetricPrometheusContext) ObserveRequestIgnoreNotFoundorConflict added in v0.5.0

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