From d4bc88103523311c000a4f1db8abf881961d0aee Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Tue, 24 Feb 2026 15:38:51 +0100 Subject: [PATCH 1/5] [chore][countconnector]: fix testdata for profiles This is a complementary change for https://github.com/open-telemetry/opentelemetry-collector/pull/14546. With the change in the Profiling signal, the data in input.yaml no longer meets the expected format. Signed-off-by: Florian Lehner --- .../testdata/profiles/input.yaml | 274 ++++++++++-------- 1 file changed, 149 insertions(+), 125 deletions(-) diff --git a/connector/countconnector/testdata/profiles/input.yaml b/connector/countconnector/testdata/profiles/input.yaml index 8f022e5b89a6e..4bfbe97dbd15d 100644 --- a/connector/countconnector/testdata/profiles/input.yaml +++ b/connector/countconnector/testdata/profiles/input.yaml @@ -1,150 +1,174 @@ +dictionary: + attributeTable: + - {} + - keyStrindex: 1 + value: + stringValue: foo + - keyStrindex: 2 + value: + stringValue: bar + - keyStrindex: 2 + value: + stringValue: notbar + - keyStrindex: 1 + value: + stringValue: notfoo + stackTable: + - {} + stringTable: + - "" + - profile.required + - profile.optional + - foo + - bar + - notbar + - notfoo + - resource.required + - resource.optional resourceProfiles: - resource: attributes: - - key: resource.required + - keyRef: 7 value: - stringValue: foo - - key: resource.optional + stringValueRef: 3 + - keyRef: 8 value: - stringValue: bar + stringValueRef: 4 scopeProfiles: - profiles: - - attributeIndices: [0, 1] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 10000 - - attributeIndices: [0, 2] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 10000 - - attributeIndices: [3] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - - attributeIndices: [] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 100 + - attributeIndices: + - 1 + - 2 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - attributeIndices: + - 1 + - 3 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - attributeIndices: + - 4 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" scope: {} - - resource: attributes: - - key: resource.required + - keyRef: 7 value: - stringValue: foo - - key: resource.optional + stringValueRef: 3 + - keyRef: 8 value: - stringValue: notbar + stringValueRef: 5 scopeProfiles: - profiles: - - attributeIndices: [0, 1] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 10000 - - attributeIndices: [0, 2] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 10000 - - attributeIndices: [3] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - - attributeIndices: [] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 100 + - attributeIndices: + - 1 + - 2 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - attributeIndices: + - 1 + - 3 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - attributeIndices: + - 4 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" scope: {} - - resource: attributes: - - key: resource.required + - keyRef: 7 value: - stringValue: notfoo + stringValueRef: 6 scopeProfiles: - profiles: - - attributeIndices: [0, 1] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 10000 - - attributeIndices: [0, 2] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 10000 - - attributeIndices: [3] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - - attributeIndices: [] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 100 + - attributeIndices: + - 1 + - 2 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - attributeIndices: + - 1 + - 3 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - attributeIndices: + - 4 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" scope: {} - - resource: {} scopeProfiles: - profiles: - - attributeIndices: [0, 1] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 10000 - - attributeIndices: [0, 2] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 10000 - - attributeIndices: [3] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - - attributeIndices: [] - sample: - - timestampsUnixNano: ["0"] - sampleType: - unitStrindex: 0 - duration: 100 + - attributeIndices: + - 1 + - 2 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - attributeIndices: + - 3 + - 1 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - attributeIndices: + - 4 + periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" + - periodType: {} + sampleType: {} + samples: + - timestampsUnixNano: + - "0" scope: {} -dictionary: - attributeTable: - - keyStrindex: 1 - value: - stringValue: foo - - keyStrindex: 2 - value: - stringValue: bar - - keyStrindex: 2 - value: - stringValue: notbar - - keyStrindex: 1 - value: - stringValue: notfoo - stringTable: - - count - - profile.required - - profile.optional - stackTable: - - {} From 792ce162471808dbd253e48565f5ccaf0e163154 Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Thu, 26 Feb 2026 15:40:47 +0100 Subject: [PATCH 2/5] fileexporter: fix test Signed-off-by: Florian Lehner --- exporter/fileexporter/file_exporter_test.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/exporter/fileexporter/file_exporter_test.go b/exporter/fileexporter/file_exporter_test.go index 2ef19f4f5c7f4..cdd8af11fb686 100644 --- a/exporter/fileexporter/file_exporter_test.go +++ b/exporter/fileexporter/file_exporter_test.go @@ -539,6 +539,13 @@ func TestFileProfilesExporter(t *testing.T) { assert.NoError(t, fe.Shutdown(t.Context())) }() + // Create expected by marshaling and unmarshaling pd the same way + // This ensures the internal dictionary structure matches + expectedBuf, err := profilesMarshalers[tt.args.conf.FormatType].MarshalProfiles(testdata.GenerateProfilesTwoProfilesSameResource()) + assert.NoError(t, err) + expected, err := tt.args.unmarshaler.UnmarshalProfiles(expectedBuf) + assert.NoError(t, err) + fi, err := os.Open(fe.writer.path) assert.NoError(t, err) defer fi.Close() @@ -559,7 +566,7 @@ func TestFileProfilesExporter(t *testing.T) { assert.NoError(t, err) got, err := tt.args.unmarshaler.UnmarshalProfiles(buf) assert.NoError(t, err) - assert.Equal(t, pd, got) + assert.Equal(t, expected, got) } }) } @@ -738,7 +745,12 @@ func TestConcurrentlyCompress(t *testing.T) { profilesUnmarshaler := &pprofile.JSONUnmarshaler{} gotPd, err := profilesUnmarshaler.UnmarshalProfiles(buf) assert.NoError(t, err) - assert.Equal(t, pd, gotPd) + // Create expected by marshaling and unmarshaling pd the same way + expectedBuf, err := profilesMarshalers[formatTypeJSON].MarshalProfiles(testdata.GenerateProfilesTwoProfilesSameResource()) + assert.NoError(t, err) + expectedPd, err := profilesUnmarshaler.UnmarshalProfiles(expectedBuf) + assert.NoError(t, err) + assert.Equal(t, expectedPd, gotPd) } // tsBuffer is a thread safe buffer to prevent race conditions in the CI/CD. From 5f92cd1922a8862089ac35fb11a98251f411f5dd Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Tue, 10 Mar 2026 13:56:03 +0100 Subject: [PATCH 3/5] update naming Signed-off-by: Florian Lehner --- .../profiles/condition_and_attribute.yaml | 4 ++++ .../profiles/default_attribute_value.yaml | 12 ++++++++++ .../testdata/profiles/input.yaml | 20 ++++++++--------- .../profiles/multiple_attributes.yaml | 8 +++++++ .../profiles/multiple_conditions.yaml | 2 ++ .../testdata/profiles/multiple_metrics.yaml | 22 ++++++++++++------- .../testdata/profiles/one_attribute.yaml | 8 +++++++ .../testdata/profiles/one_condition.yaml | 2 ++ .../testdata/profiles/zero_conditions.yaml | 4 ++++ 9 files changed, 64 insertions(+), 18 deletions(-) diff --git a/connector/countconnector/testdata/profiles/condition_and_attribute.yaml b/connector/countconnector/testdata/profiles/condition_and_attribute.yaml index 7dee7a916159f..60ca263a0cfeb 100644 --- a/connector/countconnector/testdata/profiles/condition_and_attribute.yaml +++ b/connector/countconnector/testdata/profiles/condition_and_attribute.yaml @@ -19,12 +19,14 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -49,12 +51,14 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: diff --git a/connector/countconnector/testdata/profiles/default_attribute_value.yaml b/connector/countconnector/testdata/profiles/default_attribute_value.yaml index dd51c3f039e0f..a71c067edadc9 100644 --- a/connector/countconnector/testdata/profiles/default_attribute_value.yaml +++ b/connector/countconnector/testdata/profiles/default_attribute_value.yaml @@ -15,6 +15,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -24,6 +25,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -33,6 +35,7 @@ resourceMetrics: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -57,6 +60,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -66,6 +70,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -75,6 +80,7 @@ resourceMetrics: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -102,6 +108,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -111,6 +118,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -120,6 +128,7 @@ resourceMetrics: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -147,6 +156,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -156,6 +166,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -165,6 +176,7 @@ resourceMetrics: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: diff --git a/connector/countconnector/testdata/profiles/input.yaml b/connector/countconnector/testdata/profiles/input.yaml index 4bfbe97dbd15d..d9ff9b26de584 100644 --- a/connector/countconnector/testdata/profiles/input.yaml +++ b/connector/countconnector/testdata/profiles/input.yaml @@ -28,12 +28,12 @@ dictionary: resourceProfiles: - resource: attributes: - - keyRef: 7 + - keyStrindex: 7 value: - stringValueRef: 3 - - keyRef: 8 + stringValueStrindex: 3 + - keyStrindex: 8 value: - stringValueRef: 4 + stringValueStrindex: 4 scopeProfiles: - profiles: - attributeIndices: @@ -67,12 +67,12 @@ resourceProfiles: scope: {} - resource: attributes: - - keyRef: 7 + - keyStrindex: 7 value: - stringValueRef: 3 - - keyRef: 8 + stringValueStrindex: 3 + - keyStrindex: 8 value: - stringValueRef: 5 + stringValueStrindex: 5 scopeProfiles: - profiles: - attributeIndices: @@ -106,9 +106,9 @@ resourceProfiles: scope: {} - resource: attributes: - - keyRef: 7 + - keyStrindex: 7 value: - stringValueRef: 6 + stringValueStrindex: 6 scopeProfiles: - profiles: - attributeIndices: diff --git a/connector/countconnector/testdata/profiles/multiple_attributes.yaml b/connector/countconnector/testdata/profiles/multiple_attributes.yaml index 0599b97c9bd92..b2a4113d37e70 100644 --- a/connector/countconnector/testdata/profiles/multiple_attributes.yaml +++ b/connector/countconnector/testdata/profiles/multiple_attributes.yaml @@ -15,6 +15,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -24,6 +25,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -48,6 +50,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -57,6 +60,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -84,6 +88,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -93,6 +98,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -120,6 +126,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: @@ -129,6 +136,7 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: diff --git a/connector/countconnector/testdata/profiles/multiple_conditions.yaml b/connector/countconnector/testdata/profiles/multiple_conditions.yaml index 8baee9b89f41c..a2410830bc38f 100644 --- a/connector/countconnector/testdata/profiles/multiple_conditions.yaml +++ b/connector/countconnector/testdata/profiles/multiple_conditions.yaml @@ -15,6 +15,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -35,6 +36,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: diff --git a/connector/countconnector/testdata/profiles/multiple_metrics.yaml b/connector/countconnector/testdata/profiles/multiple_metrics.yaml index f932fb7c507f7..de69cc570e0f4 100644 --- a/connector/countconnector/testdata/profiles/multiple_metrics.yaml +++ b/connector/countconnector/testdata/profiles/multiple_metrics.yaml @@ -8,6 +8,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -25,6 +26,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -39,20 +41,22 @@ resourceMetrics: stringValue: foo scopeMetrics: - metrics: - - description: All profiles count - name: count.all + - description: Count if ... + name: count.if sum: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true - - description: Count if ... - name: count.if + - description: All profiles count + name: count.all sum: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -67,20 +71,22 @@ resourceMetrics: stringValue: foo scopeMetrics: - metrics: - - description: All profiles count - name: count.all + - description: Count if ... + name: count.if sum: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true - - description: Count if ... - name: count.if + - description: All profiles count + name: count.all sum: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: diff --git a/connector/countconnector/testdata/profiles/one_attribute.yaml b/connector/countconnector/testdata/profiles/one_attribute.yaml index 819e1ad0cbe94..d324687a2c5c3 100644 --- a/connector/countconnector/testdata/profiles/one_attribute.yaml +++ b/connector/countconnector/testdata/profiles/one_attribute.yaml @@ -12,12 +12,14 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -39,12 +41,14 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -69,12 +73,14 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -99,12 +105,14 @@ resourceMetrics: - key: profile.required value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" - asInt: "1" attributes: - key: profile.required value: stringValue: notfoo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: diff --git a/connector/countconnector/testdata/profiles/one_condition.yaml b/connector/countconnector/testdata/profiles/one_condition.yaml index 8baee9b89f41c..a2410830bc38f 100644 --- a/connector/countconnector/testdata/profiles/one_condition.yaml +++ b/connector/countconnector/testdata/profiles/one_condition.yaml @@ -15,6 +15,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -35,6 +36,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: diff --git a/connector/countconnector/testdata/profiles/zero_conditions.yaml b/connector/countconnector/testdata/profiles/zero_conditions.yaml index c7a96506c32a9..c6e1b56bf05fe 100644 --- a/connector/countconnector/testdata/profiles/zero_conditions.yaml +++ b/connector/countconnector/testdata/profiles/zero_conditions.yaml @@ -8,6 +8,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -25,6 +26,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -45,6 +47,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -65,6 +68,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "4" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: From 5b13261951a723b2bd8e0878d72138d3565bd4a3 Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Wed, 11 Mar 2026 14:35:42 +0100 Subject: [PATCH 4/5] fix kafka handling of profiles Signed-off-by: Florian Lehner --- .../internal/marshaler/pdata_marshaler_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/exporter/kafkaexporter/internal/marshaler/pdata_marshaler_test.go b/exporter/kafkaexporter/internal/marshaler/pdata_marshaler_test.go index 9e7426c40f1d5..e283b863fe4c0 100644 --- a/exporter/kafkaexporter/internal/marshaler/pdata_marshaler_test.go +++ b/exporter/kafkaexporter/internal/marshaler/pdata_marshaler_test.go @@ -102,7 +102,14 @@ func testPdataMarshaler[Data any]( require.Len(t, messages, 1) // 1 message per batch assert.Nil(t, messages[0].Key) + // Create expected by marshaling and unmarshaling input the same way + // This ensures the internal dictionary structure matches + expectedBytes, err := marshal(input) + require.NoError(t, err) + expected, err := unmarshal(expectedBytes[0].Value) + require.NoError(t, err) + output, err := unmarshal(messages[0].Value) require.NoError(t, err) - assert.NoError(t, compare(input, output)) + assert.NoError(t, compare(expected, output)) } From 08dd37558884d9ccdc1b23d596808ef2fbc24c01 Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Wed, 11 Mar 2026 14:58:39 +0100 Subject: [PATCH 5/5] fix signaltometricsconnector Signed-off-by: Florian Lehner --- .../connector_test.go | 1 + .../exponential_histograms/output.yaml | 2 + .../testdata/profiles/histograms/output.yaml | 2 + .../testdata/profiles/profiles.yaml | 64 ++++++++++--------- .../testdata/profiles/sum/output.yaml | 2 + 5 files changed, 42 insertions(+), 29 deletions(-) diff --git a/connector/signaltometricsconnector/connector_test.go b/connector/signaltometricsconnector/connector_test.go index 0cc181005a0b7..9b476b3b4edb7 100644 --- a/connector/signaltometricsconnector/connector_test.go +++ b/connector/signaltometricsconnector/connector_test.go @@ -365,6 +365,7 @@ func assertAggregatedMetrics(t *testing.T, expected, actual pmetric.Metrics) { pmetrictest.IgnoreMetricDataPointsOrder(), pmetrictest.IgnoreMetricsOrder(), pmetrictest.IgnoreTimestamp(), + pmetrictest.IgnoreStartTimestamp(), )) } diff --git a/connector/signaltometricsconnector/testdata/profiles/exponential_histograms/output.yaml b/connector/signaltometricsconnector/testdata/profiles/exponential_histograms/output.yaml index d03a54eedec60..bbc6c4338c751 100644 --- a/connector/signaltometricsconnector/testdata/profiles/exponential_histograms/output.yaml +++ b/connector/signaltometricsconnector/testdata/profiles/exponential_histograms/output.yaml @@ -39,6 +39,7 @@ resourceMetrics: negative: {} positive: {} sum: 0 + startTimeUnixNano: "1000000" timeUnixNano: "1000000" zeroCount: "1" name: profiles.foo.exphistogram @@ -64,6 +65,7 @@ resourceMetrics: negative: {} positive: {} sum: 0 + startTimeUnixNano: "1000000" timeUnixNano: "1000000" zeroCount: "3" name: total.profiles.resource.foo.exphistogram diff --git a/connector/signaltometricsconnector/testdata/profiles/histograms/output.yaml b/connector/signaltometricsconnector/testdata/profiles/histograms/output.yaml index bb8321f9cc4f9..af6b25aafa04b 100644 --- a/connector/signaltometricsconnector/testdata/profiles/histograms/output.yaml +++ b/connector/signaltometricsconnector/testdata/profiles/histograms/output.yaml @@ -56,6 +56,7 @@ resourceMetrics: - 100 - 200 sum: 0 + startTimeUnixNano: "1000000" timeUnixNano: "1000000" name: profiles.foo.histogram scope: @@ -89,6 +90,7 @@ resourceMetrics: - 100 - 200 sum: 0 + startTimeUnixNano: "1000000" timeUnixNano: "1000000" name: total.profiles.resource.foo.histogram scope: diff --git a/connector/signaltometricsconnector/testdata/profiles/profiles.yaml b/connector/signaltometricsconnector/testdata/profiles/profiles.yaml index 0afd48b3804d7..ec41c99b549b6 100644 --- a/connector/signaltometricsconnector/testdata/profiles/profiles.yaml +++ b/connector/signaltometricsconnector/testdata/profiles/profiles.yaml @@ -1,12 +1,43 @@ +dictionary: + attributeTable: + - keyStrindex: 0 + value: + stringValue: foo + - keyStrindex: 1 + value: + stringValue: bar + - keyStrindex: 2 + value: + stringValue: foo + - keyStrindex: 3 + value: + stringValue: notbar + - keyStrindex: 3 + value: + stringValue: notbar + - keyStrindex: 2 + value: + stringValue: notfoo + stringTable: + - profile.foo + - profile.bar + - profile.required + - profile.optional + - foo + - bar + - notbar + - notfoo + - resource.foo + - resource.bar resourceProfiles: - resource: attributes: - - key: resource.foo + - keyStrindex: 8 value: - stringValue: foo - - key: resource.bar + stringValueStrindex: 4 + - keyStrindex: 9 value: - stringValue: bar + stringValueStrindex: 5 scopeProfiles: - profiles: - attributeIndices: [0, 1] @@ -29,28 +60,3 @@ resourceProfiles: sampleType: unitStrindex: 0 scope: {} -dictionary: - attributeTable: - - keyStrindex: 0 - value: - stringValue: foo - - keyStrindex: 1 - value: - stringValue: bar - - keyStrindex: 2 - value: - stringValue: foo - - keyStrindex: 3 - value: - stringValue: notbar - - keyStrindex: 3 - value: - stringValue: notbar - - keyStrindex: 2 - value: - stringValue: notfoo - stringTable: - - profile.foo - - profile.bar - - profile.required - - profile.optional diff --git a/connector/signaltometricsconnector/testdata/profiles/sum/output.yaml b/connector/signaltometricsconnector/testdata/profiles/sum/output.yaml index 48841e655bd9b..205286298e984 100644 --- a/connector/signaltometricsconnector/testdata/profiles/sum/output.yaml +++ b/connector/signaltometricsconnector/testdata/profiles/sum/output.yaml @@ -30,6 +30,7 @@ resourceMetrics: - key: profile.foo value: stringValue: foo + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: @@ -50,6 +51,7 @@ resourceMetrics: aggregationTemporality: 1 dataPoints: - asInt: "3" + startTimeUnixNano: "1000000" timeUnixNano: "1000000" isMonotonic: true scope: