Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( APIRequestMetrics = &OpenstackMetrics{ Duration: metrics.NewHistogramVec( &metrics.HistogramOpts{ Name: "openstack_api_request_duration_seconds", Help: "Latency of an OpenStack API call", }, []string{"request"}), Total: metrics.NewCounterVec( &metrics.CounterOpts{ Name: "openstack_api_requests_total", Help: "Total number of OpenStack API calls", }, []string{"request"}), Errors: metrics.NewCounterVec( &metrics.CounterOpts{ Name: "openstack_api_request_errors_total", Help: "Total number of errors for an OpenStack API call", }, []string{"request"}), } )
Functions ¶
func RegisterMetrics ¶
func RegisterMetrics()
Types ¶
type MetricContext ¶
type MetricContext struct { Start time.Time Attributes []string Metrics *OpenstackMetrics }
MetricContext indicates the context for OpenStack metrics.
func NewMetricContext ¶
func NewMetricContext(resource string, request string) *MetricContext
NewMetricContext creates a new MetricContext.
func (*MetricContext) Observe ¶
func (mc *MetricContext) Observe(om *OpenstackMetrics, err error) error
ObserveRequest records the request latency and counts the errors.
func (*MetricContext) ObserveReconcile ¶
func (mc *MetricContext) ObserveReconcile(err error) error
ObserveReconcile records the request reconciliation duration
func (*MetricContext) ObserveRequest ¶
func (mc *MetricContext) ObserveRequest(err error) error
ObserveRequest records the request latency and counts the errors.
type OpenstackMetrics ¶
type OpenstackMetrics struct { Duration *metrics.HistogramVec Total *metrics.CounterVec Errors *metrics.CounterVec }
Click to show internal directories.
Click to hide internal directories.