From 064e87ce87a84e7e47dfef6b97a5d63469b2448f Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Tue, 12 Nov 2024 11:40:44 +0000 Subject: [PATCH 1/4] [processor/interval]Fix incorrect exponential histogram test --- .../exp_histograms_are_aggregated/input.yaml | 2 +- .../exp_histograms_are_aggregated/output.yaml | 46 +++++++++++-------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/input.yaml b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/input.yaml index ccbc4815195d..23c4f66979fa 100644 --- a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/input.yaml +++ b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/input.yaml @@ -16,7 +16,7 @@ resourceMetrics: stringValue: bar metrics: - name: cumulative.exphistogram.test - histogram: + exponentialHistogram: aggregationTemporality: 2 dataPoints: - timeUnixNano: 50 diff --git a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml index 3973030fef16..94070855070b 100644 --- a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml +++ b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml @@ -1,34 +1,44 @@ resourceMetrics: - - schemaUrl: https://test-res-schema.com/schema - resource: + - resource: attributes: - key: asdf value: stringValue: foo + schemaUrl: https://test-res-schema.com/schema scopeMetrics: - - schemaUrl: https://test-scope-schema.com/schema - scope: - name: MyTestInstrument - version: "1.2.3" + - scope: attributes: - key: foo value: stringValue: bar + name: MyTestInstrument + version: 1.2.3 + schemaUrl: https://test-scope-schema.com/schema metrics: - - name: cumulative.exphistogram.test - histogram: + - exponentialHistogram: aggregationTemporality: 2 dataPoints: - - timeUnixNano: 80 - scale: 4 - zeroCount: 5 - positive: - offset: 2 - bucketCounts: [9, 12, 17, 8, 34] - negative: - offset: 6 - bucketCounts: [6, 21, 9, 19, 7] - attributes: + - attributes: - key: aaa value: stringValue: bbb + negative: + bucketCounts: + - 6 + - 21 + - 9 + - 19 + - 7 + offset: 6 + positive: + bucketCounts: + - 9 + - 12 + - 17 + - 8 + - 34 + offset: 2 + scale: 4 + timeUnixNano: 80 + zeroCount: 5 + name: cumulative.exphistogram.test From a9709261a17c4e5c7ed4edb7374bcb69b168cada Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Tue, 12 Nov 2024 13:11:21 +0000 Subject: [PATCH 2/4] one-line array --- .../exp_histograms_are_aggregated/output.yaml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml index 94070855070b..6a8a9be527fa 100644 --- a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml +++ b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml @@ -23,20 +23,10 @@ resourceMetrics: value: stringValue: bbb negative: - bucketCounts: - - 6 - - 21 - - 9 - - 19 - - 7 + bucketCounts: [6, 21, 9, 19, 7] offset: 6 positive: - bucketCounts: - - 9 - - 12 - - 17 - - 8 - - 34 + bucketCounts: [9, 12, 17, 8, 34] offset: 2 scale: 4 timeUnixNano: 80 From 625f66e17ea9460515f34c9277010c5cba4cc608 Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Tue, 12 Nov 2024 13:15:55 +0000 Subject: [PATCH 3/4] Reduce unnecessary diffs --- .../exp_histograms_are_aggregated/output.yaml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml index 6a8a9be527fa..8ce9444d4fa7 100644 --- a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml +++ b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml @@ -1,34 +1,34 @@ resourceMetrics: - - resource: + - schemaUrl: https://test-res-schema.com/schema + resource: attributes: - key: asdf value: stringValue: foo - schemaUrl: https://test-res-schema.com/schema scopeMetrics: - - scope: + - schemaUrl: https://test-scope-schema.com/schema + scope: + name: MyTestInstrument + version: 1.2.3 attributes: - key: foo value: stringValue: bar - name: MyTestInstrument - version: 1.2.3 - schemaUrl: https://test-scope-schema.com/schema metrics: - - exponentialHistogram: + - name: cumulative.exphistogram.test + exponentialHistogram: aggregationTemporality: 2 dataPoints: - - attributes: + - timeUnixNano: 80 + scale: 4 + zeroCount: 5 + attributes: - key: aaa value: stringValue: bbb - negative: - bucketCounts: [6, 21, 9, 19, 7] - offset: 6 positive: bucketCounts: [9, 12, 17, 8, 34] offset: 2 - scale: 4 - timeUnixNano: 80 - zeroCount: 5 - name: cumulative.exphistogram.test + negative: + bucketCounts: [6, 21, 9, 19, 7] + offset: 6 From 414c7e4dd41fad962b9cbbc30b35f48042428c12 Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Tue, 12 Nov 2024 13:17:08 +0000 Subject: [PATCH 4/4] Reduce unnecessary diffs --- .../testdata/exp_histograms_are_aggregated/output.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml index 8ce9444d4fa7..38985e088ac2 100644 --- a/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml +++ b/processor/intervalprocessor/testdata/exp_histograms_are_aggregated/output.yaml @@ -9,7 +9,7 @@ resourceMetrics: - schemaUrl: https://test-scope-schema.com/schema scope: name: MyTestInstrument - version: 1.2.3 + version: "1.2.3" attributes: - key: foo value: @@ -22,13 +22,13 @@ resourceMetrics: - timeUnixNano: 80 scale: 4 zeroCount: 5 - attributes: - - key: aaa - value: - stringValue: bbb positive: bucketCounts: [9, 12, 17, 8, 34] offset: 2 negative: bucketCounts: [6, 21, 9, 19, 7] offset: 6 + attributes: + - key: aaa + value: + stringValue: bbb