From 4659839201854a52564fee05445f5b5f1a6ba65c Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Tue, 8 Jan 2019 11:06:12 +0000 Subject: [PATCH] Dont flag context.Canceled as an error in tracing Cancellations are always caused by something else, so having them show up as errors in the tracing UI is distracting. --- instrument/instrument.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/instrument/instrument.go b/instrument/instrument.go index 2994544c..2b6168d4 100644 --- a/instrument/instrument.go +++ b/instrument/instrument.go @@ -152,7 +152,9 @@ func CollectedRequest(ctx context.Context, method string, col Collector, toStatu col.After(method, toStatusCode(err), start) if err != nil { - ext.Error.Set(sp, true) + if err != context.Canceled { + ext.Error.Set(sp, true) + } sp.LogFields(otlog.Error(err)) } sp.Finish()