diff --git a/otelfiber/fiber.go b/otelfiber/fiber.go index 19f6e716..8e2ceba1 100644 --- a/otelfiber/fiber.go +++ b/otelfiber/fiber.go @@ -87,7 +87,8 @@ func Middleware(opts ...Option) fiber.Handler { start := time.Now() requestMetricsAttrs := httpServerMetricAttributesFromRequest(c, cfg) - httpServerActiveRequests.Add(savedCtx, 1, requestMetricsAttrs...) + + httpServerActiveRequests.Add(savedCtx, 1, instrument.AddOption{}.applyAdd(instrument.AddConfig{attrs: requestMetricsAttrs})) responseMetricAttrs := make([]attribute.KeyValue, len(requestMetricsAttrs)) copy(responseMetricAttrs, requestMetricsAttrs) @@ -136,7 +137,7 @@ func Middleware(opts ...Option) fiber.Handler { responseMetricAttrs, responseAttrs...) - httpServerActiveRequests.Add(savedCtx, -1, requestMetricsAttrs...) + httpServerActiveRequests.Add(savedCtx, -1, instrument.AddOption{}.applyAdd(instrument.AddConfig{attrs: requestMetricsAttrs})) httpServerDuration.Record(savedCtx, float64(time.Since(start).Microseconds())/1000, responseMetricAttrs...) httpServerRequestSize.Record(savedCtx, requestSize, responseMetricAttrs...) httpServerResponseSize.Record(savedCtx, responseSize, responseMetricAttrs...)