From dcdc4c2e2d880e849737665937b8eb30432a9cff Mon Sep 17 00:00:00 2001 From: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com> Date: Thu, 1 Aug 2024 19:13:57 +0200 Subject: [PATCH] Update instrumentation/net/http/otelhttp/internal/semconv/env.go Co-authored-by: Tyler Yahn --- instrumentation/net/http/otelhttp/internal/semconv/env.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/net/http/otelhttp/internal/semconv/env.go b/instrumentation/net/http/otelhttp/internal/semconv/env.go index 3318b116b91..aedf7dfbfa5 100644 --- a/instrumentation/net/http/otelhttp/internal/semconv/env.go +++ b/instrumentation/net/http/otelhttp/internal/semconv/env.go @@ -95,7 +95,7 @@ type MetricData struct { } func (s HTTPServer) RecordMetrics(ctx context.Context, md MetricData) { - if s.requestBytesCounter == nil { + if s.requestBytesCounter == nil || s.responseBytesCounter == nil || s.serverLatencyMeasure == nil { // This will happen if an HTTPServer{} is used insted of NewHTTPServer. return }