Documentation ¶
Index ¶
- type Config
- type Recorder
- func (r *Recorder) AddInflightRequests(_ context.Context, id string, quantity int)
- func (r *Recorder) ObserveHTTPRequestDuration(_ context.Context, id string, duration time.Duration, method, code string)
- func (r *Recorder) ObserveHTTPResponseSize(_ context.Context, id string, responseSize int64, method, code string)
- func (r *Recorder) RegisterOn(registry prometheus.Registerer) metrics.Recorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Namespace is the prefix that will be set on the metrics, by default it will be empty. Namespace string // DurationBuckets are the buckets used by Prometheus for the HTTP request duration metrics, // by default uses Prometheus default buckets (from 5ms to 10s). DurationBuckets []float64 // SizeBuckets are the buckets used by Prometheus for the HTTP response size metrics, // by default uses a exponential buckets from 100B to 1GB. SizeBuckets []float64 // Registry is the registry that will be used by the recorder to store the metrics, // if the default registry is not used then it will use the default one. Registry prometheus.Registerer // IdentifierLabel is the name that will be set to the handler ID label, by default is `handler`. IdentifierLabel string // StatusCodeLabel is the name that will be set to the status code label, by default is `code`. StatusCodeLabel string // MethodLabel is the name that will be set to the method label, by default is `method`. MethodLabel string }
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func NewRecorder ¶
func (*Recorder) AddInflightRequests ¶
func (*Recorder) ObserveHTTPRequestDuration ¶
func (*Recorder) ObserveHTTPResponseSize ¶
func (*Recorder) RegisterOn ¶
func (r *Recorder) RegisterOn(registry prometheus.Registerer) metrics.Recorder
Click to show internal directories.
Click to hide internal directories.