From 045fb26c1cca8ebbca1dbf67f92a87e386d75789 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 26 May 2021 16:37:01 -0700 Subject: [PATCH] Remove Receive from obsreport.Receiver funcs Signed-off-by: Bogdan Drutu --- obsreport/doc.go | 4 +- obsreport/obsreport_receiver.go | 92 ++++++------------- obsreport/obsreport_test.go | 16 ++-- obsreport/obsreporttest/obsreporttest_test.go | 12 +-- receiver/jaegerreceiver/trace_receiver.go | 14 +-- receiver/kafkareceiver/kafka_receiver.go | 8 +- .../ocmetrics/opencensus.go | 4 +- .../opencensusreceiver/octrace/opencensus.go | 4 +- receiver/otlpreceiver/logs/otlp.go | 4 +- receiver/otlpreceiver/metrics/otlp.go | 4 +- receiver/otlpreceiver/trace/otlp.go | 4 +- .../internal/transaction.go | 8 +- receiver/scraperhelper/scrapercontroller.go | 4 +- receiver/zipkinreceiver/trace_receiver.go | 4 +- 14 files changed, 73 insertions(+), 109 deletions(-) diff --git a/obsreport/doc.go b/obsreport/doc.go index 42798d83628..cbbbc339d9a 100644 --- a/obsreport/doc.go +++ b/obsreport/doc.go @@ -23,10 +23,10 @@ // being received, ie.: // // * TraceData receive operations should use the pair: -// StartTraceDataReceiveOp/EndTraceDataReceiveOp +// StartTracesOp/EndTracesOp // // * Metrics receive operations should use the pair: -// StartMetricsReceiveOp/EndMetricsReceiveOp +// StartMetricsOp/EndMetricsOp // // Similar for exporters: // diff --git a/obsreport/obsreport_receiver.go b/obsreport/obsreport_receiver.go index 3a1c7485774..e17b224fdea 100644 --- a/obsreport/obsreport_receiver.go +++ b/obsreport/obsreport_receiver.go @@ -51,7 +51,7 @@ type StartReceiveOption func(*StartReceiveOptions) // for { // // Since the context outlives the individual receive operations call obsreport using // // WithLongLivedCtx(). -// ctx := obsreport.StartTraceDataReceiveOp( +// ctx := obsreport.StartTracesOp( // longLivedCtx, // r.config.Name(), // r.transport, @@ -62,7 +62,7 @@ type StartReceiveOption func(*StartReceiveOptions) // if ok { // err = r.nextConsumer.ConsumeTraces(ctx, td) // } -// obsreport.EndTraceDataReceiveOp( +// obsreport.EndTracesOp( // ctx, // r.format, // len(td.Spans), @@ -99,94 +99,58 @@ func NewReceiver(cfg ReceiverSettings) *Receiver { } } -// StartTraceDataReceiveOp is called when a request is received from a client. +// StartTracesOp is called when a request is received from a client. // The returned context should be used in other calls to the obsreport functions // dealing with the same receive operation. -func (rec *Receiver) StartTraceDataReceiveOp( - operationCtx context.Context, - opt ...StartReceiveOption, -) context.Context { - return rec.traceReceiveOp( - operationCtx, - obsmetrics.ReceiveTraceDataOperationSuffix, - opt...) +func (rec *Receiver) StartTracesOp(operationCtx context.Context, opt ...StartReceiveOption) context.Context { + return rec.startOp(operationCtx, obsmetrics.ReceiveTraceDataOperationSuffix, opt...) } -// EndTraceDataReceiveOp completes the receive operation that was started with -// StartTraceDataReceiveOp. -func (rec *Receiver) EndTraceDataReceiveOp( +// EndTracesOp completes the receive operation that was started with +// StartTracesOp. +func (rec *Receiver) EndTracesOp( receiverCtx context.Context, format string, numReceivedSpans int, err error, ) { - rec.endReceiveOp( - receiverCtx, - format, - numReceivedSpans, - err, - config.TracesDataType, - ) + rec.endOp(receiverCtx, format, numReceivedSpans, err, config.TracesDataType) } -// StartLogsReceiveOp is called when a request is received from a client. +// StartLogsOp is called when a request is received from a client. // The returned context should be used in other calls to the obsreport functions // dealing with the same receive operation. -func (rec *Receiver) StartLogsReceiveOp( - operationCtx context.Context, - opt ...StartReceiveOption, -) context.Context { - return rec.traceReceiveOp( - operationCtx, - obsmetrics.ReceiverLogsOperationSuffix, - opt...) +func (rec *Receiver) StartLogsOp(operationCtx context.Context, opt ...StartReceiveOption) context.Context { + return rec.startOp(operationCtx, obsmetrics.ReceiverLogsOperationSuffix, opt...) } -// EndLogsReceiveOp completes the receive operation that was started with -// StartLogsReceiveOp. -func (rec *Receiver) EndLogsReceiveOp( +// EndLogsOp completes the receive operation that was started with +// StartLogsOp. +func (rec *Receiver) EndLogsOp( receiverCtx context.Context, format string, numReceivedLogRecords int, err error, ) { - rec.endReceiveOp( - receiverCtx, - format, - numReceivedLogRecords, - err, - config.LogsDataType, - ) + rec.endOp(receiverCtx, format, numReceivedLogRecords, err, config.LogsDataType) } -// StartMetricsReceiveOp is called when a request is received from a client. +// StartMetricsOp is called when a request is received from a client. // The returned context should be used in other calls to the obsreport functions // dealing with the same receive operation. -func (rec *Receiver) StartMetricsReceiveOp( - operationCtx context.Context, - opt ...StartReceiveOption, -) context.Context { - return rec.traceReceiveOp( - operationCtx, - obsmetrics.ReceiverMetricsOperationSuffix, - opt...) +func (rec *Receiver) StartMetricsOp(operationCtx context.Context, opt ...StartReceiveOption) context.Context { + return rec.startOp(operationCtx, obsmetrics.ReceiverMetricsOperationSuffix, opt...) } -// EndMetricsReceiveOp completes the receive operation that was started with -// StartMetricsReceiveOp. -func (rec *Receiver) EndMetricsReceiveOp( +// EndMetricsOp completes the receive operation that was started with +// StartMetricsOp. +func (rec *Receiver) EndMetricsOp( receiverCtx context.Context, format string, numReceivedPoints int, err error, ) { - rec.endReceiveOp( - receiverCtx, - format, - numReceivedPoints, - err, - config.MetricsDataType, - ) + rec.endOp(receiverCtx, format, numReceivedPoints, err, config.MetricsDataType) } // ReceiverContext adds the keys used when recording observability metrics to @@ -205,9 +169,9 @@ func ReceiverContext( return ctx } -// traceReceiveOp creates the span used to trace the operation. Returning +// startOp creates the span used to trace the operation. Returning // the updated context with the created span. -func (rec *Receiver) traceReceiveOp( +func (rec *Receiver) startOp( receiverCtx context.Context, operationSuffix string, opt ...StartReceiveOption, @@ -224,7 +188,7 @@ func (rec *Receiver) traceReceiveOp( ctx, span = trace.StartSpan(receiverCtx, spanName) } else { // Since the receiverCtx is long lived do not use it to start the span. - // This way this trace ends when the EndTraceDataReceiveOp is called. + // This way this trace ends when the EndTracesOp is called. // Here is safe to ignore the returned context since it is not used below. _, span = trace.StartSpan(context.Background(), spanName) @@ -240,8 +204,8 @@ func (rec *Receiver) traceReceiveOp( return ctx } -// endReceiveOp records the observability signals at the end of an operation. -func (rec *Receiver) endReceiveOp( +// endOp records the observability signals at the end of an operation. +func (rec *Receiver) endOp( receiverCtx context.Context, format string, numReceivedItems int, diff --git a/obsreport/obsreport_test.go b/obsreport/obsreport_test.go index f77d730ce27..1b4f6e230e5 100644 --- a/obsreport/obsreport_test.go +++ b/obsreport/obsreport_test.go @@ -72,10 +72,10 @@ func TestReceiveTraceDataOp(t *testing.T) { rcvdSpans := []int{13, 42} for i, param := range params { rec := NewReceiver(ReceiverSettings{ReceiverID: receiver, Transport: param.transport}) - ctx := rec.StartTraceDataReceiveOp(receiverCtx) + ctx := rec.StartTracesOp(receiverCtx) assert.NotNil(t, ctx) - rec.EndTraceDataReceiveOp( + rec.EndTracesOp( ctx, format, rcvdSpans[i], @@ -133,10 +133,10 @@ func TestReceiveLogsOp(t *testing.T) { rcvdLogRecords := []int{13, 42} for i, param := range params { rec := NewReceiver(ReceiverSettings{ReceiverID: receiver, Transport: param.transport}) - ctx := rec.StartLogsReceiveOp(receiverCtx) + ctx := rec.StartLogsOp(receiverCtx) assert.NotNil(t, ctx) - rec.EndLogsReceiveOp( + rec.EndLogsOp( ctx, format, rcvdLogRecords[i], @@ -194,10 +194,10 @@ func TestReceiveMetricsOp(t *testing.T) { rcvdMetricPts := []int{23, 29} for i, param := range params { rec := NewReceiver(ReceiverSettings{ReceiverID: receiver, Transport: param.transport}) - ctx := rec.StartMetricsReceiveOp(receiverCtx) + ctx := rec.StartMetricsOp(receiverCtx) assert.NotNil(t, ctx) - rec.EndMetricsReceiveOp( + rec.EndMetricsOp( ctx, format, rcvdMetricPts[i], @@ -465,12 +465,12 @@ func TestReceiveWithLongLivedCtx(t *testing.T) { // Use a new context on each operation to simulate distinct operations // under the same long lived context. rec := NewReceiver(ReceiverSettings{ReceiverID: receiver, Transport: transport}) - ctx := rec.StartTraceDataReceiveOp( + ctx := rec.StartTracesOp( longLivedCtx, WithLongLivedCtx()) assert.NotNil(t, ctx) - rec.EndTraceDataReceiveOp( + rec.EndTracesOp( ctx, format, op.numSpans, diff --git a/obsreport/obsreporttest/obsreporttest_test.go b/obsreport/obsreporttest/obsreporttest_test.go index e77a5025ea1..a9a7c349e63 100644 --- a/obsreport/obsreporttest/obsreporttest_test.go +++ b/obsreport/obsreporttest/obsreporttest_test.go @@ -44,9 +44,9 @@ func TestCheckReceiverTracesViews(t *testing.T) { receiverCtx := obsreport.ReceiverContext(context.Background(), receiver, transport) rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: receiver, Transport: transport}) - ctx := rec.StartTraceDataReceiveOp(receiverCtx) + ctx := rec.StartTracesOp(receiverCtx) assert.NotNil(t, ctx) - rec.EndTraceDataReceiveOp( + rec.EndTracesOp( ctx, format, 7, @@ -62,9 +62,9 @@ func TestCheckReceiverMetricsViews(t *testing.T) { receiverCtx := obsreport.ReceiverContext(context.Background(), receiver, transport) rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: receiver, Transport: transport}) - ctx := rec.StartMetricsReceiveOp(receiverCtx) + ctx := rec.StartMetricsOp(receiverCtx) assert.NotNil(t, ctx) - rec.EndMetricsReceiveOp(ctx, format, 7, nil) + rec.EndMetricsOp(ctx, format, 7, nil) obsreporttest.CheckReceiverMetrics(t, receiver, transport, 7, 0) } @@ -76,9 +76,9 @@ func TestCheckReceiverLogsViews(t *testing.T) { receiverCtx := obsreport.ReceiverContext(context.Background(), receiver, transport) rec := obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: receiver, Transport: transport}) - ctx := rec.StartLogsReceiveOp(receiverCtx) + ctx := rec.StartLogsOp(receiverCtx) assert.NotNil(t, ctx) - rec.EndLogsReceiveOp(ctx, format, 7, nil) + rec.EndLogsOp(ctx, format, 7, nil) obsreporttest.CheckReceiverLogs(t, receiver, transport, 7, 0) } diff --git a/receiver/jaegerreceiver/trace_receiver.go b/receiver/jaegerreceiver/trace_receiver.go index 30157eb8113..ce85fe5eaf7 100644 --- a/receiver/jaegerreceiver/trace_receiver.go +++ b/receiver/jaegerreceiver/trace_receiver.go @@ -245,10 +245,10 @@ func (h *agentHandler) EmitZipkinBatch(context.Context, []*zipkincore.Span) (err // Jaeger spans received by the Jaeger agent processor. func (h *agentHandler) EmitBatch(ctx context.Context, batch *jaeger.Batch) error { ctx = obsreport.ReceiverContext(ctx, h.id, h.transport) - ctx = h.obsrecv.StartTraceDataReceiveOp(ctx) + ctx = h.obsrecv.StartTracesOp(ctx) numSpans, err := consumeTraces(ctx, batch, h.nextConsumer) - h.obsrecv.EndTraceDataReceiveOp(ctx, thriftFormat, numSpans, err) + h.obsrecv.EndTracesOp(ctx, thriftFormat, numSpans, err) return err } @@ -273,12 +273,12 @@ func (jr *jReceiver) PostSpans(ctx context.Context, r *api_v2.PostSpansRequest) } ctx = obsreport.ReceiverContext(ctx, jr.id, grpcTransport) - ctx = jr.grpcObsrecv.StartTraceDataReceiveOp(ctx) + ctx = jr.grpcObsrecv.StartTracesOp(ctx) td := jaegertranslator.ProtoBatchToInternalTraces(r.GetBatch()) err := jr.nextConsumer.ConsumeTraces(ctx, td) - jr.grpcObsrecv.EndTraceDataReceiveOp(ctx, protobufFormat, len(r.GetBatch().Spans), err) + jr.grpcObsrecv.EndTracesOp(ctx, protobufFormat, len(r.GetBatch().Spans), err) if err != nil { return nil, err } @@ -423,12 +423,12 @@ func (jr *jReceiver) HandleThriftHTTPBatch(w http.ResponseWriter, r *http.Reques } ctx = obsreport.ReceiverContext(ctx, jr.id, collectorHTTPTransport) - ctx = jr.httpObsrecv.StartTraceDataReceiveOp(ctx) + ctx = jr.httpObsrecv.StartTracesOp(ctx) batch, hErr := jr.decodeThriftHTTPBody(r) if hErr != nil { http.Error(w, html.EscapeString(hErr.msg), hErr.statusCode) - jr.httpObsrecv.EndTraceDataReceiveOp(ctx, thriftFormat, 0, hErr) + jr.httpObsrecv.EndTracesOp(ctx, thriftFormat, 0, hErr) return } @@ -438,7 +438,7 @@ func (jr *jReceiver) HandleThriftHTTPBatch(w http.ResponseWriter, r *http.Reques } else { w.WriteHeader(http.StatusAccepted) } - jr.httpObsrecv.EndTraceDataReceiveOp(ctx, thriftFormat, numSpans, err) + jr.httpObsrecv.EndTracesOp(ctx, thriftFormat, numSpans, err) } func (jr *jReceiver) startCollector(host component.Host) error { diff --git a/receiver/kafkareceiver/kafka_receiver.go b/receiver/kafkareceiver/kafka_receiver.go index 0a56592ab1f..f0c4d9aac41 100644 --- a/receiver/kafkareceiver/kafka_receiver.go +++ b/receiver/kafkareceiver/kafka_receiver.go @@ -260,7 +260,7 @@ func (c *tracesConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSe session.MarkMessage(message, "") ctx := obsreport.ReceiverContext(session.Context(), c.id, transport) - ctx = c.obsrecv.StartTraceDataReceiveOp(ctx) + ctx = c.obsrecv.StartTracesOp(ctx) statsTags := []tag.Mutator{tag.Insert(tagInstanceName, c.id.String())} _ = stats.RecordWithTags(ctx, statsTags, statMessageCount.M(1), @@ -275,7 +275,7 @@ func (c *tracesConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSe spanCount := traces.SpanCount() err = c.nextConsumer.ConsumeTraces(session.Context(), traces) - c.obsrecv.EndTraceDataReceiveOp(ctx, c.unmarshaler.Encoding(), spanCount, err) + c.obsrecv.EndTracesOp(ctx, c.unmarshaler.Encoding(), spanCount, err) if err != nil { return err } @@ -312,7 +312,7 @@ func (c *logsConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSess session.MarkMessage(message, "") ctx := obsreport.ReceiverContext(session.Context(), c.id, transport) - ctx = c.obsrecv.StartTraceDataReceiveOp(ctx) + ctx = c.obsrecv.StartTracesOp(ctx) _ = stats.RecordWithTags( ctx, []tag.Mutator{tag.Insert(tagInstanceName, c.id.String())}, @@ -328,7 +328,7 @@ func (c *logsConsumerGroupHandler) ConsumeClaim(session sarama.ConsumerGroupSess err = c.nextConsumer.ConsumeLogs(session.Context(), logs) // TODO - c.obsrecv.EndTraceDataReceiveOp(ctx, c.unmarshaler.Encoding(), logs.LogRecordCount(), err) + c.obsrecv.EndTracesOp(ctx, c.unmarshaler.Encoding(), logs.LogRecordCount(), err) if err != nil { return err } diff --git a/receiver/opencensusreceiver/ocmetrics/opencensus.go b/receiver/opencensusreceiver/ocmetrics/opencensus.go index be6c0560e8a..8479d33dfab 100644 --- a/receiver/opencensusreceiver/ocmetrics/opencensus.go +++ b/receiver/opencensusreceiver/ocmetrics/opencensus.go @@ -124,7 +124,7 @@ func (ocr *Receiver) processReceivedMsg( } func (ocr *Receiver) sendToNextConsumer(longLivedRPCCtx context.Context, node *commonpb.Node, resource *resourcepb.Resource, metrics []*ocmetrics.Metric) error { - ctx := ocr.obsrecv.StartMetricsReceiveOp( + ctx := ocr.obsrecv.StartMetricsOp( longLivedRPCCtx, obsreport.WithLongLivedCtx()) @@ -141,7 +141,7 @@ func (ocr *Receiver) sendToNextConsumer(longLivedRPCCtx context.Context, node *c consumerErr = ocr.nextConsumer.ConsumeMetrics(ctx, internaldata.OCToMetrics(node, resource, metrics)) } - ocr.obsrecv.EndMetricsReceiveOp( + ocr.obsrecv.EndMetricsOp( ctx, receiverDataFormat, numPoints, diff --git a/receiver/opencensusreceiver/octrace/opencensus.go b/receiver/opencensusreceiver/octrace/opencensus.go index 2472cba3730..4bd49c6d524 100644 --- a/receiver/opencensusreceiver/octrace/opencensus.go +++ b/receiver/opencensusreceiver/octrace/opencensus.go @@ -144,12 +144,12 @@ func (ocr *Receiver) processReceivedMsg( } func (ocr *Receiver) sendToNextConsumer(longLivedRPCCtx context.Context, td pdata.Traces) error { - ctx := ocr.obsrecv.StartTraceDataReceiveOp( + ctx := ocr.obsrecv.StartTracesOp( longLivedRPCCtx, obsreport.WithLongLivedCtx()) err := ocr.nextConsumer.ConsumeTraces(ctx, td) - ocr.obsrecv.EndTraceDataReceiveOp(ctx, receiverDataFormat, td.SpanCount(), err) + ocr.obsrecv.EndTracesOp(ctx, receiverDataFormat, td.SpanCount(), err) return err } diff --git a/receiver/otlpreceiver/logs/otlp.go b/receiver/otlpreceiver/logs/otlp.go index 8ba21c964da..e677afa1f89 100644 --- a/receiver/otlpreceiver/logs/otlp.go +++ b/receiver/otlpreceiver/logs/otlp.go @@ -78,9 +78,9 @@ func (r *Receiver) sendToNextConsumer(ctx context.Context, ld pdata.Logs) error ctx = client.NewContext(ctx, c) } - ctx = r.obsrecv.StartLogsReceiveOp(ctx) + ctx = r.obsrecv.StartLogsOp(ctx) err := r.nextConsumer.ConsumeLogs(ctx, ld) - r.obsrecv.EndLogsReceiveOp(ctx, dataFormatProtobuf, numSpans, err) + r.obsrecv.EndLogsOp(ctx, dataFormatProtobuf, numSpans, err) return err } diff --git a/receiver/otlpreceiver/metrics/otlp.go b/receiver/otlpreceiver/metrics/otlp.go index 1769cd0a920..23f5aa95b71 100644 --- a/receiver/otlpreceiver/metrics/otlp.go +++ b/receiver/otlpreceiver/metrics/otlp.go @@ -77,9 +77,9 @@ func (r *Receiver) sendToNextConsumer(ctx context.Context, md pdata.Metrics) err ctx = client.NewContext(ctx, c) } - ctx = r.obsrecv.StartMetricsReceiveOp(ctx) + ctx = r.obsrecv.StartMetricsOp(ctx) err := r.nextConsumer.ConsumeMetrics(ctx, md) - r.obsrecv.EndMetricsReceiveOp(ctx, dataFormatProtobuf, dataPointCount, err) + r.obsrecv.EndMetricsOp(ctx, dataFormatProtobuf, dataPointCount, err) return err } diff --git a/receiver/otlpreceiver/trace/otlp.go b/receiver/otlpreceiver/trace/otlp.go index 0f6e3d69284..f5ec0455acd 100644 --- a/receiver/otlpreceiver/trace/otlp.go +++ b/receiver/otlpreceiver/trace/otlp.go @@ -78,9 +78,9 @@ func (r *Receiver) sendToNextConsumer(ctx context.Context, td pdata.Traces) erro ctx = client.NewContext(ctx, c) } - ctx = r.obsrecv.StartTraceDataReceiveOp(ctx) + ctx = r.obsrecv.StartTracesOp(ctx) err := r.nextConsumer.ConsumeTraces(ctx, td) - r.obsrecv.EndTraceDataReceiveOp(ctx, dataFormatProtobuf, numSpans, err) + r.obsrecv.EndTracesOp(ctx, dataFormatProtobuf, numSpans, err) return err } diff --git a/receiver/prometheusreceiver/internal/transaction.go b/receiver/prometheusreceiver/internal/transaction.go index e63daa8d748..6673a3b306e 100644 --- a/receiver/prometheusreceiver/internal/transaction.go +++ b/receiver/prometheusreceiver/internal/transaction.go @@ -171,11 +171,11 @@ func (tr *transaction) Commit() error { return nil } - ctx := tr.obsrecv.StartMetricsReceiveOp(tr.ctx) + ctx := tr.obsrecv.StartMetricsOp(tr.ctx) metrics, _, _, err := tr.metricBuilder.Build() if err != nil { // Only error by Build() is errNoDataToBuild, with numReceivedPoints set to zero. - tr.obsrecv.EndMetricsReceiveOp(ctx, dataformat, 0, err) + tr.obsrecv.EndMetricsOp(ctx, dataformat, 0, err) return err } @@ -186,7 +186,7 @@ func (tr *transaction) Commit() error { // Since we are unable to adjust metrics properly, we will drop them // and return an error. err = errNoStartTimeMetrics - tr.obsrecv.EndMetricsReceiveOp(ctx, dataformat, 0, err) + tr.obsrecv.EndMetricsOp(ctx, dataformat, 0, err) return err } @@ -203,7 +203,7 @@ func (tr *transaction) Commit() error { _, numPoints = md.MetricAndDataPointCount() err = tr.sink.ConsumeMetrics(ctx, md) } - tr.obsrecv.EndMetricsReceiveOp(ctx, dataformat, numPoints, err) + tr.obsrecv.EndMetricsOp(ctx, dataformat, numPoints, err) return err } diff --git a/receiver/scraperhelper/scrapercontroller.go b/receiver/scraperhelper/scrapercontroller.go index e2ed524a5ef..a7aa9f0c848 100644 --- a/receiver/scraperhelper/scrapercontroller.go +++ b/receiver/scraperhelper/scrapercontroller.go @@ -213,9 +213,9 @@ func (sc *controller) scrapeMetricsAndReport(ctx context.Context) { _, dataPointCount := metrics.MetricAndDataPointCount() - ctx = sc.obsrecv.StartMetricsReceiveOp(ctx) + ctx = sc.obsrecv.StartMetricsOp(ctx) err := sc.nextConsumer.ConsumeMetrics(ctx, metrics) - sc.obsrecv.EndMetricsReceiveOp(ctx, "", dataPointCount, err) + sc.obsrecv.EndMetricsOp(ctx, "", dataPointCount, err) } // stopScraping stops the ticker diff --git a/receiver/zipkinreceiver/trace_receiver.go b/receiver/zipkinreceiver/trace_receiver.go index 5dc05f4e768..affa3d11e93 100644 --- a/receiver/zipkinreceiver/trace_receiver.go +++ b/receiver/zipkinreceiver/trace_receiver.go @@ -218,7 +218,7 @@ func (zr *ZipkinReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) { transportTag := transportType(r, asZipkinv1) ctx = obsreport.ReceiverContext(ctx, zr.id, transportTag) obsrecv := obsreport.NewReceiver(obsreport.ReceiverSettings{ReceiverID: zr.id, Transport: transportTag}) - ctx = obsrecv.StartTraceDataReceiveOp(ctx) + ctx = obsrecv.StartTracesOp(ctx) pr := processBodyIfNecessary(r) slurp, _ := ioutil.ReadAll(pr) @@ -246,7 +246,7 @@ func (zr *ZipkinReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) { if asZipkinv1 { receiverTagValue = zipkinV1TagValue } - obsrecv.EndTraceDataReceiveOp(ctx, receiverTagValue, td.SpanCount(), consumerErr) + obsrecv.EndTracesOp(ctx, receiverTagValue, td.SpanCount(), consumerErr) if consumerErr != nil { // Transient error, due to some internal condition.