diff --git a/influx2otel/go.mod b/influx2otel/go.mod index a13e003e..97cd76d5 100644 --- a/influx2otel/go.mod +++ b/influx2otel/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/influxdata/influxdb-observability/common v0.2.7 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/collector/model v0.35.0 + go.opentelemetry.io/collector/model v0.36.1-0.20210927193005-ebb0fbd6f23e ) replace github.com/influxdata/influxdb-observability/common => ../common diff --git a/influx2otel/go.sum b/influx2otel/go.sum index c2947e8b..5a53ed39 100644 --- a/influx2otel/go.sum +++ b/influx2otel/go.sum @@ -5,10 +5,12 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -19,6 +21,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -69,8 +72,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opentelemetry.io/collector/model v0.35.0 h1:NpKjghiqlei4ecwjOYOMhD6tj4gY8yiWHPJmbFs/ArI= go.opentelemetry.io/collector/model v0.35.0/go.mod h1:+7YCSjJG+MqiIFjauzt7oM2qkqBsaJWh5hcsO4fwsAc= +go.opentelemetry.io/collector/model v0.36.1-0.20210927193005-ebb0fbd6f23e h1:d4pAfuyfjjq39C0DoaMp2AzRMRJ3uJduQ8BPYEsLfBY= +go.opentelemetry.io/collector/model v0.36.1-0.20210927193005-ebb0fbd6f23e/go.mod h1:ESh1oWDNdS4fTg9sTFoYuiuvs8QuaX8yNGTPix3JZc8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -153,8 +157,9 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/influx2otel/metrics.go b/influx2otel/metrics.go index 957e5ba1..faea5cfa 100644 --- a/influx2otel/metrics.go +++ b/influx2otel/metrics.go @@ -150,10 +150,10 @@ func (b *MetricsBatch) lookupMetric(metricName string, tags map[string]string, v case common.InfluxMetricValueTypeSum: metric.SetDataType(pdata.MetricDataTypeSum) metric.Sum().SetIsMonotonic(true) - metric.Sum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) case common.InfluxMetricValueTypeHistogram: metric.SetDataType(pdata.MetricDataTypeHistogram) - metric.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + metric.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) case common.InfluxMetricValueTypeSummary: metric.SetDataType(pdata.MetricDataTypeSummary) default: diff --git a/influx2otel/metrics_telegraf_prometheus_v1_test.go b/influx2otel/metrics_telegraf_prometheus_v1_test.go index d2877e96..59eb304d 100644 --- a/influx2otel/metrics_telegraf_prometheus_v1_test.go +++ b/influx2otel/metrics_telegraf_prometheus_v1_test.go @@ -163,7 +163,7 @@ func TestAddPoint_v1_sum(t *testing.T) { m.SetName("http_requests_total") m.SetDataType(pdata.MetricDataTypeSum) m.Sum().SetIsMonotonic(true) - m.Sum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Sum().DataPoints().AppendEmpty() dp.Attributes().InsertString("code", "200") dp.Attributes().InsertString("method", "post") @@ -223,7 +223,7 @@ func TestAddPoint_v1_untypedSum(t *testing.T) { m.SetName("http_requests_total") m.SetDataType(pdata.MetricDataTypeSum) m.Sum().SetIsMonotonic(true) - m.Sum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Sum().DataPoints().AppendEmpty() dp.Attributes().InsertString("code", "200") dp.Attributes().InsertString("method", "post") @@ -273,7 +273,7 @@ func TestAddPoint_v1_histogram(t *testing.T) { m := ilMetrics.Metrics().AppendEmpty() m.SetName("http_request_duration_seconds") m.SetDataType(pdata.MetricDataTypeHistogram) - m.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Histogram().DataPoints().AppendEmpty() dp.Attributes().InsertString("code", "200") dp.Attributes().InsertString("method", "post") @@ -321,7 +321,7 @@ func TestAddPoint_v1_untypedHistogram(t *testing.T) { m := ilMetrics.Metrics().AppendEmpty() m.SetName("http_request_duration_seconds") m.SetDataType(pdata.MetricDataTypeHistogram) - m.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Histogram().DataPoints().AppendEmpty() dp.Attributes().InsertString("code", "200") dp.Attributes().InsertString("method", "post") @@ -429,7 +429,7 @@ func TestAddPoint_v1_untypedSummary(t *testing.T) { m := ilMetrics.Metrics().AppendEmpty() m.SetName("rpc_duration_seconds") m.SetDataType(pdata.MetricDataTypeHistogram) - m.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Histogram().DataPoints().AppendEmpty() dp.Attributes().InsertString("code", "200") dp.Attributes().InsertString("method", "post") diff --git a/influx2otel/metrics_telegraf_prometheus_v2_test.go b/influx2otel/metrics_telegraf_prometheus_v2_test.go index 4bb571dd..c5b915e8 100644 --- a/influx2otel/metrics_telegraf_prometheus_v2_test.go +++ b/influx2otel/metrics_telegraf_prometheus_v2_test.go @@ -163,7 +163,7 @@ func TestAddPoint_v2_sum(t *testing.T) { m.SetName("http_requests_total") m.SetDataType(pdata.MetricDataTypeSum) m.Sum().SetIsMonotonic(true) - m.Sum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Sum().DataPoints().AppendEmpty() dp.Attributes().InsertString("code", "200") dp.Attributes().InsertString("method", "post") @@ -347,7 +347,7 @@ func TestAddPoint_v2_histogram(t *testing.T) { m := ilMetrics.Metrics().AppendEmpty() m.SetName("http_request_duration_seconds") m.SetDataType(pdata.MetricDataTypeHistogram) - m.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Histogram().DataPoints().AppendEmpty() dp.Attributes().InsertString("code", "200") dp.Attributes().InsertString("method", "post") @@ -471,7 +471,7 @@ func TestAddPoint_v2_untypedHistogram(t *testing.T) { m := ilMetrics.Metrics().AppendEmpty() m.SetName("http_request_duration_seconds") m.SetDataType(pdata.MetricDataTypeHistogram) - m.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Histogram().DataPoints().AppendEmpty() dp.Attributes().InsertString("code", "200") dp.Attributes().InsertString("method", "post") @@ -731,7 +731,7 @@ func TestAddPoint_v2_untypedSummary(t *testing.T) { m := ilMetrics.Metrics().AppendEmpty() m.SetName("rpc_duration_seconds") m.SetDataType(pdata.MetricDataTypeHistogram) - m.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Histogram().DataPoints().AppendEmpty() dp.Attributes().InsertString("code", "200") dp.Attributes().InsertString("method", "post") diff --git a/otel2influx/go.mod b/otel2influx/go.mod index 6f324940..5e6f85e6 100644 --- a/otel2influx/go.mod +++ b/otel2influx/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/influxdata/influxdb-observability/common v0.2.7 github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/collector/model v0.35.0 + go.opentelemetry.io/collector/model v0.36.1-0.20210927193005-ebb0fbd6f23e ) replace github.com/influxdata/influxdb-observability/common => ../common diff --git a/otel2influx/go.sum b/otel2influx/go.sum index c2947e8b..5a53ed39 100644 --- a/otel2influx/go.sum +++ b/otel2influx/go.sum @@ -5,10 +5,12 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -19,6 +21,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -69,8 +72,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opentelemetry.io/collector/model v0.35.0 h1:NpKjghiqlei4ecwjOYOMhD6tj4gY8yiWHPJmbFs/ArI= go.opentelemetry.io/collector/model v0.35.0/go.mod h1:+7YCSjJG+MqiIFjauzt7oM2qkqBsaJWh5hcsO4fwsAc= +go.opentelemetry.io/collector/model v0.36.1-0.20210927193005-ebb0fbd6f23e h1:d4pAfuyfjjq39C0DoaMp2AzRMRJ3uJduQ8BPYEsLfBY= +go.opentelemetry.io/collector/model v0.36.1-0.20210927193005-ebb0fbd6f23e/go.mod h1:ESh1oWDNdS4fTg9sTFoYuiuvs8QuaX8yNGTPix3JZc8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -153,8 +157,9 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/otel2influx/metrics_telegraf_prometheus_v1.go b/otel2influx/metrics_telegraf_prometheus_v1.go index 86a5f297..984118e2 100644 --- a/otel2influx/metrics_telegraf_prometheus_v1.go +++ b/otel2influx/metrics_telegraf_prometheus_v1.go @@ -94,7 +94,7 @@ func (c *metricWriterTelegrafPrometheusV1) writeGauge(ctx context.Context, resou } func (c *metricWriterTelegrafPrometheusV1) writeSum(ctx context.Context, resource pdata.Resource, instrumentationLibrary pdata.InstrumentationLibrary, measurement string, sum pdata.Sum, w InfluxWriter) error { - if sum.AggregationTemporality() != pdata.AggregationTemporalityCumulative { + if sum.AggregationTemporality() != pdata.MetricAggregationTemporalityCumulative { return fmt.Errorf("unsupported sum aggregation temporality %q", sum.AggregationTemporality()) } if !sum.IsMonotonic() { @@ -128,7 +128,7 @@ func (c *metricWriterTelegrafPrometheusV1) writeSum(ctx context.Context, resourc } func (c *metricWriterTelegrafPrometheusV1) writeHistogram(ctx context.Context, resource pdata.Resource, instrumentationLibrary pdata.InstrumentationLibrary, measurement string, histogram pdata.Histogram, w InfluxWriter) error { - if histogram.AggregationTemporality() != pdata.AggregationTemporalityCumulative { + if histogram.AggregationTemporality() != pdata.MetricAggregationTemporalityCumulative { return fmt.Errorf("unsupported histogram aggregation temporality %q", histogram.AggregationTemporality()) } diff --git a/otel2influx/metrics_telegraf_prometheus_v1_test.go b/otel2influx/metrics_telegraf_prometheus_v1_test.go index 8a49bc8c..e468e0b6 100644 --- a/otel2influx/metrics_telegraf_prometheus_v1_test.go +++ b/otel2influx/metrics_telegraf_prometheus_v1_test.go @@ -88,7 +88,7 @@ func TestWriteMetric_v1_sum(t *testing.T) { m.SetDescription("The total number of HTTP requests") m.SetDataType(pdata.MetricDataTypeSum) m.Sum().SetIsMonotonic(true) - m.Sum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Sum().DataPoints().AppendEmpty() dp.Attributes().InsertInt("code", 200) dp.Attributes().InsertString("method", "post") @@ -155,7 +155,7 @@ func TestWriteMetric_v1_histogram(t *testing.T) { m.SetName("http_request_duration_seconds") m.SetDataType(pdata.MetricDataTypeHistogram) m.SetDescription("A histogram of the request duration") - m.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Histogram().DataPoints().AppendEmpty() dp.Attributes().InsertInt("code", 200) dp.Attributes().InsertString("method", "post") diff --git a/otel2influx/metrics_telegraf_prometheus_v2.go b/otel2influx/metrics_telegraf_prometheus_v2.go index f6748790..ff3e0333 100644 --- a/otel2influx/metrics_telegraf_prometheus_v2.go +++ b/otel2influx/metrics_telegraf_prometheus_v2.go @@ -93,7 +93,7 @@ func (c *metricWriterTelegrafPrometheusV2) writeGauge(ctx context.Context, resou } func (c *metricWriterTelegrafPrometheusV2) writeSum(ctx context.Context, resource pdata.Resource, instrumentationLibrary pdata.InstrumentationLibrary, measurement string, sum pdata.Sum, w InfluxWriter) error { - if sum.AggregationTemporality() != pdata.AggregationTemporalityCumulative { + if sum.AggregationTemporality() != pdata.MetricAggregationTemporalityCumulative { return fmt.Errorf("unsupported sum aggregation temporality %q", sum.AggregationTemporality()) } if !sum.IsMonotonic() { @@ -127,7 +127,7 @@ func (c *metricWriterTelegrafPrometheusV2) writeSum(ctx context.Context, resourc } func (c *metricWriterTelegrafPrometheusV2) writeHistogram(ctx context.Context, resource pdata.Resource, instrumentationLibrary pdata.InstrumentationLibrary, measurement string, histogram pdata.Histogram, w InfluxWriter) error { - if histogram.AggregationTemporality() != pdata.AggregationTemporalityCumulative { + if histogram.AggregationTemporality() != pdata.MetricAggregationTemporalityCumulative { return fmt.Errorf("unsupported histogram aggregation temporality %q", histogram.AggregationTemporality()) } diff --git a/otel2influx/metrics_telegraf_prometheus_v2_test.go b/otel2influx/metrics_telegraf_prometheus_v2_test.go index 522f5b9e..c64687ae 100644 --- a/otel2influx/metrics_telegraf_prometheus_v2_test.go +++ b/otel2influx/metrics_telegraf_prometheus_v2_test.go @@ -89,7 +89,7 @@ func TestWriteMetric_v2_sum(t *testing.T) { m.SetDescription("The total number of HTTP requests") m.SetDataType(pdata.MetricDataTypeSum) m.Sum().SetIsMonotonic(true) - m.Sum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Sum().DataPoints().AppendEmpty() dp.Attributes().InsertInt("code", 200) dp.Attributes().InsertString("method", "post") @@ -156,7 +156,7 @@ func TestWriteMetric_v2_histogram(t *testing.T) { m.SetName("http_request_duration_seconds") m.SetDataType(pdata.MetricDataTypeHistogram) m.SetDescription("A histogram of the request duration") - m.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := m.Histogram().DataPoints().AppendEmpty() dp.Attributes().InsertInt("code", 200) dp.Attributes().InsertString("method", "post") diff --git a/tests-integration/influx2otel_test.go b/tests-integration/influx2otel_test.go index 0d9cab39..5cff2463 100644 --- a/tests-integration/influx2otel_test.go +++ b/tests-integration/influx2otel_test.go @@ -131,7 +131,7 @@ swap,host=8eaaf6b73054 in=32768i,out=12021760i 1626302080000000000 metric.SetName("swap_in") metric.SetDataType(pdata.MetricDataTypeSum) metric.Sum().SetIsMonotonic(true) - metric.Sum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp := metric.Sum().DataPoints().AppendEmpty() dp.Attributes().InsertString("host", "8eaaf6b73054") dp.SetTimestamp(pdata.Timestamp(1626302080000000000)) @@ -140,7 +140,7 @@ swap,host=8eaaf6b73054 in=32768i,out=12021760i 1626302080000000000 metric.SetName("swap_out") metric.SetDataType(pdata.MetricDataTypeSum) metric.Sum().SetIsMonotonic(true) - metric.Sum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + metric.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp = metric.Sum().DataPoints().AppendEmpty() dp.Attributes().InsertString("host", "8eaaf6b73054") dp.SetTimestamp(pdata.Timestamp(1626302080000000000)) diff --git a/tests-integration/test_fodder.go b/tests-integration/test_fodder.go index 63b9bbf6..54041657 100644 --- a/tests-integration/test_fodder.go +++ b/tests-integration/test_fodder.go @@ -36,7 +36,7 @@ func init() { m = ilMetrics.Metrics().AppendEmpty() m.SetName("http_request_duration_seconds") m.SetDataType(pdata.MetricDataTypeHistogram) - m.Histogram().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Histogram().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) dp2 := m.Histogram().DataPoints().AppendEmpty() dp2.Attributes().InsertString("region", "eu") dp2.SetTimestamp(pdata.Timestamp(1622848686000000000)) @@ -47,7 +47,7 @@ func init() { m = ilMetrics.Metrics().AppendEmpty() m.SetName("http_requests_total") m.SetDataType(pdata.MetricDataTypeSum) - m.Sum().SetAggregationTemporality(pdata.AggregationTemporalityCumulative) + m.Sum().SetAggregationTemporality(pdata.MetricAggregationTemporalityCumulative) m.Sum().SetIsMonotonic(true) dp = m.Sum().DataPoints().AppendEmpty() dp.Attributes().InsertString("method", "post")