From 74af245bdb6abace75ef42ae77be4c5b29abd4fc Mon Sep 17 00:00:00 2001 From: Carrie Edwards Date: Fri, 19 Jul 2024 08:24:13 -0700 Subject: [PATCH] [chore] [receiver/datadog] Refactor translation files into internal package (#34160) **Description:** This PR is a follow-up to #33957. It refactors the Datadog receiver files to remove internal methods and structures from the public API and into an internal directory. **Link to tracking Issue:** #18278 **Testing:** This is a refactor, so no new unit tests have been added. --- .../{ => internal/translator}/batcher.go | 22 +++++----- .../{ => internal/translator}/batcher_test.go | 12 ++---- .../internal/translator/metrics_translator.go | 41 +++++++++++++++++++ .../translator/series.go} | 33 +-------------- .../translator/series_test.go} | 6 +-- .../{ => internal/translator}/tags.go | 2 +- .../{ => internal/translator}/tags_test.go | 2 +- .../{ => internal/translator}/testutil.go | 7 ++-- .../translator}/traces_translator.go | 30 +++++++------- .../translator}/traces_translator_test.go | 8 ++-- receiver/datadogreceiver/receiver.go | 19 +++++---- 11 files changed, 94 insertions(+), 88 deletions(-) rename receiver/datadogreceiver/{ => internal/translator}/batcher.go (85%) rename receiver/datadogreceiver/{ => internal/translator}/batcher_test.go (96%) create mode 100644 receiver/datadogreceiver/internal/translator/metrics_translator.go rename receiver/datadogreceiver/{metrics_translator.go => internal/translator/series.go} (73%) rename receiver/datadogreceiver/{metrics_translator_test.go => internal/translator/series_test.go} (97%) rename receiver/datadogreceiver/{ => internal/translator}/tags.go (97%) rename receiver/datadogreceiver/{ => internal/translator}/tags_test.go (99%) rename receiver/datadogreceiver/{ => internal/translator}/testutil.go (92%) rename receiver/datadogreceiver/{ => internal/translator}/traces_translator.go (94%) rename receiver/datadogreceiver/{ => internal/translator}/traces_translator_test.go (95%) diff --git a/receiver/datadogreceiver/batcher.go b/receiver/datadogreceiver/internal/translator/batcher.go similarity index 85% rename from receiver/datadogreceiver/batcher.go rename to receiver/datadogreceiver/internal/translator/batcher.go index ee79a1a8d944..5c77d0add735 100644 --- a/receiver/datadogreceiver/batcher.go +++ b/receiver/datadogreceiver/internal/translator/batcher.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package datadogreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver" +package translator // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver/internal/translator" import ( "go.opentelemetry.io/collector/pdata/pcommon" @@ -10,7 +10,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity" ) -type Batcher struct { +type batcher struct { pmetric.Metrics resourceMetrics map[identity.Resource]pmetric.ResourceMetrics @@ -18,8 +18,8 @@ type Batcher struct { metrics map[identity.Metric]pmetric.Metric } -func newBatcher() Batcher { - return Batcher{ +func newBatcher() batcher { + return batcher{ Metrics: pmetric.NewMetrics(), resourceMetrics: make(map[identity.Resource]pmetric.ResourceMetrics), scopeMetrics: make(map[identity.Scope]pmetric.ScopeMetrics), @@ -30,7 +30,7 @@ func newBatcher() Batcher { // Dimensions stores the properties of the series that are needed in order // to unique identify the series. This is needed in order to batch metrics by // resource, scope, and datapoint attributes -type Dimensions struct { +type dimensions struct { name string metricType pmetric.MetricType resourceAttrs pcommon.Map @@ -47,9 +47,9 @@ var metricTypeMap = map[string]pmetric.MetricType{ "sketch": pmetric.MetricTypeExponentialHistogram, } -func parseSeriesProperties(name string, metricType string, tags []string, host string, version string, stringPool *StringPool) Dimensions { +func parseSeriesProperties(name string, metricType string, tags []string, host string, version string, stringPool *StringPool) dimensions { resourceAttrs, scopeAttrs, dpAttrs := tagsToAttributes(tags, host, stringPool) - return Dimensions{ + return dimensions{ name: name, metricType: metricTypeMap[metricType], buildInfo: version, @@ -59,7 +59,7 @@ func parseSeriesProperties(name string, metricType string, tags []string, host s } } -func (b Batcher) Lookup(dim Dimensions) (pmetric.Metric, identity.Metric) { +func (b batcher) Lookup(dim dimensions) (pmetric.Metric, identity.Metric) { resource := dim.Resource() resourceID := identity.OfResource(resource) resourceMetrics, ok := b.resourceMetrics[resourceID] @@ -90,13 +90,13 @@ func (b Batcher) Lookup(dim Dimensions) (pmetric.Metric, identity.Metric) { return metric, metricID } -func (d Dimensions) Resource() pcommon.Resource { +func (d dimensions) Resource() pcommon.Resource { resource := pcommon.NewResource() d.resourceAttrs.CopyTo(resource.Attributes()) // TODO(jesus.vazquez) review this copy return resource } -func (d Dimensions) Scope() pcommon.InstrumentationScope { +func (d dimensions) Scope() pcommon.InstrumentationScope { scope := pcommon.NewInstrumentationScope() scope.SetName("otelcol/datadogreceiver") scope.SetVersion(d.buildInfo) @@ -104,7 +104,7 @@ func (d Dimensions) Scope() pcommon.InstrumentationScope { return scope } -func (d Dimensions) Metric() pmetric.Metric { +func (d dimensions) Metric() pmetric.Metric { metric := pmetric.NewMetric() metric.SetName(d.name) switch d.metricType { diff --git a/receiver/datadogreceiver/batcher_test.go b/receiver/datadogreceiver/internal/translator/batcher_test.go similarity index 96% rename from receiver/datadogreceiver/batcher_test.go rename to receiver/datadogreceiver/internal/translator/batcher_test.go index f9f21fc48391..5a6b27dd4d41 100644 --- a/receiver/datadogreceiver/batcher_test.go +++ b/receiver/datadogreceiver/internal/translator/batcher_test.go @@ -1,14 +1,13 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package datadogreceiver +package translator import ( "testing" "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/pmetric" ) @@ -275,13 +274,8 @@ func TestMetricBatcher(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - mt := newMetricsTranslator() - mt.buildInfo = component.BuildInfo{ - Command: "otelcol", - Description: "OpenTelemetry Collector", - Version: "latest", - } - result := mt.translateMetricsV1(tt.series) + mt := createMetricsTranslator() + result := mt.TranslateSeriesV1(tt.series) tt.expect(t, result) }) diff --git a/receiver/datadogreceiver/internal/translator/metrics_translator.go b/receiver/datadogreceiver/internal/translator/metrics_translator.go new file mode 100644 index 000000000000..43b60f09e159 --- /dev/null +++ b/receiver/datadogreceiver/internal/translator/metrics_translator.go @@ -0,0 +1,41 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package translator // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver/internal/translator" + +import ( + "sync" + + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/pdata/pcommon" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity" +) + +type MetricsTranslator struct { + sync.RWMutex + buildInfo component.BuildInfo + lastTs map[identity.Stream]pcommon.Timestamp + stringPool *StringPool +} + +func NewMetricsTranslator(buildInfo component.BuildInfo) *MetricsTranslator { + return &MetricsTranslator{ + buildInfo: buildInfo, + lastTs: make(map[identity.Stream]pcommon.Timestamp), + stringPool: newStringPool(), + } +} + +func (mt *MetricsTranslator) streamHasTimestamp(stream identity.Stream) (pcommon.Timestamp, bool) { + mt.RLock() + defer mt.RUnlock() + ts, ok := mt.lastTs[stream] + return ts, ok +} + +func (mt *MetricsTranslator) updateLastTsForStream(stream identity.Stream, ts pcommon.Timestamp) { + mt.Lock() + defer mt.Unlock() + mt.lastTs[stream] = ts +} diff --git a/receiver/datadogreceiver/metrics_translator.go b/receiver/datadogreceiver/internal/translator/series.go similarity index 73% rename from receiver/datadogreceiver/metrics_translator.go rename to receiver/datadogreceiver/internal/translator/series.go index beb56bd744a8..ca173c5ad2d7 100644 --- a/receiver/datadogreceiver/metrics_translator.go +++ b/receiver/datadogreceiver/internal/translator/series.go @@ -1,47 +1,18 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package datadogreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver" +package translator // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver/internal/translator" import ( - "sync" "time" datadogV1 "github.com/DataDog/datadog-api-client-go/v2/api/datadogV1" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity" ) -type MetricsTranslator struct { - sync.RWMutex - buildInfo component.BuildInfo - lastTs map[identity.Stream]pcommon.Timestamp - stringPool *StringPool -} - -func newMetricsTranslator() *MetricsTranslator { - return &MetricsTranslator{ - lastTs: make(map[identity.Stream]pcommon.Timestamp), - stringPool: newStringPool(), - } -} - -func (mt *MetricsTranslator) streamHasTimestamp(stream identity.Stream) (pcommon.Timestamp, bool) { - mt.RLock() - defer mt.RUnlock() - ts, ok := mt.lastTs[stream] - return ts, ok -} - -func (mt *MetricsTranslator) updateLastTsForStream(stream identity.Stream, ts pcommon.Timestamp) { - mt.Lock() - defer mt.Unlock() - mt.lastTs[stream] = ts -} - const ( TypeGauge string = "gauge" TypeRate string = "rate" @@ -52,7 +23,7 @@ type SeriesList struct { Series []datadogV1.Series `json:"series"` } -func (mt *MetricsTranslator) translateMetricsV1(series SeriesList) pmetric.Metrics { +func (mt *MetricsTranslator) TranslateSeriesV1(series SeriesList) pmetric.Metrics { bt := newBatcher() for _, serie := range series.Series { diff --git a/receiver/datadogreceiver/metrics_translator_test.go b/receiver/datadogreceiver/internal/translator/series_test.go similarity index 97% rename from receiver/datadogreceiver/metrics_translator_test.go rename to receiver/datadogreceiver/internal/translator/series_test.go index 6f55cff0d1d9..5c8483a97478 100644 --- a/receiver/datadogreceiver/metrics_translator_test.go +++ b/receiver/datadogreceiver/internal/translator/series_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package datadogreceiver +package translator import ( "testing" @@ -28,7 +28,7 @@ func testPointsToDatadogPoints(points []testPoint) [][]*float64 { } -func TestTranslateMetricsV1(t *testing.T) { +func TestTranslateSeriesV1(t *testing.T) { tests := []struct { name string @@ -152,7 +152,7 @@ func TestTranslateMetricsV1(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { mt := createMetricsTranslator() - result := mt.translateMetricsV1(tt.series) + result := mt.TranslateSeriesV1(tt.series) tt.expect(t, result) }) diff --git a/receiver/datadogreceiver/tags.go b/receiver/datadogreceiver/internal/translator/tags.go similarity index 97% rename from receiver/datadogreceiver/tags.go rename to receiver/datadogreceiver/internal/translator/tags.go index bdf88c49742c..eec8b55ba8bb 100644 --- a/receiver/datadogreceiver/tags.go +++ b/receiver/datadogreceiver/internal/translator/tags.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package datadogreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver" +package translator // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver/internal/translator" import ( "fmt" diff --git a/receiver/datadogreceiver/tags_test.go b/receiver/datadogreceiver/internal/translator/tags_test.go similarity index 99% rename from receiver/datadogreceiver/tags_test.go rename to receiver/datadogreceiver/internal/translator/tags_test.go index 5c049b95a7d2..b1ec4729ac33 100644 --- a/receiver/datadogreceiver/tags_test.go +++ b/receiver/datadogreceiver/internal/translator/tags_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package datadogreceiver +package translator import ( "testing" diff --git a/receiver/datadogreceiver/testutil.go b/receiver/datadogreceiver/internal/translator/testutil.go similarity index 92% rename from receiver/datadogreceiver/testutil.go rename to receiver/datadogreceiver/internal/translator/testutil.go index b5415d7042c1..c4ee342ad241 100644 --- a/receiver/datadogreceiver/testutil.go +++ b/receiver/datadogreceiver/internal/translator/testutil.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package datadogreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver" +package translator // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver/internal/translator" import ( "testing" @@ -13,12 +13,11 @@ import ( ) func createMetricsTranslator() *MetricsTranslator { - mt := newMetricsTranslator() - mt.buildInfo = component.BuildInfo{ + mt := NewMetricsTranslator(component.BuildInfo{ Command: "otelcol", Description: "OpenTelemetry Collector", Version: "latest", - } + }) return mt } diff --git a/receiver/datadogreceiver/traces_translator.go b/receiver/datadogreceiver/internal/translator/traces_translator.go similarity index 94% rename from receiver/datadogreceiver/traces_translator.go rename to receiver/datadogreceiver/internal/translator/traces_translator.go index 57bc2246c20d..363b58f5a847 100644 --- a/receiver/datadogreceiver/traces_translator.go +++ b/receiver/datadogreceiver/internal/translator/traces_translator.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package datadogreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver" +package translator // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver/internal/translator" import ( "bytes" @@ -51,7 +51,7 @@ func upsertHeadersAttributes(req *http.Request, attrs pcommon.Map) { } } -func toTraces(payload *pb.TracerPayload, req *http.Request) ptrace.Traces { +func ToTraces(payload *pb.TracerPayload, req *http.Request) ptrace.Traces { var traces pb.Traces for _, p := range payload.GetChunks() { traces = append(traces, p.GetSpans()) @@ -161,17 +161,17 @@ var bufferPool = sync.Pool{ }, } -func getBuffer() *bytes.Buffer { +func GetBuffer() *bytes.Buffer { buffer := bufferPool.Get().(*bytes.Buffer) buffer.Reset() return buffer } -func putBuffer(buffer *bytes.Buffer) { +func PutBuffer(buffer *bytes.Buffer) { bufferPool.Put(buffer) } -func handleTracesPayload(req *http.Request) (tp []*pb.TracerPayload, err error) { +func HandleTracesPayload(req *http.Request) (tp []*pb.TracerPayload, err error) { var tracerPayloads []*pb.TracerPayload defer func() { @@ -181,8 +181,8 @@ func handleTracesPayload(req *http.Request) (tp []*pb.TracerPayload, err error) switch { case strings.HasPrefix(req.URL.Path, "/v0.7"): - buf := getBuffer() - defer putBuffer(buf) + buf := GetBuffer() + defer PutBuffer(buf) if _, err = io.Copy(buf, req.Body); err != nil { return nil, err } @@ -193,8 +193,8 @@ func handleTracesPayload(req *http.Request) (tp []*pb.TracerPayload, err error) tracerPayloads = append(tracerPayloads, &tracerPayload) case strings.HasPrefix(req.URL.Path, "/v0.5"): - buf := getBuffer() - defer putBuffer(buf) + buf := GetBuffer() + defer PutBuffer(buf) if _, err = io.Copy(buf, req.Body); err != nil { return nil, err } @@ -229,8 +229,8 @@ func handleTracesPayload(req *http.Request) (tp []*pb.TracerPayload, err error) } tracerPayloads = append(tracerPayloads, tracerPayload) case strings.HasPrefix(req.URL.Path, "/api/v0.2"): - buf := getBuffer() - defer putBuffer(buf) + buf := GetBuffer() + defer PutBuffer(buf) if _, err = io.Copy(buf, req.Body); err != nil { return nil, err } @@ -265,8 +265,8 @@ func handleTracesPayload(req *http.Request) (tp []*pb.TracerPayload, err error) func decodeRequest(req *http.Request, dest *pb.Traces) (err error) { switch mediaType := getMediaType(req); mediaType { case "application/msgpack": - buf := getBuffer() - defer putBuffer(buf) + buf := GetBuffer() + defer PutBuffer(buf) _, err = io.Copy(buf, req.Body) if err != nil { return err @@ -283,8 +283,8 @@ func decodeRequest(req *http.Request, dest *pb.Traces) (err error) { default: // do our best if err1 := json.NewDecoder(req.Body).Decode(&dest); err1 != nil { - buf := getBuffer() - defer putBuffer(buf) + buf := GetBuffer() + defer PutBuffer(buf) _, err2 := io.Copy(buf, req.Body) if err2 != nil { return err2 diff --git a/receiver/datadogreceiver/traces_translator_test.go b/receiver/datadogreceiver/internal/translator/traces_translator_test.go similarity index 95% rename from receiver/datadogreceiver/traces_translator_test.go rename to receiver/datadogreceiver/internal/translator/traces_translator_test.go index eb8c0dc90165..b852f3aeb2b3 100644 --- a/receiver/datadogreceiver/traces_translator_test.go +++ b/receiver/datadogreceiver/internal/translator/traces_translator_test.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package datadogreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver" +package translator // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver" import ( "bytes" @@ -83,7 +83,7 @@ func TestTracePayloadV05Unmarshalling(t *testing.T) { require.NoError(t, traces.UnmarshalMsgDictionary(payload), "Must not error when marshaling content") req, _ := http.NewRequest(http.MethodPost, "/v0.5/traces", io.NopCloser(bytes.NewReader(payload))) - translated := toTraces(&pb.TracerPayload{ + translated := ToTraces(&pb.TracerPayload{ LanguageName: req.Header.Get("Datadog-Meta-Lang"), LanguageVersion: req.Header.Get("Datadog-Meta-Lang-Version"), TracerVersion: req.Header.Get("Datadog-Meta-Tracer-Version"), @@ -115,7 +115,7 @@ func TestTracePayloadV07Unmarshalling(t *testing.T) { bytez, _ := apiPayload.MarshalMsg(reqBytes) req, _ := http.NewRequest(http.MethodPost, "/v0.7/traces", io.NopCloser(bytes.NewReader(bytez))) - translatedPayloads, _ := handleTracesPayload(req) + translatedPayloads, _ := HandleTracesPayload(req) assert.Equal(t, len(translatedPayloads), 1, "Expected one translated payload") translated := translatedPayloads[0] span := translated.GetChunks()[0].GetSpans()[0] @@ -151,7 +151,7 @@ func TestTracePayloadApiV02Unmarshalling(t *testing.T) { bytez, _ := proto.Marshal(&agentPayload) req, _ := http.NewRequest(http.MethodPost, "/api/v0.2/traces", io.NopCloser(bytes.NewReader(bytez))) - translatedPayloads, _ := handleTracesPayload(req) + translatedPayloads, _ := HandleTracesPayload(req) assert.Equal(t, len(translatedPayloads), 2, "Expected two translated payload") for _, translated := range translatedPayloads { assert.NotNil(t, translated) diff --git a/receiver/datadogreceiver/receiver.go b/receiver/datadogreceiver/receiver.go index f69b42d900ce..a00b7edd54eb 100644 --- a/receiver/datadogreceiver/receiver.go +++ b/receiver/datadogreceiver/receiver.go @@ -17,6 +17,8 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" "go.uber.org/zap" + + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver/internal/translator" ) type datadogReceiver struct { @@ -27,7 +29,7 @@ type datadogReceiver struct { nextTracesConsumer consumer.Traces nextMetricsConsumer consumer.Metrics - metricsTranslator *MetricsTranslator + metricsTranslator *translator.MetricsTranslator server *http.Server tReceiver *receiverhelper.ObsReport @@ -65,8 +67,7 @@ func (ddr *datadogReceiver) Start(ctx context.Context, host component.Host) erro } if ddr.nextMetricsConsumer != nil { - ddr.metricsTranslator = newMetricsTranslator() - ddr.metricsTranslator.buildInfo = ddr.params.BuildInfo + ddr.metricsTranslator = translator.NewMetricsTranslator(ddr.params.BuildInfo) ddmux.HandleFunc("/api/v1/series", ddr.handleV1Series) ddmux.HandleFunc("/api/v2/series", ddr.handleV2Series) @@ -115,14 +116,14 @@ func (ddr *datadogReceiver) handleTraces(w http.ResponseWriter, req *http.Reques }(&spanCount) var ddTraces []*pb.TracerPayload - ddTraces, err = handleTracesPayload(req) + ddTraces, err = translator.HandleTracesPayload(req) if err != nil { http.Error(w, "Unable to unmarshal reqs", http.StatusBadRequest) ddr.params.Logger.Error("Unable to unmarshal reqs") return } for _, ddTrace := range ddTraces { - otelTraces := toTraces(ddTrace, req) + otelTraces := translator.ToTraces(ddTrace, req) spanCount = otelTraces.SpanCount() err = ddr.nextTracesConsumer.ConsumeTraces(obsCtx, otelTraces) if err != nil { @@ -145,15 +146,15 @@ func (ddr *datadogReceiver) handleV1Series(w http.ResponseWriter, req *http.Requ ddr.tReceiver.EndMetricsOp(obsCtx, "datadog", *metricsCount, err) }(&metricsCount) - buf := getBuffer() - defer putBuffer(buf) + buf := translator.GetBuffer() + defer translator.PutBuffer(buf) if _, err = io.Copy(buf, req.Body); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) ddr.params.Logger.Error(err.Error()) return } - seriesList := SeriesList{} + seriesList := translator.SeriesList{} err = json.Unmarshal(buf.Bytes(), &seriesList) if err != nil { http.Error(w, err.Error(), http.StatusBadRequest) @@ -161,7 +162,7 @@ func (ddr *datadogReceiver) handleV1Series(w http.ResponseWriter, req *http.Requ return } - metrics := ddr.metricsTranslator.translateMetricsV1(seriesList) + metrics := ddr.metricsTranslator.TranslateSeriesV1(seriesList) metricsCount = metrics.DataPointCount() err = ddr.nextMetricsConsumer.ConsumeMetrics(obsCtx, metrics)