diff --git a/processor/schemaprocessor/internal/transformer/conditional_attributes_test.go b/processor/schemaprocessor/internal/transformer/conditional_attributes_test.go index 4bd2ccb6c33c..2f3fb7cf2461 100644 --- a/processor/schemaprocessor/internal/transformer/conditional_attributes_test.go +++ b/processor/schemaprocessor/internal/transformer/conditional_attributes_test.go @@ -86,7 +86,6 @@ func TestMetricDataPointAttributesTransformer(t *testing.T) { err = metricDataPointAttributeTransformer.Do(migrate.StateSelectorApply, metric) require.NoError(t, err) assertAttributeEquals(t, item.Attributes(), "service.version", "1.0.0") - }) } } @@ -108,5 +107,4 @@ func TestSpanConditionalAttributeTransformer(t *testing.T) { err = spanConditionalAttributeTransformer.Do(migrate.StateSelectorApply, span) require.NoError(t, err) assertAttributeEquals(t, span.Attributes(), "service.version", "1.0.0") - } diff --git a/processor/schemaprocessor/internal/transformer/multi_conditional_attributes_test.go b/processor/schemaprocessor/internal/transformer/multi_conditional_attributes_test.go index 10bafb87a38a..fa91adddb20d 100644 --- a/processor/schemaprocessor/internal/transformer/multi_conditional_attributes_test.go +++ b/processor/schemaprocessor/internal/transformer/multi_conditional_attributes_test.go @@ -53,7 +53,8 @@ func TestSpanEventConditionalAttributeTransformer(t *testing.T) { return span }, changed: false, - }, { + }, + { name: "bothnamematches", span: func() ptrace.Span { span := ptrace.NewSpan() diff --git a/processor/schemaprocessor/internal/translation/revision_v1.go b/processor/schemaprocessor/internal/translation/revision_v1.go index dd6f6dafb364..217ecb9daac3 100644 --- a/processor/schemaprocessor/internal/translation/revision_v1.go +++ b/processor/schemaprocessor/internal/translation/revision_v1.go @@ -36,7 +36,6 @@ func NewRevision(ver *Version, def ast.VersionDef) *RevisionV1 { for _, change := range def.Logs.Changes { //nolint:gosimple logChanges.Changes = append(logChanges.Changes, ast.AttributeChange{RenameAttributes: change.RenameAttributes}) - } return &RevisionV1{ ver: ver, @@ -47,7 +46,6 @@ func NewRevision(ver *Version, def ast.VersionDef) *RevisionV1 { metrics: newMetricChangeList(def.Metrics), logs: newLogsChangelist(def.Logs), } - } func (r RevisionV1) Version() *Version { @@ -87,7 +85,6 @@ func newSpanChangeList(spans ast.Spans) *changelist.ChangeList { } } return &changelist.ChangeList{Migrators: values} - } func newMetricChangeList(metrics ast.Metrics) *changelist.ChangeList { diff --git a/processor/schemaprocessor/internal/translation/revision_v1_test.go b/processor/schemaprocessor/internal/translation/revision_v1_test.go index 38de041ec46b..ff0a453e77af 100644 --- a/processor/schemaprocessor/internal/translation/revision_v1_test.go +++ b/processor/schemaprocessor/internal/translation/revision_v1_test.go @@ -148,65 +148,66 @@ func TestNewRevisionV1(t *testing.T) { }, expect: &RevisionV1{ ver: &Version{1, 0, 0}, - all: &changelist.ChangeList{Migrators: []migrate.Migrator{ - transformer.AllAttributes{ - // initialize one of each transformer with the attribute set - MetricAttributes: transformer.MetricAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "state": "status", - }), - }, - LogAttributes: transformer.LogAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "state": "status", - }), - }, - SpanAttributes: transformer.SpanAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "state": "status", - }), - }, - SpanEventAttributes: transformer.SpanEventAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "state": "status", - }), - }, - ResourceAttributes: transformer.ResourceAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "state": "status", - }), - }, - }, - transformer.AllAttributes{ - // initialize one of each transformer with the attribute set - MetricAttributes: transformer.MetricAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "status": "state", - }), - }, - LogAttributes: transformer.LogAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "status": "state", - }), - }, - SpanAttributes: transformer.SpanAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "status": "state", - }), - }, - SpanEventAttributes: transformer.SpanEventAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "status": "state", - }), + all: &changelist.ChangeList{ + Migrators: []migrate.Migrator{ + transformer.AllAttributes{ + // initialize one of each transformer with the attribute set + MetricAttributes: transformer.MetricAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "state": "status", + }), + }, + LogAttributes: transformer.LogAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "state": "status", + }), + }, + SpanAttributes: transformer.SpanAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "state": "status", + }), + }, + SpanEventAttributes: transformer.SpanEventAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "state": "status", + }), + }, + ResourceAttributes: transformer.ResourceAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "state": "status", + }), + }, }, - ResourceAttributes: transformer.ResourceAttributes{ - AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "status": "state", - }), + transformer.AllAttributes{ + // initialize one of each transformer with the attribute set + MetricAttributes: transformer.MetricAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "status": "state", + }), + }, + LogAttributes: transformer.LogAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "status": "state", + }), + }, + SpanAttributes: transformer.SpanAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "status": "state", + }), + }, + SpanEventAttributes: transformer.SpanEventAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "status": "state", + }), + }, + ResourceAttributes: transformer.ResourceAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "status": "state", + }), + }, }, }, }, - }, resources: &changelist.ChangeList{Migrators: []migrate.Migrator{ transformer.ResourceAttributes{AttributeChange: migrate.NewAttributeChangeSet( map[string]string{"service_name": "service.name"}, @@ -247,9 +248,10 @@ func TestNewRevisionV1(t *testing.T) { )}, }}, logs: &changelist.ChangeList{Migrators: []migrate.Migrator{ - transformer.LogAttributes{AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ - "ERROR": "error", - }), + transformer.LogAttributes{ + AttributeChange: migrate.NewAttributeChangeSet(map[string]string{ + "ERROR": "error", + }), }, }}, },