From 8dd2b7b00f9307bde95d4391d290f59aa901f219 Mon Sep 17 00:00:00 2001 From: Daniel Jaglowski Date: Sun, 3 Nov 2024 06:23:21 -0500 Subject: [PATCH] [chore][connector/routing] Refactor metric test examples into code (#36149) --- .../internal/pmetricutil/metrics_test.go | 61 +-- .../testdata/resource/move_all/from.yaml | 389 ------------------ .../resource/move_all/from_modified.yaml | 0 .../testdata/resource/move_all/to.yaml | 0 .../resource/move_all/to_modified.yaml | 389 ------------------ .../testdata/resource/move_none/from.yaml | 389 ------------------ .../resource/move_none/from_modified.yaml | 389 ------------------ .../testdata/resource/move_none/to.yaml | 1 - .../resource/move_none/to_modified.yaml | 1 - .../testdata/resource/move_one/from.yaml | 389 ------------------ .../resource/move_one/from_modified.yaml | 195 --------- .../testdata/resource/move_one/to.yaml | 1 - .../resource/move_one/to_modified.yaml | 195 --------- .../resource/move_to_preexisting/from.yaml | 389 ------------------ .../move_to_preexisting/from_modified.yaml | 195 --------- .../resource/move_to_preexisting/to.yaml | 195 --------- .../move_to_preexisting/to_modified.yaml | 389 ------------------ .../internal/pmetricutiltest/metrics.go | 45 ++ .../internal/pmetricutiltest/metrics_test.go | 130 ++++++ connector/routingconnector/metrics_test.go | 165 +++++--- .../testdata/metrics/input.yaml | 389 ------------------ .../all_match_first_only/config.yaml | 10 - .../all_match_first_only/sink_0.yaml | 389 ------------------ .../all_match_last_only/config.yaml | 10 - .../all_match_last_only/sink_1.yaml | 389 ------------------ .../all_match_once/config.yaml | 11 - .../all_match_once/sink_0.yaml | 389 ------------------ .../each_matches_one/config.yaml | 10 - .../each_matches_one/sink_0.yaml | 195 --------- .../each_matches_one/sink_1.yaml | 195 --------- .../match_none_with_default/config.yaml | 10 - .../match_none_with_default/sink_default.yaml | 389 ------------------ .../match_none_without_default/config.yaml | 10 - 33 files changed, 329 insertions(+), 5974 deletions(-) delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/from.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/from_modified.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/to.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/to_modified.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/from.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/from_modified.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/to.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/to_modified.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/from.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/from_modified.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/to.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/to_modified.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/from.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/from_modified.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/to.yaml delete mode 100644 connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/to_modified.yaml create mode 100644 connector/routingconnector/internal/pmetricutiltest/metrics.go create mode 100644 connector/routingconnector/internal/pmetricutiltest/metrics_test.go delete mode 100644 connector/routingconnector/testdata/metrics/input.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/all_match_first_only/config.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/all_match_first_only/sink_0.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/all_match_last_only/config.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/all_match_last_only/sink_1.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/all_match_once/config.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/all_match_once/sink_0.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/each_matches_one/config.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/each_matches_one/sink_0.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/each_matches_one/sink_1.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/match_none_with_default/config.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/match_none_with_default/sink_default.yaml delete mode 100644 connector/routingconnector/testdata/metrics/resource_context/match_none_without_default/config.yaml diff --git a/connector/routingconnector/internal/pmetricutil/metrics_test.go b/connector/routingconnector/internal/pmetricutil/metrics_test.go index 3d7e62b0020a..5b3d751c6826 100644 --- a/connector/routingconnector/internal/pmetricutil/metrics_test.go +++ b/connector/routingconnector/internal/pmetricutil/metrics_test.go @@ -4,70 +4,79 @@ package pmetricutil_test import ( - "path/filepath" "testing" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/pmetric" "github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector/internal/pmetricutil" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector/internal/pmetricutiltest" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" ) func TestMoveResourcesIf(t *testing.T) { testCases := []struct { - name string - condition func(pmetric.ResourceMetrics) bool + name string + moveIf func(pmetric.ResourceMetrics) bool + from pmetric.Metrics + to pmetric.Metrics + expectFrom pmetric.Metrics + expectTo pmetric.Metrics }{ { name: "move_none", - condition: func(pmetric.ResourceMetrics) bool { + moveIf: func(pmetric.ResourceMetrics) bool { return false }, + from: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + to: pmetric.NewMetrics(), + expectFrom: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectTo: pmetric.NewMetrics(), }, { name: "move_all", - condition: func(pmetric.ResourceMetrics) bool { + moveIf: func(pmetric.ResourceMetrics) bool { return true }, + from: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + to: pmetric.NewMetrics(), + expectFrom: pmetric.NewMetrics(), + expectTo: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), }, { name: "move_one", - condition: func(rl pmetric.ResourceMetrics) bool { + moveIf: func(rl pmetric.ResourceMetrics) bool { rname, ok := rl.Resource().Attributes().Get("resourceName") return ok && rname.AsString() == "resourceA" }, + from: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + to: pmetric.NewMetrics(), + expectFrom: pmetricutiltest.NewMetrics("B", "CD", "EF", "FG"), + expectTo: pmetricutiltest.NewMetrics("A", "CD", "EF", "FG"), }, { name: "move_to_preexisting", - condition: func(rl pmetric.ResourceMetrics) bool { + moveIf: func(rl pmetric.ResourceMetrics) bool { rname, ok := rl.Resource().Attributes().Get("resourceName") return ok && rname.AsString() == "resourceB" }, + from: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + to: pmetricutiltest.NewMetrics("1", "2", "3", "4"), + expectFrom: pmetricutiltest.NewMetrics("A", "CD", "EF", "FG"), + expectTo: func() pmetric.Metrics { + move := pmetricutiltest.NewMetrics("B", "CD", "EF", "FG") + moveTo := pmetricutiltest.NewMetrics("1", "2", "3", "4") + move.ResourceMetrics().MoveAndAppendTo(moveTo.ResourceMetrics()) + return moveTo + }(), }, } 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.ReadMetrics(filepath.Join("testdata", "resource", tt.name, "from.yaml")) - require.NoError(t, err) - - to, err := golden.ReadMetrics(filepath.Join("testdata", "resource", tt.name, "to.yaml")) - require.NoError(t, err) - - fromModifed, err := golden.ReadMetrics(filepath.Join("testdata", "resource", tt.name, "from_modified.yaml")) - require.NoError(t, err) - - toModified, err := golden.ReadMetrics(filepath.Join("testdata", "resource", tt.name, "to_modified.yaml")) - require.NoError(t, err) - - pmetricutil.MoveResourcesIf(from, to, tt.condition) - - assert.NoError(t, pmetrictest.CompareMetrics(fromModifed, from), "from not modified as expected") - assert.NoError(t, pmetrictest.CompareMetrics(toModified, to), "to not as expected") + pmetricutil.MoveResourcesIf(tt.from, tt.to, tt.moveIf) + assert.NoError(t, pmetrictest.CompareMetrics(tt.expectFrom, tt.from), "from not modified as expected") + assert.NoError(t, pmetrictest.CompareMetrics(tt.expectTo, tt.to), "to not as expected") }) } } diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/from.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/from.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/from.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/from_modified.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/from_modified.yaml deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/to.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/to.yaml deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/to_modified.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/to_modified.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_all/to_modified.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/from.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/from.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/from.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/from_modified.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/from_modified.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/from_modified.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/to.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/to.yaml deleted file mode 100644 index 8b137891791f..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/to.yaml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/to_modified.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/to_modified.yaml deleted file mode 100644 index 8b137891791f..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_none/to_modified.yaml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/from.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/from.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/from.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/from_modified.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/from_modified.yaml deleted file mode 100644 index b83427450811..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/from_modified.yaml +++ /dev/null @@ -1,195 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/to.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/to.yaml deleted file mode 100644 index 8b137891791f..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/to.yaml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/to_modified.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/to_modified.yaml deleted file mode 100644 index 705311b4fd43..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_one/to_modified.yaml +++ /dev/null @@ -1,195 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/from.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/from.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/from.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/from_modified.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/from_modified.yaml deleted file mode 100644 index 705311b4fd43..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/from_modified.yaml +++ /dev/null @@ -1,195 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/to.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/to.yaml deleted file mode 100644 index 52afaa3be9cc..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/to.yaml +++ /dev/null @@ -1,195 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceC - - key: resourceNameAgain - value: - stringValue: resourceC - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/to_modified.yaml b/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/to_modified.yaml deleted file mode 100644 index 5548e74519cf..000000000000 --- a/connector/routingconnector/internal/pmetricutil/testdata/resource/move_to_preexisting/to_modified.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceC - - key: resourceNameAgain - value: - stringValue: resourceC - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/internal/pmetricutiltest/metrics.go b/connector/routingconnector/internal/pmetricutiltest/metrics.go new file mode 100644 index 000000000000..79aecf26743a --- /dev/null +++ b/connector/routingconnector/internal/pmetricutiltest/metrics.go @@ -0,0 +1,45 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pmetricutiltest // import "github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector/internal/pmetricutiltest" + +import "go.opentelemetry.io/collector/pdata/pmetric" + +// TestMetrics returns a pmetric.Metrics with a uniform structure where resources, scopes, metrics, +// and datapoints are identical across all instances, except for one identifying field. +// +// Identifying fields: +// - Resources have an attribute called "resourceName" with a value of "resourceN". +// - Scopes have a name with a value of "scopeN". +// - Metrics have a name with a value of "metricN" and a single time series of data points. +// - DataPoints have an attribute "dpName" with a value of "dpN". +// +// Example: TestMetrics("AB", "XYZ", "MN", "1234") returns: +// +// resourceA, resourceB +// each with scopeX, scopeY, scopeZ +// each with metricM, metricN +// each with dp1, dp2, dp3, dp4 +// +// Each byte in the input string is a unique ID for the corresponding element. +func NewMetrics(rIDs, sIDs, mIDs, dpIDs string) pmetric.Metrics { + md := pmetric.NewMetrics() + for ri := 0; ri < len(rIDs); ri++ { + r := md.ResourceMetrics().AppendEmpty() + r.Resource().Attributes().PutStr("resourceName", "resource"+string(rIDs[ri])) + for si := 0; si < len(sIDs); si++ { + s := r.ScopeMetrics().AppendEmpty() + s.Scope().SetName("scope" + string(sIDs[si])) + for mi := 0; mi < len(mIDs); mi++ { + m := s.Metrics().AppendEmpty() + m.SetName("metric" + string(mIDs[mi])) + dps := m.SetEmptyGauge() + for di := 0; di < len(dpIDs); di++ { + dp := dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dp"+string(dpIDs[di])) + } + } + } + } + return md +} diff --git a/connector/routingconnector/internal/pmetricutiltest/metrics_test.go b/connector/routingconnector/internal/pmetricutiltest/metrics_test.go new file mode 100644 index 000000000000..26c2c1e3e162 --- /dev/null +++ b/connector/routingconnector/internal/pmetricutiltest/metrics_test.go @@ -0,0 +1,130 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package pmetricutiltest_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "go.opentelemetry.io/collector/pdata/pmetric" + + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector/internal/pmetricutiltest" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" +) + +func TestNewMetrics(t *testing.T) { + + t.Run("empty", func(t *testing.T) { + expected := pmetric.NewMetrics() + assert.NoError(t, pmetrictest.CompareMetrics(expected, pmetricutiltest.NewMetrics("", "", "", ""))) + }) + + t.Run("simple", func(t *testing.T) { + expected := func() pmetric.Metrics { + md := pmetric.NewMetrics() + r := md.ResourceMetrics().AppendEmpty() + r.Resource().Attributes().PutStr("resourceName", "resourceA") // resourceA + s := r.ScopeMetrics().AppendEmpty() + s.Scope().SetName("scopeB") // resourceA.scopeB + m := s.Metrics().AppendEmpty() + m.SetName("metricC") // resourceA.scopeB.metricC + dps := m.SetEmptyGauge() + dp := dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dpD") // resourceA.scopeB.metricC.dpD + return md + }() + assert.NoError(t, pmetrictest.CompareMetrics(expected, pmetricutiltest.NewMetrics("A", "B", "C", "D"))) + }) + + t.Run("two_resources", func(t *testing.T) { + expected := func() pmetric.Metrics { + md := pmetric.NewMetrics() + r := md.ResourceMetrics().AppendEmpty() + r.Resource().Attributes().PutStr("resourceName", "resourceA") // resourceA + s := r.ScopeMetrics().AppendEmpty() + s.Scope().SetName("scopeC") // resourceA.scopeC + m := s.Metrics().AppendEmpty() + m.SetName("metricD") // resourceA.scopeC.metricD + dps := m.SetEmptyGauge() + dp := dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dpE") // resourceA.scopeC.metricD.dpE + r = md.ResourceMetrics().AppendEmpty() + r.Resource().Attributes().PutStr("resourceName", "resourceB") // resourceB + s = r.ScopeMetrics().AppendEmpty() + s.Scope().SetName("scopeC") // resourceB.scopeC + m = s.Metrics().AppendEmpty() + m.SetName("metricD") // resourceB.scopeC.metricD + dps = m.SetEmptyGauge() + dp = dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dpE") // resource.scopeC.metricD.dpE + return md + }() + assert.NoError(t, pmetrictest.CompareMetrics(expected, pmetricutiltest.NewMetrics("AB", "C", "D", "E"))) + }) + + t.Run("two_scopes", func(t *testing.T) { + expected := func() pmetric.Metrics { + md := pmetric.NewMetrics() + r := md.ResourceMetrics().AppendEmpty() + r.Resource().Attributes().PutStr("resourceName", "resourceA") // resourceA + s := r.ScopeMetrics().AppendEmpty() + s.Scope().SetName("scopeB") // resourceA.scopeB + m := s.Metrics().AppendEmpty() + m.SetName("metricD") // resourceA.scopeB.metricD + dps := m.SetEmptyGauge() + dp := dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dpE") // resourceA.scopeB.metricD.dpE + s = r.ScopeMetrics().AppendEmpty() + s.Scope().SetName("scopeC") // resourceA.scopeC + m = s.Metrics().AppendEmpty() + m.SetName("metricD") // resourceA.scopeC.metricD + dps = m.SetEmptyGauge() + dp = dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dpE") // resourceA.scopeC.metricD.dpE + return md + }() + assert.NoError(t, pmetrictest.CompareMetrics(expected, pmetricutiltest.NewMetrics("A", "BC", "D", "E"))) + }) + + t.Run("two_metrics", func(t *testing.T) { + expected := func() pmetric.Metrics { + md := pmetric.NewMetrics() + r := md.ResourceMetrics().AppendEmpty() + r.Resource().Attributes().PutStr("resourceName", "resourceA") // resourceA + s := r.ScopeMetrics().AppendEmpty() + s.Scope().SetName("scopeB") // resourceA.scopeB + m := s.Metrics().AppendEmpty() + m.SetName("metricC") // resourceA.scopeB.metricC + dps := m.SetEmptyGauge() + dp := dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dpE") // resourceA.scopeB.metricC.dpE + m = s.Metrics().AppendEmpty() + m.SetName("metricD") // resourceA.scopeB.metricD + dps = m.SetEmptyGauge() + dp = dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dpE") // resourceA.scopeB.metricD.dpE + return md + }() + assert.NoError(t, pmetrictest.CompareMetrics(expected, pmetricutiltest.NewMetrics("A", "B", "CD", "E"))) + }) + + t.Run("two_datapoints", func(t *testing.T) { + expected := func() pmetric.Metrics { + md := pmetric.NewMetrics() + r := md.ResourceMetrics().AppendEmpty() + r.Resource().Attributes().PutStr("resourceName", "resourceA") // resourceA + s := r.ScopeMetrics().AppendEmpty() + s.Scope().SetName("scopeB") // resourceA.scopeB + m := s.Metrics().AppendEmpty() + m.SetName("metricC") // resourceA.scopeB.metricC + dps := m.SetEmptyGauge() + dp := dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dpD") // resourceA.scopeB.metricC.dpD + dp = dps.DataPoints().AppendEmpty() + dp.Attributes().PutStr("dpName", "dpE") // resourceA.scopeB.metricC.dpE + return md + }() + assert.NoError(t, pmetrictest.CompareMetrics(expected, pmetricutiltest.NewMetrics("A", "B", "C", "DE"))) + }) +} diff --git a/connector/routingconnector/metrics_test.go b/connector/routingconnector/metrics_test.go index 47e7631f3337..f1eb9bd295a9 100644 --- a/connector/routingconnector/metrics_test.go +++ b/connector/routingconnector/metrics_test.go @@ -5,15 +5,11 @@ package routingconnector // import "github.com/open-telemetry/opentelemetry-coll import ( "context" - "os" - "path/filepath" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" - "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer" @@ -21,7 +17,7 @@ import ( "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pipeline" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector/internal/pmetricutiltest" ) func TestMetricsRegisterConsumersForValidRoute(t *testing.T) { @@ -502,63 +498,140 @@ func TestMetricsConnectorCapabilities(t *testing.T) { assert.False(t, conn.Capabilities().MutatesData) } -func TestMetricsConnectorDetailed(t *testing.T) { - testCases := []string{ - filepath.Join("testdata", "metrics", "resource_context", "all_match_first_only"), - filepath.Join("testdata", "metrics", "resource_context", "all_match_last_only"), - filepath.Join("testdata", "metrics", "resource_context", "all_match_once"), - filepath.Join("testdata", "metrics", "resource_context", "each_matches_one"), - filepath.Join("testdata", "metrics", "resource_context", "match_none_with_default"), - filepath.Join("testdata", "metrics", "resource_context", "match_none_without_default"), +func TestMetricsConnectorDetailedConcise(t *testing.T) { + idSink0 := pipeline.NewIDWithName(pipeline.SignalMetrics, "0") + idSink1 := pipeline.NewIDWithName(pipeline.SignalMetrics, "1") + idSinkD := pipeline.NewIDWithName(pipeline.SignalMetrics, "default") + + isNotNil := `attributes["resourceName"] != nil` + isA := `attributes["resourceName"] == "resourceA"` + isB := `attributes["resourceName"] == "resourceB"` + isX := `attributes["resourceName"] == "resourceX"` + isY := `attributes["resourceName"] == "resourceY"` + + testCfg := func(conditionZero, conditionOne string, withDefault bool) *Config { + cfg := createDefaultConfig().(*Config) + cfg.MatchOnce = true + cfg.Table = []RoutingTableItem{ + { + Condition: conditionZero, + Pipelines: []pipeline.ID{idSink0}, + }, + { + Condition: conditionOne, + Pipelines: []pipeline.ID{idSink1}, + }, + } + if withDefault { + cfg.DefaultPipelines = []pipeline.ID{idSinkD} + } + return cfg } - for _, tt := range testCases { - t.Run(tt, func(t *testing.T) { - - cm, err := confmaptest.LoadConf(filepath.Join(tt, "config.yaml")) - require.NoError(t, err) - factory := NewFactory() - cfg := factory.CreateDefaultConfig() - sub, err := cm.Sub("routing") - require.NoError(t, err) - require.NoError(t, sub.Unmarshal(cfg)) - require.NoError(t, component.ValidateConfig(cfg)) + testCases := []struct { + name string + cfg *Config + input pmetric.Metrics + expectSink0 pmetric.Metrics + expectSink1 pmetric.Metrics + expectSinkD pmetric.Metrics + }{ + { + name: "all_match_first_only", + cfg: testCfg(isNotNil, isY, true), + input: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink0: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink1: pmetric.Metrics{}, + expectSinkD: pmetric.Metrics{}, + }, + { + name: "all_match_last_only", + cfg: testCfg(isX, isNotNil, true), + input: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink0: pmetric.Metrics{}, + expectSink1: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSinkD: pmetric.Metrics{}, + }, + { + name: "all_match_only_once", + cfg: testCfg(isNotNil, isB, true), + input: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink0: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink1: pmetric.Metrics{}, + expectSinkD: pmetric.Metrics{}, + }, + { + name: "each_matches_one", + cfg: testCfg(isA, isB, true), + input: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink0: pmetricutiltest.NewMetrics("A", "CD", "EF", "FG"), + expectSink1: pmetricutiltest.NewMetrics("B", "CD", "EF", "FG"), + expectSinkD: pmetric.Metrics{}, + }, + { + name: "some_match_with_default", + cfg: testCfg(isX, isB, true), + input: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink0: pmetric.Metrics{}, + expectSink1: pmetricutiltest.NewMetrics("B", "CD", "EF", "FG"), + expectSinkD: pmetricutiltest.NewMetrics("A", "CD", "EF", "FG"), + }, + { + name: "some_match_without_default", + cfg: testCfg(isX, isB, false), + input: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink0: pmetric.Metrics{}, + expectSink1: pmetricutiltest.NewMetrics("B", "CD", "EF", "FG"), + expectSinkD: pmetric.Metrics{}, + }, + { + name: "match_none_with_default", + cfg: testCfg(isX, isY, true), + input: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink0: pmetric.Metrics{}, + expectSink1: pmetric.Metrics{}, + expectSinkD: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + }, + { + name: "match_none_without_default", + cfg: testCfg(isX, isY, false), + input: pmetricutiltest.NewMetrics("AB", "CD", "EF", "FG"), + expectSink0: pmetric.Metrics{}, + expectSink1: pmetric.Metrics{}, + expectSinkD: pmetric.Metrics{}, + }, + } - var sinkDefault, sink0, sink1 consumertest.MetricsSink + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + var sinkD, sink0, sink1 consumertest.MetricsSink router := connector.NewMetricsRouter(map[pipeline.ID]consumer.Metrics{ - pipeline.NewIDWithName(pipeline.SignalMetrics, "default"): &sinkDefault, pipeline.NewIDWithName(pipeline.SignalMetrics, "0"): &sink0, pipeline.NewIDWithName(pipeline.SignalMetrics, "1"): &sink1, + pipeline.NewIDWithName(pipeline.SignalMetrics, "default"): &sinkD, }) - conn, err := factory.CreateMetricsToMetrics( + conn, err := NewFactory().CreateMetricsToMetrics( context.Background(), connectortest.NewNopSettings(), - cfg, + tt.cfg, router.(consumer.Metrics), ) require.NoError(t, err) - input, readErr := golden.ReadMetrics(filepath.Join("testdata", "metrics", "input.yaml")) - require.NoError(t, readErr) - - require.NoError(t, conn.ConsumeMetrics(context.Background(), input)) - - assertExpected := func(actual []pmetric.Metrics, filePath string) { - expected, err := golden.ReadMetrics(filePath) - switch { - case err == nil: - require.Len(t, actual, 1) - assert.Equal(t, expected, actual[0]) - case os.IsNotExist(err): - assert.Empty(t, actual) - default: - t.Fatalf("Error reading %s: %v", filePath, err) + require.NoError(t, conn.ConsumeMetrics(context.Background(), tt.input)) + + assertExpected := func(sink *consumertest.MetricsSink, expected pmetric.Metrics, name string) { + if expected == (pmetric.Metrics{}) { + assert.Empty(t, sink.AllMetrics(), name) + } else { + require.Len(t, sink.AllMetrics(), 1, name) + assert.Equal(t, expected, sink.AllMetrics()[0], name) } } - assertExpected(sink0.AllMetrics(), filepath.Join(tt, "sink_0.yaml")) - assertExpected(sink1.AllMetrics(), filepath.Join(tt, "sink_1.yaml")) - assertExpected(sinkDefault.AllMetrics(), filepath.Join(tt, "sink_default.yaml")) + assertExpected(&sink0, tt.expectSink0, "sink0") + assertExpected(&sink1, tt.expectSink1, "sink1") + assertExpected(&sinkD, tt.expectSinkD, "sinkD") }) } } diff --git a/connector/routingconnector/testdata/metrics/input.yaml b/connector/routingconnector/testdata/metrics/input.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/testdata/metrics/input.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/testdata/metrics/resource_context/all_match_first_only/config.yaml b/connector/routingconnector/testdata/metrics/resource_context/all_match_first_only/config.yaml deleted file mode 100644 index 069af45fa6cc..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/all_match_first_only/config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -routing: - default_pipelines: - - metrics/default - table: - - condition: attributes["resourceName"] != nil - pipelines: - - metrics/0 - - condition: attributes["resourceName"] == "resourceY" - pipelines: - - metrics/1 diff --git a/connector/routingconnector/testdata/metrics/resource_context/all_match_first_only/sink_0.yaml b/connector/routingconnector/testdata/metrics/resource_context/all_match_first_only/sink_0.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/all_match_first_only/sink_0.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/testdata/metrics/resource_context/all_match_last_only/config.yaml b/connector/routingconnector/testdata/metrics/resource_context/all_match_last_only/config.yaml deleted file mode 100644 index 8fd8b583557e..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/all_match_last_only/config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -routing: - default_pipelines: - - metrics/default - table: - - condition: attributes["resourceName"] == "resourceX" - pipelines: - - metrics/0 - - condition: attributes["resourceName"] != nil - pipelines: - - metrics/1 diff --git a/connector/routingconnector/testdata/metrics/resource_context/all_match_last_only/sink_1.yaml b/connector/routingconnector/testdata/metrics/resource_context/all_match_last_only/sink_1.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/all_match_last_only/sink_1.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/testdata/metrics/resource_context/all_match_once/config.yaml b/connector/routingconnector/testdata/metrics/resource_context/all_match_once/config.yaml deleted file mode 100644 index 0d843a7201ae..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/all_match_once/config.yaml +++ /dev/null @@ -1,11 +0,0 @@ -routing: - match_once: true - default_pipelines: - - metrics/default - table: - - condition: attributes["resourceName"] != nil - pipelines: - - metrics/0 - - condition: attributes["resourceName"] == "resourceA" or attributes["resourceName"] == "resourceB" - pipelines: - - metrics/1 diff --git a/connector/routingconnector/testdata/metrics/resource_context/all_match_once/sink_0.yaml b/connector/routingconnector/testdata/metrics/resource_context/all_match_once/sink_0.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/all_match_once/sink_0.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/testdata/metrics/resource_context/each_matches_one/config.yaml b/connector/routingconnector/testdata/metrics/resource_context/each_matches_one/config.yaml deleted file mode 100644 index 9c570e759a42..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/each_matches_one/config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -routing: - default_pipelines: - - metrics/default - table: - - condition: attributes["resourceName"] == "resourceB" - pipelines: - - metrics/0 - - condition: attributes["resourceName"] == "resourceA" - pipelines: - - metrics/1 diff --git a/connector/routingconnector/testdata/metrics/resource_context/each_matches_one/sink_0.yaml b/connector/routingconnector/testdata/metrics/resource_context/each_matches_one/sink_0.yaml deleted file mode 100644 index b83427450811..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/each_matches_one/sink_0.yaml +++ /dev/null @@ -1,195 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/testdata/metrics/resource_context/each_matches_one/sink_1.yaml b/connector/routingconnector/testdata/metrics/resource_context/each_matches_one/sink_1.yaml deleted file mode 100644 index 705311b4fd43..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/each_matches_one/sink_1.yaml +++ /dev/null @@ -1,195 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/testdata/metrics/resource_context/match_none_with_default/config.yaml b/connector/routingconnector/testdata/metrics/resource_context/match_none_with_default/config.yaml deleted file mode 100644 index 33b8e511ea80..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/match_none_with_default/config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -routing: - default_pipelines: - - metrics/default - table: - - condition: attributes["resourceName"] == "resourceX" - pipelines: - - metrics/0 - - condition: attributes["resourceName"] == "resourceY" - pipelines: - - metrics/1 diff --git a/connector/routingconnector/testdata/metrics/resource_context/match_none_with_default/sink_default.yaml b/connector/routingconnector/testdata/metrics/resource_context/match_none_with_default/sink_default.yaml deleted file mode 100644 index 68145249e0bd..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/match_none_with_default/sink_default.yaml +++ /dev/null @@ -1,389 +0,0 @@ -resourceMetrics: - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceA - - key: resourceNameAgain - value: - stringValue: resourceA - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - resource: - attributes: - - key: resourceName - value: - stringValue: resourceB - - key: resourceNameAgain - value: - stringValue: resourceB - schemaUrl: https://opentelemetry.io/schemas/1.6.1 - scopeMetrics: - - attributes: - - key: scopeName - value: - stringValue: scopeA - - key: scopeNameAgain - value: - stringValue: scopeA - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" - - attributes: - - key: scopeName - value: - stringValue: scopeB - - key: scopeNameAgain - value: - stringValue: scopeB - metrics: - - name: sumMonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "101" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "102" - - name: sumNonmonotonicCumulative - sum: - aggregationTemporality: 2 # AGGREGATION_TEMPORALITY_CUMULATIVE - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "102" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "101" - - name: sumMonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: true - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "1" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "2" - - name: sumNonmonotonicDelta - sum: - aggregationTemporality: 1 # AGGREGATION_TEMPORALITY_DELTA - isMonotonic: false - dataPoints: - - attributes: - - key: dataPointName - value: - stringValue: dataPointA - - key: dataPointNameAgain - value: - stringValue: dataPointA - asInt: "2" - - attributes: - - key: dataPointName - value: - stringValue: dataPointB - - key: dataPointNameAgain - value: - stringValue: dataPointB - asInt: "1" diff --git a/connector/routingconnector/testdata/metrics/resource_context/match_none_without_default/config.yaml b/connector/routingconnector/testdata/metrics/resource_context/match_none_without_default/config.yaml deleted file mode 100644 index fabaa8a1b5c8..000000000000 --- a/connector/routingconnector/testdata/metrics/resource_context/match_none_without_default/config.yaml +++ /dev/null @@ -1,10 +0,0 @@ -routing: - match_once: true - # no default pipelines - table: - - condition: attributes["resourceName"] == "resourceX" - pipelines: - - metrics/0 - - condition: attributes["resourceName"] == "resourceY" - pipelines: - - metrics/1