Documentation ¶
Index ¶
- func RegisterAPIPrometheusMetrics()
- type MetricPrometheusContext
- func (mc *MetricPrometheusContext) Observe(om *OpenstackPrometheusMetrics, err error) error
- func (mc *MetricPrometheusContext) ObserveRequest(err error) error
- func (mc *MetricPrometheusContext) ObserveRequestIgnoreNotFound(err error) error
- func (mc *MetricPrometheusContext) ObserveRequestIgnoreNotFoundorConflict(err error) error
- type OpenstackPrometheusMetrics
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 ¶
func (mc *MetricPrometheusContext) Observe(om *OpenstackPrometheusMetrics, err error) error
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 }
Click to show internal directories.
Click to hide internal directories.