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 ¶
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 ¶ 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.
type OpenstackPrometheusMetrics ¶
type OpenstackPrometheusMetrics struct { Duration *prometheus.HistogramVec Total *prometheus.CounterVec Errors *prometheus.CounterVec }
Click to show internal directories.
Click to hide internal directories.