-
Notifications
You must be signed in to change notification settings - Fork 1
/
recorder.go
27 lines (20 loc) · 1.09 KB
/
recorder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package ginprometheus
import (
"context"
"go.opentelemetry.io/otel/attribute"
"time"
)
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)
// ObserveSystemMetric measures the cpu and memory usage
ObserveSystemMetric(ctx context.Context, attributes []attribute.KeyValue)
}