From 49c8ba44841a705c3c721d1f81f93909eac56b09 Mon Sep 17 00:00:00 2001 From: Huy Vo Date: Wed, 26 May 2021 16:35:52 -0700 Subject: [PATCH 1/4] Fix quick start bug within the awsxrayreceiver --- receiver/awsxrayreceiver/receiver.go | 1 + 1 file changed, 1 insertion(+) diff --git a/receiver/awsxrayreceiver/receiver.go b/receiver/awsxrayreceiver/receiver.go index 26710e5a0af9..c7f68a575590 100644 --- a/receiver/awsxrayreceiver/receiver.go +++ b/receiver/awsxrayreceiver/receiver.go @@ -117,6 +117,7 @@ func (x *xrayReceiver) Shutdown(_ context.Context) error { func (x *xrayReceiver) start() { incomingSegments := x.poller.SegmentsChan() for seg := range incomingSegments { + x.obsrecv.StartTraceDataReceiveOp(seg.Ctx) traces, totalSpansCount, err := translator.ToTraces(seg.Payload) if err != nil { x.logger.Warn("X-Ray segment to OT traces conversion failed", zap.Error(err)) From 4e75568f4cbdb1801dbaf93104eea009a6b95636 Mon Sep 17 00:00:00 2001 From: Huy Vo Date: Wed, 26 May 2021 16:42:37 -0700 Subject: [PATCH 2/4] Assign ctx to the return --- receiver/awsxrayreceiver/receiver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/awsxrayreceiver/receiver.go b/receiver/awsxrayreceiver/receiver.go index c7f68a575590..86d8b7ff1864 100644 --- a/receiver/awsxrayreceiver/receiver.go +++ b/receiver/awsxrayreceiver/receiver.go @@ -117,7 +117,7 @@ func (x *xrayReceiver) Shutdown(_ context.Context) error { func (x *xrayReceiver) start() { incomingSegments := x.poller.SegmentsChan() for seg := range incomingSegments { - x.obsrecv.StartTraceDataReceiveOp(seg.Ctx) + seg.Ctx = x.obsrecv.StartTraceDataReceiveOp(seg.Ctx) traces, totalSpansCount, err := translator.ToTraces(seg.Payload) if err != nil { x.logger.Warn("X-Ray segment to OT traces conversion failed", zap.Error(err)) From 03fce51e44849e2a71540695472691d1bdd05c46 Mon Sep 17 00:00:00 2001 From: Huy Vo Date: Thu, 27 May 2021 09:52:09 -0700 Subject: [PATCH 3/4] Fix context --- receiver/awsxrayreceiver/receiver.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/receiver/awsxrayreceiver/receiver.go b/receiver/awsxrayreceiver/receiver.go index 86d8b7ff1864..841c8dcfc9b0 100644 --- a/receiver/awsxrayreceiver/receiver.go +++ b/receiver/awsxrayreceiver/receiver.go @@ -117,20 +117,20 @@ func (x *xrayReceiver) Shutdown(_ context.Context) error { func (x *xrayReceiver) start() { incomingSegments := x.poller.SegmentsChan() for seg := range incomingSegments { - seg.Ctx = x.obsrecv.StartTraceDataReceiveOp(seg.Ctx) + ctx := x.obsrecv.StartTraceDataReceiveOp(seg.Ctx) traces, totalSpansCount, err := translator.ToTraces(seg.Payload) if err != nil { x.logger.Warn("X-Ray segment to OT traces conversion failed", zap.Error(err)) - x.obsrecv.EndTraceDataReceiveOp(seg.Ctx, awsxray.TypeStr, totalSpansCount, err) + x.obsrecv.EndTraceDataReceiveOp(ctx, awsxray.TypeStr, totalSpansCount, err) continue } - err = x.consumer.ConsumeTraces(seg.Ctx, *traces) + err = x.consumer.ConsumeTraces(ctx, *traces) if err != nil { x.logger.Warn("Trace consumer errored out", zap.Error(err)) - x.obsrecv.EndTraceDataReceiveOp(seg.Ctx, awsxray.TypeStr, totalSpansCount, err) + x.obsrecv.EndTraceDataReceiveOp(ctx, awsxray.TypeStr, totalSpansCount, err) continue } - x.obsrecv.EndTraceDataReceiveOp(seg.Ctx, awsxray.TypeStr, totalSpansCount, nil) + x.obsrecv.EndTraceDataReceiveOp(ctx, awsxray.TypeStr, totalSpansCount, nil) } } From 9d184bd55740afde5f7105bd7691b62534c49e91 Mon Sep 17 00:00:00 2001 From: Huy Vo Date: Tue, 1 Jun 2021 08:24:44 -0700 Subject: [PATCH 4/4] Fix start tracing func name --- receiver/awsxrayreceiver/receiver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/receiver/awsxrayreceiver/receiver.go b/receiver/awsxrayreceiver/receiver.go index 5d3d0246aeca..297653b4a910 100644 --- a/receiver/awsxrayreceiver/receiver.go +++ b/receiver/awsxrayreceiver/receiver.go @@ -117,7 +117,7 @@ func (x *xrayReceiver) Shutdown(_ context.Context) error { func (x *xrayReceiver) start() { incomingSegments := x.poller.SegmentsChan() for seg := range incomingSegments { - ctx := x.obsrecv.StartTraceDataReceiveOp(seg.Ctx) + ctx := x.obsrecv.StartTracesOp(seg.Ctx) traces, totalSpansCount, err := translator.ToTraces(seg.Payload) if err != nil { x.logger.Warn("X-Ray segment to OT traces conversion failed", zap.Error(err))