Documentation ¶
Index ¶
- func Middleware(service string, options ...Option) gin.HandlerFunc
- func SemVersion() string
- func Version() string
- type Option
- func WithAdditionalAttributes(attributes map[string]string) Option
- func WithGroupedStatusDisabled() Option
- func WithRecordDurationDisabled(recordDuration bool) Option
- func WithRecordInFlightDisabled(recordInFlight bool) Option
- func WithRecordSizeDisabled(recordSize bool) Option
- func WithRecorder(recorder Recorder) Option
- type Recorder
- type RequestURLLabelMappingFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(service string, options ...Option) gin.HandlerFunc
Middleware returns middleware that will trace incoming requests. The service parameter should describe the name of the (virtual) server handling the request.
func SemVersion ¶
func SemVersion() string
SemVersion is the semantic version to be supplied to tracer/meter creation.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option applies a configuration to the given config
func WithAdditionalAttributes ¶
WithAdditionalAttributes sets a list of attribute.KeyValue labels for all metrics associated with this round tripper
func WithGroupedStatusDisabled ¶
func WithGroupedStatusDisabled() Option
WithGroupedStatus determines whether to group the response status codes or not. If true 2xx, 3xx will be stored By default the groupedStatus is true
func WithRecordDurationDisabled ¶
WithRecordDuration determines whether to record Duration of Requests or not By default the recordDuration is true
func WithRecordInFlightDisabled ¶
WithRecordInFlight determines whether to record In Flight Requests or not By default the recordInFlight is true
func WithRecordSizeDisabled ¶
WithRecordSize determines whether to record Size of Requests and Responses or not By default the recordSize is true
func WithRecorder ¶
type Recorder ¶
type Recorder interface { // AddRequests increments the number of requests being processed. AddRequests(ctx context.Context, quantity int64, attributes []attribute.KeyValue) // ObserveHTTPRequestDuration measures the duration of an HTTP request. ObserveHTTPRequestDuration(ctx context.Context, duration time.Duration, attributes []attribute.KeyValue) // ObserveHTTPRequestSize measures the size of an HTTP request in bytes. ObserveHTTPRequestSize(ctx context.Context, sizeBytes int64, attributes []attribute.KeyValue) // ObserveHTTPResponseSize measures the size of an HTTP response in bytes. ObserveHTTPResponseSize(ctx context.Context, sizeBytes int64, attributes []attribute.KeyValue) // AddInflightRequests increments and decrements the number of inflight request being processed. AddInflightRequests(ctx context.Context, quantity int64, attributes []attribute.KeyValue) }