Documentation ¶
Index ¶
Constants ¶
View Source
const OperationNameContextKey contextKey = 0
OperationNameContextKey specifies the operation name location within the context for instrumentation.
Variables ¶
This section is empty.
Functions ¶
func TimeRequest ¶
func TimeRequest(ctx context.Context, operation string, coll instrument.Collector, client Requester, request *http.Request) (*http.Response, error)
TimeRequest performs an HTTP client request and records the duration in a histogram.
func TimeRequestHistogram ¶
func TimeRequestHistogram(ctx context.Context, operation string, metric *prometheus.HistogramVec, client Requester, request *http.Request) (*http.Response, error)
TimeRequestHistogram performs an HTTP client request and records the duration in a histogram. Deprecated: try to use TimeRequest() to avoid creation of a collector on every request
Types ¶
type TimedClient ¶
type TimedClient struct {
// contains filtered or unexported fields
}
TimedClient instruments a request. It implements Requester.
func NewTimedClient ¶
func NewTimedClient(client Requester, collector instrument.Collector) *TimedClient
NewTimedClient creates a Requester that instruments requests on `client`.
Click to show internal directories.
Click to hide internal directories.