diff --git a/pkg/es/config/config.go b/pkg/es/config/config.go index 298caad57fb..d0ae9c6ad3d 100644 --- a/pkg/es/config/config.go +++ b/pkg/es/config/config.go @@ -217,7 +217,7 @@ func NewClient(c *Configuration, logger *zap.Logger, metricsFactory metrics.Fact return nil, err } - sm := spanstoremetrics.NewWriterDecorator(metricsFactory, "bulk_index") + sm := spanstoremetrics.NewWriter(metricsFactory, "bulk_index") m := sync.Map{} bulkProc, err := rawClient.BulkProcessor(). diff --git a/plugin/storage/es/spanstore/writer.go b/plugin/storage/es/spanstore/writer.go index 42120fe704b..4a3c9ac0563 100644 --- a/plugin/storage/es/spanstore/writer.go +++ b/plugin/storage/es/spanstore/writer.go @@ -72,7 +72,7 @@ func NewSpanWriter(p SpanWriterParams) *SpanWriter { client: p.Client, logger: p.Logger, writerMetrics: spanWriterMetrics{ - indexCreate: spanstoremetrics.NewWriterDecorator(p.MetricsFactory, "index_create"), + indexCreate: spanstoremetrics.NewWriter(p.MetricsFactory, "index_create"), }, serviceWriter: serviceOperationStorage.Write, spanConverter: dbmodel.NewFromDomain(p.AllTagsAsFields, p.TagKeysAsFields, p.TagDotReplacement), diff --git a/storage/spanstore/spanstoremetrics/write_metrics.go b/storage/spanstore/spanstoremetrics/write_metrics.go index b3c9ecbf280..d08c34576f8 100644 --- a/storage/spanstore/spanstoremetrics/write_metrics.go +++ b/storage/spanstore/spanstoremetrics/write_metrics.go @@ -19,8 +19,8 @@ type WriteMetrics struct { LatencyErr metrics.Timer `metric:"latency-err"` } -// NewWriterDecorator takes a metrics scope and creates a metrics struct -func NewWriterDecorator(factory metrics.Factory, tableName string) *WriteMetrics { +// NewWriter takes a metrics scope and creates a metrics struct +func NewWriter(factory metrics.Factory, tableName string) *WriteMetrics { t := &WriteMetrics{} metrics.Init(t, factory.Namespace(metrics.NSOptions{Name: tableName, Tags: nil}), nil) return t diff --git a/storage/spanstore/spanstoremetrics/write_metrics_test.go b/storage/spanstore/spanstoremetrics/write_metrics_test.go index aca6f0b4593..2e28283e43e 100644 --- a/storage/spanstore/spanstoremetrics/write_metrics_test.go +++ b/storage/spanstore/spanstoremetrics/write_metrics_test.go @@ -53,7 +53,7 @@ func TestTableEmit(t *testing.T) { } for _, tc := range testCases { mf := metricstest.NewFactory(time.Second) - tm := NewWriterDecorator(mf, "a_table") + tm := NewWriter(mf, "a_table") tm.Emit(tc.err, 50*time.Millisecond) counts, gauges := mf.Snapshot() assert.Equal(t, tc.counts, counts)