From 5580980396650210f87b29a6bc9f45dd6861c353 Mon Sep 17 00:00:00 2001 From: Hui Kang Date: Sat, 21 Dec 2019 23:47:58 -0500 Subject: [PATCH] [#396] Fix missing span end in httptrace Signed-off-by: Hui Kang --- plugin/httptrace/clienttrace.go | 1 + plugin/httptrace/clienttrace_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/plugin/httptrace/clienttrace.go b/plugin/httptrace/clienttrace.go index 433b0ef88613..7e63cc84db7c 100644 --- a/plugin/httptrace/clienttrace.go +++ b/plugin/httptrace/clienttrace.go @@ -56,6 +56,7 @@ func NewClientTrace(ctx context.Context) *httptrace.ClientTrace { ct.tr = global.TraceProvider().Tracer("go.opentelemetry.io/otel/plugin/httptrace") ct.start("http.request", "http.request") + defer ct.end("http.request", nil) return &httptrace.ClientTrace{ GetConn: ct.getConn, diff --git a/plugin/httptrace/clienttrace_test.go b/plugin/httptrace/clienttrace_test.go index b32ac2e3a791..136a41e40d81 100644 --- a/plugin/httptrace/clienttrace_test.go +++ b/plugin/httptrace/clienttrace_test.go @@ -104,6 +104,9 @@ func TestHTTPRequestWithClientTrace(t *testing.T) { { name: "go.opentelemetry.io/otel/plugin/httptrace/http.receive", }, + { + name: "go.opentelemetry.io/otel/plugin/httptrace/http.request", + }, { name: "go.opentelemetry.io/otel/plugin/httptrace/http.send", },