diff options
| author | 2023-05-12 14:33:40 +0200 | |
|---|---|---|
| committer | 2023-05-12 14:33:40 +0200 | |
| commit | ec325fee141c1e9757144a0a4094061b56839b78 (patch) | |
| tree | 2948ab4ef5702cc8478ab2be841340b946bdb867 /vendor/github.com/uptrace/bun/extra | |
| parent | [frogend/bugfix] fix dynamicSpoiler elements (#1771) (diff) | |
| download | gotosocial-ec325fee141c1e9757144a0a4094061b56839b78.tar.xz | |
[chore] Update a bunch of database dependencies (#1772)
* [chore] Update a bunch of database dependencies
* fix lil thing
Diffstat (limited to 'vendor/github.com/uptrace/bun/extra')
| -rw-r--r-- | vendor/github.com/uptrace/bun/extra/bunotel/otel.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vendor/github.com/uptrace/bun/extra/bunotel/otel.go b/vendor/github.com/uptrace/bun/extra/bunotel/otel.go index 25000307d..95ca2a2b1 100644 --- a/vendor/github.com/uptrace/bun/extra/bunotel/otel.go +++ b/vendor/github.com/uptrace/bun/extra/bunotel/otel.go @@ -10,6 +10,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/global" "go.opentelemetry.io/otel/metric/instrument" semconv "go.opentelemetry.io/otel/semconv/v1.12.0" @@ -75,7 +76,8 @@ func (h *QueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent) { } } - queryHistogram.Record(ctx, time.Since(event.StartTime).Milliseconds(), labels...) + dur := time.Since(event.StartTime) + queryHistogram.Record(ctx, dur.Milliseconds(), metric.WithAttributes(labels...)) span := trace.SpanFromContext(ctx) if !span.IsRecording() { |
