From b45db8f10313d286f989d771bc65fe844b864bd7 Mon Sep 17 00:00:00 2001 From: yeya24 Date: Tue, 23 Mar 2021 20:32:39 -0400 Subject: [PATCH 1/4] set spanmetricsprocessor calls metric IsMonotic to true Signed-off-by: yeya24 --- processor/spanmetricsprocessor/processor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/processor/spanmetricsprocessor/processor.go b/processor/spanmetricsprocessor/processor.go index c797f63d92ff..c8ea800172cd 100644 --- a/processor/spanmetricsprocessor/processor.go +++ b/processor/spanmetricsprocessor/processor.go @@ -247,6 +247,7 @@ func (p *processorImp) collectCallMetrics(ilm *pdata.InstrumentationLibraryMetri mCalls := pdata.NewMetric() mCalls.SetDataType(pdata.MetricDataTypeIntSum) mCalls.SetName("calls") + mCalls.IntSum().SetIsMonotonic(true) mCalls.IntSum().DataPoints().Append(dpCalls) mCalls.IntSum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) ilm.Metrics().Append(mCalls) From e26b4f31c13efed0cc128ef24fa08b8ed5503dc6 Mon Sep 17 00:00:00 2001 From: yeya24 Date: Tue, 23 Mar 2021 21:28:59 -0400 Subject: [PATCH 2/4] rename calls to calls_total Signed-off-by: yeya24 --- processor/spanmetricsprocessor/processor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processor/spanmetricsprocessor/processor.go b/processor/spanmetricsprocessor/processor.go index c8ea800172cd..35d574edfd58 100644 --- a/processor/spanmetricsprocessor/processor.go +++ b/processor/spanmetricsprocessor/processor.go @@ -246,7 +246,7 @@ func (p *processorImp) collectCallMetrics(ilm *pdata.InstrumentationLibraryMetri mCalls := pdata.NewMetric() mCalls.SetDataType(pdata.MetricDataTypeIntSum) - mCalls.SetName("calls") + mCalls.SetName("calls_total") mCalls.IntSum().SetIsMonotonic(true) mCalls.IntSum().DataPoints().Append(dpCalls) mCalls.IntSum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) From 5d31c95dd8878ee0f4466fe0b0fc962fc46bb48a Mon Sep 17 00:00:00 2001 From: yeya24 Date: Tue, 23 Mar 2021 22:37:44 -0400 Subject: [PATCH 3/4] address comments Signed-off-by: yeya24 --- processor/spanmetricsprocessor/processor_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/processor/spanmetricsprocessor/processor_test.go b/processor/spanmetricsprocessor/processor_test.go index 7047f3da04a9..58603b222256 100644 --- a/processor/spanmetricsprocessor/processor_test.go +++ b/processor/spanmetricsprocessor/processor_test.go @@ -307,10 +307,11 @@ func verifyConsumeMetricsInput(input pdata.Metrics, t *testing.T) bool { mi := 0 // The first 3 metrics are for call counts. for ; mi < 3; mi++ { - assert.Equal(t, "calls", m.At(mi).Name()) + assert.Equal(t, "calls_total", m.At(mi).Name()) data := m.At(mi).IntSum() assert.Equal(t, pdata.AggregationTemporalityCumulative, data.AggregationTemporality()) + assert.Equal(t, true, data.IsMonotonic()) dps := data.DataPoints() require.Equal(t, 1, dps.Len()) From 79dc7d8610fd154f17f8e6fe660ad9be28008cea Mon Sep 17 00:00:00 2001 From: yeya24 Date: Wed, 24 Mar 2021 10:14:13 -0400 Subject: [PATCH 4/4] update Signed-off-by: yeya24 --- processor/spanmetricsprocessor/processor_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processor/spanmetricsprocessor/processor_test.go b/processor/spanmetricsprocessor/processor_test.go index 58603b222256..f504d9eca7ab 100644 --- a/processor/spanmetricsprocessor/processor_test.go +++ b/processor/spanmetricsprocessor/processor_test.go @@ -311,7 +311,7 @@ func verifyConsumeMetricsInput(input pdata.Metrics, t *testing.T) bool { data := m.At(mi).IntSum() assert.Equal(t, pdata.AggregationTemporalityCumulative, data.AggregationTemporality()) - assert.Equal(t, true, data.IsMonotonic()) + assert.True(t, data.IsMonotonic()) dps := data.DataPoints() require.Equal(t, 1, dps.Len())