mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-09-09 05:08:27 +00:00
1ba3e14b36
* feat: Initial OTEL metrics * docs: add metrics documentation * fix: metrics endpoint conditional check * feat: metrics endpoint basic auth * fix: make metrics-auth-enabled default false * fix: go fmt helpers.gen.go * fix: add metric-related env vars to envparsing.sh * fix: metrics docs * fix: metrics related stuff in envparsing.sh * fix: metrics docs * chore: metrics docs wording * fix: metrics stuff in envparsing? * bump otel versions --------- Co-authored-by: Tsuribori <user@acertaindebian> Co-authored-by: Tsuribori <none@example.org> Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
25 lines
985 B
Go
25 lines
985 B
Go
package otelginmetrics
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"go.opentelemetry.io/otel/attribute"
|
|
)
|
|
|
|
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)
|
|
}
|