diff --git a/connector/routingconnector/go.mod b/connector/routingconnector/go.mod index 60497189f701..cd8dc6e089ee 100644 --- a/connector/routingconnector/go.mod +++ b/connector/routingconnector/go.mod @@ -3,7 +3,9 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/connector/routi go 1.22.0 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.112.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.112.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.112.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.112.0 go.opentelemetry.io/collector/confmap v1.18.0 @@ -21,6 +23,7 @@ require ( github.com/alecthomas/participle/v2 v2.1.1 // indirect github.com/antchfx/xmlquery v1.4.2 // indirect github.com/antchfx/xpath v1.3.2 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/elastic/go-grok v0.3.1 // indirect github.com/elastic/lunes v0.1.0 // indirect @@ -44,6 +47,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.112.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.112.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect go.opentelemetry.io/collector v0.112.0 // indirect diff --git a/connector/routingconnector/go.sum b/connector/routingconnector/go.sum index 0c9b91060b52..9de0ce62a86f 100644 --- a/connector/routingconnector/go.sum +++ b/connector/routingconnector/go.sum @@ -8,6 +8,8 @@ github.com/antchfx/xmlquery v1.4.2 h1:MZKd9+wblwxfQ1zd1AdrTsqVaMjMCwow3IqkCSe00K github.com/antchfx/xmlquery v1.4.2/go.mod h1:QXhvf5ldTuGqhd1SHNvvtlhhdQLks4dD0awIVhXIDTA= github.com/antchfx/xpath v1.3.2 h1:LNjzlsSjinu3bQpw9hWMY9ocB80oLOWuQqFvO6xt51U= github.com/antchfx/xpath v1.3.2/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= diff --git a/connector/routingconnector/internal/plogutil/logs.go b/connector/routingconnector/internal/plogutil/logs.go new file mode 100644 index 000000000000..5374073b7fd9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/logs.go @@ -0,0 +1,63 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package plogutil // import "github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector/internal/plogutil" + +import ( + "go.opentelemetry.io/collector/pdata/plog" +) + +// MoveResourcesIf calls f sequentially for each ResourceLogs present in the first plog.Logs. +// If f returns true, the element is removed from the first plog.Logs and added to the second plog.Logs. +func MoveResourcesIf(from, to plog.Logs, f func(plog.ResourceLogs) bool) { + from.ResourceLogs().RemoveIf(func(rl plog.ResourceLogs) bool { + if !f(rl) { + return false + } + rl.CopyTo(to.ResourceLogs().AppendEmpty()) + return true + }) +} + +// MoveRecordsWithContextIf calls f sequentially for each LogRecord present in the first plog.Logs. +// If f returns true, the element is removed from the first plog.Logs and added to the second plog.Logs. +// Notably, the Resource and Scope associated with the LogRecord are created in the second plog.Logs only once. +// Resources or Scopes are removed from the original if they become empty. All ordering is preserved. +func MoveRecordsWithContextIf(from, to plog.Logs, f func(plog.ResourceLogs, plog.ScopeLogs, plog.LogRecord) bool) { + rls := from.ResourceLogs() + for i := 0; i < rls.Len(); i++ { + rl := rls.At(i) + sls := rl.ScopeLogs() + var rlCopy *plog.ResourceLogs + for j := 0; j < sls.Len(); j++ { + sl := sls.At(j) + lrs := sl.LogRecords() + var slCopy *plog.ScopeLogs + lrs.RemoveIf(func(lr plog.LogRecord) bool { + if !f(rl, sl, lr) { + return false + } + if rlCopy == nil { + rlc := to.ResourceLogs().AppendEmpty() + rlCopy = &rlc + rl.Resource().CopyTo(rlCopy.Resource()) + rlCopy.SetSchemaUrl(rl.SchemaUrl()) + } + if slCopy == nil { + slc := rlCopy.ScopeLogs().AppendEmpty() + slCopy = &slc + sl.Scope().CopyTo(slCopy.Scope()) + slCopy.SetSchemaUrl(sl.SchemaUrl()) + } + lr.CopyTo(slCopy.LogRecords().AppendEmpty()) + return true + }) + } + sls.RemoveIf(func(sl plog.ScopeLogs) bool { + return sl.LogRecords().Len() == 0 + }) + } + rls.RemoveIf(func(rl plog.ResourceLogs) bool { + return rl.ScopeLogs().Len() == 0 + }) +} diff --git a/connector/routingconnector/internal/plogutil/logs_test.go b/connector/routingconnector/internal/plogutil/logs_test.go new file mode 100644 index 000000000000..d2cce5f72bd1 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/logs_test.go @@ -0,0 +1,161 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package plogutil_test + +import ( + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/pdata/plog" + + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector/internal/plogutil" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/plogtest" +) + +func TestMoveResourcesIf(t *testing.T) { + testCases := []struct { + name string + condition func(plog.ResourceLogs) bool + }{ + { + name: "move_none", + condition: func(plog.ResourceLogs) bool { + return false + }, + }, + { + name: "move_all", + condition: func(plog.ResourceLogs) bool { + return true + }, + }, + { + name: "move_one", + condition: func(rl plog.ResourceLogs) bool { + rname, ok := rl.Resource().Attributes().Get("resourceName") + return ok && rname.AsString() == "resourceA" + }, + }, + { + name: "move_to_preexisting", + condition: func(rl plog.ResourceLogs) bool { + rname, ok := rl.Resource().Attributes().Get("resourceName") + return ok && rname.AsString() == "resourceB" + }, + }, + } + + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + // Load up a fresh copy of the input for each test, since it may be modified in place. + from, err := golden.ReadLogs(filepath.Join("testdata", "resource", tt.name, "from.yaml")) + require.NoError(t, err) + + to, err := golden.ReadLogs(filepath.Join("testdata", "resource", tt.name, "to.yaml")) + require.NoError(t, err) + + fromModifed, err := golden.ReadLogs(filepath.Join("testdata", "resource", tt.name, "from_modified.yaml")) + require.NoError(t, err) + + toModified, err := golden.ReadLogs(filepath.Join("testdata", "resource", tt.name, "to_modified.yaml")) + require.NoError(t, err) + + plogutil.MoveResourcesIf(from, to, tt.condition) + + assert.NoError(t, plogtest.CompareLogs(fromModifed, from), "from not modified as expected") + assert.NoError(t, plogtest.CompareLogs(toModified, to), "to not as expected") + }) + } +} + +func TestMoveRecordsWithContextIf(t *testing.T) { + testCases := []struct { + name string + condition func(plog.ResourceLogs, plog.ScopeLogs, plog.LogRecord) bool + }{ + { + name: "move_none", + condition: func(plog.ResourceLogs, plog.ScopeLogs, plog.LogRecord) bool { + return false + }, + }, + { + name: "move_all", + condition: func(plog.ResourceLogs, plog.ScopeLogs, plog.LogRecord) bool { + return true + }, + }, + { + name: "move_all_from_one_resource", + condition: func(rl plog.ResourceLogs, _ plog.ScopeLogs, _ plog.LogRecord) bool { + rname, ok := rl.Resource().Attributes().Get("resourceName") + return ok && rname.AsString() == "resourceB" + }, + }, + { + name: "move_all_from_one_scope", + condition: func(rl plog.ResourceLogs, sl plog.ScopeLogs, _ plog.LogRecord) bool { + rname, ok := rl.Resource().Attributes().Get("resourceName") + return ok && rname.AsString() == "resourceB" && sl.Scope().Name() == "scopeA" + }, + }, + { + name: "move_all_from_one_scope_in_each_resource", + condition: func(_ plog.ResourceLogs, sl plog.ScopeLogs, _ plog.LogRecord) bool { + return sl.Scope().Name() == "scopeB" + }, + }, + { + name: "move_one", + condition: func(rl plog.ResourceLogs, sl plog.ScopeLogs, lr plog.LogRecord) bool { + rname, ok := rl.Resource().Attributes().Get("resourceName") + return ok && rname.AsString() == "resourceA" && sl.Scope().Name() == "scopeB" && lr.Body().AsString() == "logB" + }, + }, + { + name: "move_one_from_each_scope", + condition: func(_ plog.ResourceLogs, _ plog.ScopeLogs, lr plog.LogRecord) bool { + return lr.Body().AsString() == "logA" + }, + }, + { + name: "move_one_from_each_scope_in_one_resource", + condition: func(rl plog.ResourceLogs, _ plog.ScopeLogs, lr plog.LogRecord) bool { + rname, ok := rl.Resource().Attributes().Get("resourceName") + return ok && rname.AsString() == "resourceB" && lr.Body().AsString() == "logA" + }, + }, + { + name: "move_some_to_preexisting", + condition: func(_ plog.ResourceLogs, sl plog.ScopeLogs, _ plog.LogRecord) bool { + return sl.Scope().Name() == "scopeB" + }, + }, + } + + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + // Load up a fresh copy of the input for each test, since it may be modified in place. + from, err := golden.ReadLogs(filepath.Join("testdata", "record", tt.name, "from.yaml")) + require.NoError(t, err) + + to, err := golden.ReadLogs(filepath.Join("testdata", "record", tt.name, "to.yaml")) + require.NoError(t, err) + + fromModifed, err := golden.ReadLogs(filepath.Join("testdata", "record", tt.name, "from_modified.yaml")) + require.NoError(t, err) + + toModified, err := golden.ReadLogs(filepath.Join("testdata", "record", tt.name, "to_modified.yaml")) + require.NoError(t, err) + + plogutil.MoveRecordsWithContextIf(from, to, tt.condition) + + assert.NoError(t, plogtest.CompareLogs(fromModifed, from), "from not modified as expected") + assert.NoError(t, plogtest.CompareLogs(toModified, to), "to not as expected") + }) + } +} diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all/from.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all/from_modified.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all/from_modified.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all/to.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all/to_modified.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all/to_modified.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/from.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/from_modified.yaml new file mode 100644 index 000000000000..72f617672bf3 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/from_modified.yaml @@ -0,0 +1,71 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/to.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/to_modified.yaml new file mode 100644 index 000000000000..28a5a7c8b0f5 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_resource/to_modified.yaml @@ -0,0 +1,71 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/from.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/from_modified.yaml new file mode 100644 index 000000000000..28fed8ee680e --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/from_modified.yaml @@ -0,0 +1,111 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/to.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/to_modified.yaml new file mode 100644 index 000000000000..d42bbbcd478c --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope/to_modified.yaml @@ -0,0 +1,41 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/from.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/from_modified.yaml new file mode 100644 index 000000000000..71ca02311582 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/from_modified.yaml @@ -0,0 +1,81 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/to.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/to_modified.yaml new file mode 100644 index 000000000000..8c8745158e33 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_all_from_one_scope_in_each_resource/to_modified.yaml @@ -0,0 +1,81 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_none/from.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_none/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_none/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_none/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_none/from_modified.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_none/from_modified.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_none/to.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_none/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_none/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_none/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_none/to_modified.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_none/to_modified.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one/from.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one/from_modified.yaml new file mode 100644 index 000000000000..293ef60f94c0 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one/from_modified.yaml @@ -0,0 +1,132 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one/to.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one/to_modified.yaml new file mode 100644 index 000000000000..5bc00c939ba1 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one/to_modified.yaml @@ -0,0 +1,32 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/from.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/from_modified.yaml new file mode 100644 index 000000000000..c6c0fa65fcc0 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/from_modified.yaml @@ -0,0 +1,105 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/to.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/to_modified.yaml new file mode 100644 index 000000000000..39604c6017d6 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope/to_modified.yaml @@ -0,0 +1,105 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/from.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/from_modified.yaml new file mode 100644 index 000000000000..99ee9a0c24ea --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/from_modified.yaml @@ -0,0 +1,123 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/to.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/to_modified.yaml new file mode 100644 index 000000000000..a2e7ef72f97e --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_one_from_each_scope_in_one_resource/to_modified.yaml @@ -0,0 +1,53 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/from.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/from_modified.yaml new file mode 100644 index 000000000000..71ca02311582 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/from_modified.yaml @@ -0,0 +1,81 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/to.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/to.yaml new file mode 100644 index 000000000000..d1f37edae9cd --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/to.yaml @@ -0,0 +1,71 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceC + - key: resourceNameAgain + value: + stringValue: resourceC + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/to_modified.yaml new file mode 100644 index 000000000000..df27dd6cce1b --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/record/move_some_to_preexisting/to_modified.yaml @@ -0,0 +1,152 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceC + - key: resourceNameAgain + value: + stringValue: resourceC + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_all/from.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_all/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_all/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_all/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_all/from_modified.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_all/from_modified.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_all/to.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_all/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_all/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_all/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_all/to_modified.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_all/to_modified.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_none/from.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_none/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_none/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_none/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_none/from_modified.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_none/from_modified.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_none/to.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_none/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_none/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_none/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_none/to_modified.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_none/to_modified.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_one/from.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_one/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_one/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_one/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_one/from_modified.yaml new file mode 100644 index 000000000000..28a5a7c8b0f5 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_one/from_modified.yaml @@ -0,0 +1,71 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_one/to.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_one/to.yaml new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_one/to.yaml @@ -0,0 +1 @@ + diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_one/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_one/to_modified.yaml new file mode 100644 index 000000000000..72f617672bf3 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_one/to_modified.yaml @@ -0,0 +1,71 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/from.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/from.yaml new file mode 100644 index 000000000000..63c6eada6cf9 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/from.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/from_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/from_modified.yaml new file mode 100644 index 000000000000..ef36119ae039 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/from_modified.yaml @@ -0,0 +1,72 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceA + - key: resourceNameAgain + value: + stringValue: resourceA + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/to.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/to.yaml new file mode 100644 index 000000000000..d1f37edae9cd --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/to.yaml @@ -0,0 +1,71 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceC + - key: resourceNameAgain + value: + stringValue: resourceC + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 diff --git a/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/to_modified.yaml b/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/to_modified.yaml new file mode 100644 index 000000000000..a29eeeb8f3c1 --- /dev/null +++ b/connector/routingconnector/internal/plogutil/testdata/resource/move_to_preexisting/to_modified.yaml @@ -0,0 +1,141 @@ +resourceLogs: + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceC + - key: resourceNameAgain + value: + stringValue: resourceC + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0 + - resource: + attributes: + - key: resourceName + value: + stringValue: resourceB + - key: resourceNameAgain + value: + stringValue: resourceB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scopeLogs: + - attributes: + - key: scopeName + value: + stringValue: scopeA + - key: scopeNameAgain + value: + stringValue: scopeA + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeA + version: v0.1.0 + - attributes: + - key: scopeName + value: + stringValue: scopeB + - key: scopeNameAgain + value: + stringValue: scopeB + logRecords: + - attributes: + - key: logName + value: + stringValue: logA + - key: logNameAgain + value: + stringValue: logA + body: + stringValue: logA + - attributes: + - key: logName + value: + stringValue: logB + - key: logNameAgain + value: + stringValue: logB + body: + stringValue: logB + schemaUrl: https://opentelemetry.io/schemas/1.6.1 + scope: + name: scopeB + version: v0.1.0