From 984698a823ea89b105a9760ec4c67760024d64ba Mon Sep 17 00:00:00 2001 From: Dmitrii Anoshin Date: Thu, 11 May 2023 18:15:45 -0700 Subject: [PATCH] [pkg/batchperresourceattr] Mark as not mutating (#21885) --- .chloggen/batchbyres-not-mutating.yaml | 11 +++++++++++ pkg/batchperresourceattr/batchperresourceattr.go | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .chloggen/batchbyres-not-mutating.yaml diff --git a/.chloggen/batchbyres-not-mutating.yaml b/.chloggen/batchbyres-not-mutating.yaml new file mode 100644 index 0000000000000..4c6bd654552c4 --- /dev/null +++ b/.chloggen/batchbyres-not-mutating.yaml @@ -0,0 +1,11 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/batchperresourceattr + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Mark as not mutating as it does defensive copying. + +# One or more tracking issues related to the change +issues: [21885] diff --git a/pkg/batchperresourceattr/batchperresourceattr.go b/pkg/batchperresourceattr/batchperresourceattr.go index 68f0fd84d3be0..224352bc7aea3 100644 --- a/pkg/batchperresourceattr/batchperresourceattr.go +++ b/pkg/batchperresourceattr/batchperresourceattr.go @@ -38,7 +38,7 @@ func NewBatchPerResourceTraces(attrKey string, next consumer.Traces) consumer.Tr // Capabilities implements the consumer interface. func (bt *batchTraces) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: true} + return consumer.Capabilities{MutatesData: false} } func (bt *batchTraces) ConsumeTraces(ctx context.Context, td ptrace.Traces) error { @@ -90,7 +90,7 @@ func NewBatchPerResourceMetrics(attrKey string, next consumer.Metrics) consumer. // Capabilities implements the consumer interface. func (bt *batchMetrics) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: true} + return consumer.Capabilities{MutatesData: false} } func (bt *batchMetrics) ConsumeMetrics(ctx context.Context, td pmetric.Metrics) error { @@ -142,7 +142,7 @@ func NewBatchPerResourceLogs(attrKey string, next consumer.Logs) consumer.Logs { // Capabilities implements the consumer interface. func (bt *batchLogs) Capabilities() consumer.Capabilities { - return consumer.Capabilities{MutatesData: true} + return consumer.Capabilities{MutatesData: false} } func (bt *batchLogs) ConsumeLogs(ctx context.Context, td plog.Logs) error {