diff --git a/exporter/awsemfexporter/datapoint.go b/exporter/awsemfexporter/datapoint.go index b345c3b4b053..c9b1094917f0 100644 --- a/exporter/awsemfexporter/datapoint.go +++ b/exporter/awsemfexporter/datapoint.go @@ -18,7 +18,7 @@ import ( "time" "go.opentelemetry.io/collector/consumer/pdata" - "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsemfexporter/mapwithexpiry" @@ -63,7 +63,7 @@ type rateKeyParams struct { logGroupKey string logStreamKey string timestampKey string - labels label.Distinct + labels attribute.Distinct } // rateState stores a metric's value @@ -206,14 +206,14 @@ func createLabels(labelsMap pdata.StringMap, instrLibName string) map[string]str return labels } -// getSortedLabels converts OTel StringMap labels to sorted labels as label.Distinct -func getSortedLabels(labels map[string]string) label.Distinct { - var kvs []label.KeyValue - var sortable label.Sortable +// getSortedLabels converts OTel StringMap labels to sorted labels as attribute.Distinct +func getSortedLabels(labels map[string]string) attribute.Distinct { + var kvs []attribute.KeyValue + var sortable attribute.Sortable for k, v := range labels { - kvs = append(kvs, label.String(k, v)) + kvs = append(kvs, attribute.String(k, v)) } - set := label.NewSetWithSortable(kvs, &sortable) + set := attribute.NewSetWithSortable(kvs, &sortable) return set.Equivalent() } diff --git a/exporter/awsemfexporter/go.mod b/exporter/awsemfexporter/go.mod index fd981d7f5d8d..37df98320de3 100644 --- a/exporter/awsemfexporter/go.mod +++ b/exporter/awsemfexporter/go.mod @@ -9,7 +9,7 @@ require ( github.com/google/uuid v1.2.0 github.com/stretchr/testify v1.7.0 go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 - go.opentelemetry.io/otel v0.17.0 + go.opentelemetry.io/otel v0.18.0 go.uber.org/zap v1.16.0 google.golang.org/protobuf v1.25.0 ) diff --git a/exporter/awsemfexporter/go.sum b/exporter/awsemfexporter/go.sum index 0fe2fd0fa5b4..a0ae9929f3af 100644 --- a/exporter/awsemfexporter/go.sum +++ b/exporter/awsemfexporter/go.sum @@ -1051,11 +1051,11 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 h1:ZQxlOelL8x2D9uiCN0r7aiCHIttvPfyF6XDJN4t7jhs= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383/go.mod h1:sBkAGYUQSh1f+owCK0aPV2uLcUB6rPHEOWjdvuE2SdQ= -go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U= -go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= -go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= -go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= -go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= +go.opentelemetry.io/otel v0.18.0 h1:d5Of7+Zw4ANFOJB+TIn2K3QWsgS2Ht7OU9DqZHI6qu8= +go.opentelemetry.io/otel v0.18.0/go.mod h1:PT5zQj4lTsR1YeARt8YNKcFb88/c2IKoSABK9mX0r78= +go.opentelemetry.io/otel/metric v0.18.0/go.mod h1:kEH2QtzAyBy3xDVQfGZKIcok4ZZFvd5xyKPfPcuK6pE= +go.opentelemetry.io/otel/oteltest v0.18.0/go.mod h1:NyierCU3/G8DLTva7KRzGii2fdxdR89zXKH1bNWY7Bo= +go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= diff --git a/exporter/stackdriverexporter/go.mod b/exporter/stackdriverexporter/go.mod index 9dff77a060c9..992b7896bbe2 100644 --- a/exporter/stackdriverexporter/go.mod +++ b/exporter/stackdriverexporter/go.mod @@ -4,14 +4,14 @@ go 1.14 require ( contrib.go.opencensus.io/exporter/stackdriver v0.13.5 - github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.17.0 + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.18.0 github.com/census-instrumentation/opencensus-proto v0.3.0 github.com/stretchr/testify v1.7.0 go.opencensus.io v0.23.0 go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 - go.opentelemetry.io/otel v0.17.0 - go.opentelemetry.io/otel/sdk v0.17.0 - go.opentelemetry.io/otel/trace v0.17.0 + go.opentelemetry.io/otel v0.18.0 + go.opentelemetry.io/otel/sdk v0.18.0 + go.opentelemetry.io/otel/trace v0.18.0 go.uber.org/zap v1.16.0 google.golang.org/api v0.40.0 google.golang.org/genproto v0.0.0-20210302174412-5ede27ff9881 diff --git a/exporter/stackdriverexporter/go.sum b/exporter/stackdriverexporter/go.sum index a739a710907b..c1f8623ac918 100644 --- a/exporter/stackdriverexporter/go.sum +++ b/exporter/stackdriverexporter/go.sum @@ -78,8 +78,8 @@ github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.4/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.17.0 h1:DwS87jXZh62gXN8QAG0c+qYQApxOPq1CMbVHCKt4w5o= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.17.0/go.mod h1:yZU4uaWc5QB5NYG0oAG1/1x8JKs1gOsy4sevZ9zR2Ok= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.18.0 h1:S03lqrxJv50b/VfvZqI8Jshw2kQOj7y9SeK/P1UxKCo= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.18.0/go.mod h1:BwNb4IGRRblD5OF65ceYU/6zvxGPOZo0M3MJIAfP7+A= github.com/HdrHistogram/hdrhistogram-go v0.9.0/go.mod h1:nxrse8/Tzg2tg3DZcZjm6qEclQKK70g0KxO61gFFZD4= github.com/HdrHistogram/hdrhistogram-go v1.0.1 h1:GX8GAYDuhlFQnI2fRDHQhTlkHMz8bEn0jTI6LJU0mpw= github.com/HdrHistogram/hdrhistogram-go v1.0.1/go.mod h1:BWJ+nMSHY3L41Zj7CA3uXnloDp7xxV0YvstAE7nKTaM= @@ -1058,16 +1058,16 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 h1:ZQxlOelL8x2D9uiCN0r7aiCHIttvPfyF6XDJN4t7jhs= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383/go.mod h1:sBkAGYUQSh1f+owCK0aPV2uLcUB6rPHEOWjdvuE2SdQ= -go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U= -go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= -go.opentelemetry.io/otel/metric v0.17.0 h1:t+5EioN8YFXQ2EH+1j6FHCKMUj+57zIDSnSGr/mWuug= -go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= -go.opentelemetry.io/otel/oteltest v0.17.0 h1:TyAihUowTDLqb4+m5ePAsR71xPJaTBJl4KDArIdi9k4= -go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= -go.opentelemetry.io/otel/sdk v0.17.0 h1:eHXQwanmbtSHM/GcJYbJ8FyyH/sT9a0e+1Z9ZWkF7Ug= -go.opentelemetry.io/otel/sdk v0.17.0/go.mod h1:INs1PePjjF2hf842AXsxGTe5lH023QfLTZRFPiV/RUk= -go.opentelemetry.io/otel/trace v0.17.0 h1:SBOj64/GAOyWzs5F680yW1ITIfJkm6cJWL2YAvuL9xY= -go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= +go.opentelemetry.io/otel v0.18.0 h1:d5Of7+Zw4ANFOJB+TIn2K3QWsgS2Ht7OU9DqZHI6qu8= +go.opentelemetry.io/otel v0.18.0/go.mod h1:PT5zQj4lTsR1YeARt8YNKcFb88/c2IKoSABK9mX0r78= +go.opentelemetry.io/otel/metric v0.18.0 h1:yuZCmY9e1ZTaMlZXLrrbAPmYW6tW1A5ozOZeOYGaTaY= +go.opentelemetry.io/otel/metric v0.18.0/go.mod h1:kEH2QtzAyBy3xDVQfGZKIcok4ZZFvd5xyKPfPcuK6pE= +go.opentelemetry.io/otel/oteltest v0.18.0 h1:FbKDFm/LnQDOHuGjED+fy3s5YMVg0z019GJ9Er66hYo= +go.opentelemetry.io/otel/oteltest v0.18.0/go.mod h1:NyierCU3/G8DLTva7KRzGii2fdxdR89zXKH1bNWY7Bo= +go.opentelemetry.io/otel/sdk v0.18.0 h1:/UiFHiJxJyEoUN2tQ6l+5f0/P01V0G9YuHeVarktRDw= +go.opentelemetry.io/otel/sdk v0.18.0/go.mod h1:nT+UdAeGQWSeTnz9vY8BBq7SEGpmWAetyo/xHUcQvxo= +go.opentelemetry.io/otel/trace v0.18.0 h1:ilCfc/fptVKaDMK1vWk0elxpolurJbEgey9J6g6s+wk= +go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= diff --git a/exporter/stackdriverexporter/spandata.go b/exporter/stackdriverexporter/spandata.go index a532cd33c70c..377e1c9c94b6 100644 --- a/exporter/stackdriverexporter/spandata.go +++ b/exporter/stackdriverexporter/spandata.go @@ -20,8 +20,8 @@ import ( "time" "go.opentelemetry.io/collector/consumer/pdata" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/label" export "go.opentelemetry.io/otel/sdk/export/trace" "go.opentelemetry.io/otel/sdk/instrumentation" sdkresource "go.opentelemetry.io/otel/sdk/resource" @@ -117,19 +117,19 @@ func pdataStatusCodeToOTCode(c pdata.StatusCode) codes.Code { } } -func pdataAttributesToOTAttributes(attrs pdata.AttributeMap, resource pdata.Resource) []label.KeyValue { - otAttrs := make([]label.KeyValue, 0, attrs.Len()) +func pdataAttributesToOTAttributes(attrs pdata.AttributeMap, resource pdata.Resource) []attribute.KeyValue { + otAttrs := make([]attribute.KeyValue, 0, attrs.Len()) appendAttrs := func(m pdata.AttributeMap) { m.ForEach(func(k string, v pdata.AttributeValue) { switch v.Type() { case pdata.AttributeValueSTRING: - otAttrs = append(otAttrs, label.String(k, v.StringVal())) + otAttrs = append(otAttrs, attribute.String(k, v.StringVal())) case pdata.AttributeValueBOOL: - otAttrs = append(otAttrs, label.Bool(k, v.BoolVal())) + otAttrs = append(otAttrs, attribute.Bool(k, v.BoolVal())) case pdata.AttributeValueINT: - otAttrs = append(otAttrs, label.Int64(k, v.IntVal())) + otAttrs = append(otAttrs, attribute.Int64(k, v.IntVal())) case pdata.AttributeValueDOUBLE: - otAttrs = append(otAttrs, label.Float64(k, v.DoubleVal())) + otAttrs = append(otAttrs, attribute.Float64(k, v.DoubleVal())) // pdata Array, and Map cannot be converted to value.Value default: return diff --git a/exporter/stackdriverexporter/spandata_test.go b/exporter/stackdriverexporter/spandata_test.go index e5915348a067..523aecb98df6 100644 --- a/exporter/stackdriverexporter/spandata_test.go +++ b/exporter/stackdriverexporter/spandata_test.go @@ -20,8 +20,8 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/consumer/pdata" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/label" "go.opentelemetry.io/otel/sdk/export/trace" "go.opentelemetry.io/otel/sdk/instrumentation" apitrace "go.opentelemetry.io/otel/trace" @@ -105,12 +105,12 @@ func TestPDataResourceSpansToOTSpanData_endToEnd(t *testing.T) { { Time: startTime, Name: "start", - Attributes: []label.KeyValue{}, + Attributes: []attribute.KeyValue{}, }, { Time: endTime, Name: "end", - Attributes: []label.KeyValue{label.Bool("flag", false)}, + Attributes: []attribute.KeyValue{attribute.Bool("flag", false)}, }, }, Links: []apitrace.Link{ @@ -119,24 +119,24 @@ func TestPDataResourceSpansToOTSpanData_endToEnd(t *testing.T) { TraceID: apitrace.TraceID{0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF}, SpanID: apitrace.SpanID{0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7}, }, - Attributes: []label.KeyValue{}, + Attributes: []attribute.KeyValue{}, }, { SpanContext: apitrace.SpanContext{ TraceID: apitrace.TraceID{0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF}, SpanID: apitrace.SpanID{0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7}, }, - Attributes: []label.KeyValue{}, + Attributes: []attribute.KeyValue{}, }, }, StatusCode: codes.Error, StatusMessage: "This is not a drill!", - Attributes: []label.KeyValue{ - label.String("namespace", "kube-system"), - label.Int64("ping_count", 25), - label.String("agent", "ocagent"), - label.Bool("cache_hit", true), - label.Int64("timeout_ns", 12e9), + Attributes: []attribute.KeyValue{ + attribute.String("namespace", "kube-system"), + attribute.Int64("ping_count", 25), + attribute.String("agent", "ocagent"), + attribute.Bool("cache_hit", true), + attribute.Int64("timeout_ns", 12e9), }, InstrumentationLibrary: instrumentation.Library{ Name: "test_il_name", diff --git a/exporter/uptraceexporter/exporter_test.go b/exporter/uptraceexporter/exporter_test.go index 053b01008ac3..2c4945505cf8 100644 --- a/exporter/uptraceexporter/exporter_test.go +++ b/exporter/uptraceexporter/exporter_test.go @@ -27,7 +27,7 @@ import ( "github.com/uptrace/uptrace-go/spanexp" "github.com/vmihailenco/msgpack/v5" "go.opentelemetry.io/collector/consumer/pdata" - "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/uptraceexporter/testdata" @@ -122,8 +122,8 @@ func TestTraceExporterGenTraces(t *testing.T) { StartTime: 1581452772000000321, EndTime: 1581452773000000789, - Resource: []label.KeyValue{ - label.String("resource-attr", "resource-attr-val-1"), + Resource: []attribute.KeyValue{ + attribute.String("resource-attr", "resource-attr-val-1"), }, StatusCode: "error", @@ -132,8 +132,8 @@ func TestTraceExporterGenTraces(t *testing.T) { Events: []spanexp.Event{ { Name: "event-with-attr", - Attrs: []label.KeyValue{ - label.String("span-event-attr", "span-event-attr-val"), + Attrs: []attribute.KeyValue{ + attribute.String("span-event-attr", "span-event-attr-val"), }, Time: 1581452773000000123, }, @@ -149,8 +149,8 @@ func TestTraceExporterGenTraces(t *testing.T) { StartTime: 1581452772000000321, EndTime: 1581452773000000789, - Resource: []label.KeyValue{ - label.String("resource-attr", "resource-attr-val-1"), + Resource: []attribute.KeyValue{ + attribute.String("resource-attr", "resource-attr-val-1"), }, StatusCode: "ok", @@ -158,8 +158,8 @@ func TestTraceExporterGenTraces(t *testing.T) { Links: []spanexp.Link{ { - Attrs: []label.KeyValue{ - label.String("span-link-attr", "span-link-attr-val"), + Attrs: []attribute.KeyValue{ + attribute.String("span-link-attr", "span-link-attr-val"), }, }, {}, diff --git a/exporter/uptraceexporter/go.mod b/exporter/uptraceexporter/go.mod index 7981bc1d17cd..9e058be44d60 100644 --- a/exporter/uptraceexporter/go.mod +++ b/exporter/uptraceexporter/go.mod @@ -5,9 +5,9 @@ go 1.14 require ( github.com/klauspost/compress v1.11.12 github.com/stretchr/testify v1.7.0 - github.com/uptrace/uptrace-go v0.8.3 + github.com/uptrace/uptrace-go v0.9.0 github.com/vmihailenco/msgpack/v5 v5.2.0 go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 - go.opentelemetry.io/otel v0.17.0 + go.opentelemetry.io/otel v0.18.0 go.uber.org/zap v1.16.0 ) diff --git a/exporter/uptraceexporter/go.sum b/exporter/uptraceexporter/go.sum index c05b57facf15..94df35f44299 100644 --- a/exporter/uptraceexporter/go.sum +++ b/exporter/uptraceexporter/go.sum @@ -650,6 +650,7 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.11/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.12 h1:famVnQVu7QwryBN4jNseQdUKES71ZAOnB6UQQJPZvqk= github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= @@ -1007,8 +1008,8 @@ github.com/uber/jaeger-lib v2.4.0+incompatible h1:fY7QsGQWiCt8pajv4r7JEvmATdCVaW github.com/uber/jaeger-lib v2.4.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/uptrace/uptrace-go v0.8.3 h1:bC98kF0Ha/8rlsxbWKGj5Hr+7rahzD/rOX7mEcutxG4= -github.com/uptrace/uptrace-go v0.8.3/go.mod h1:fDEjiX8Vqu0Aniz2o5rZNtD7+mwEtkVi/0SG4Czy/zQ= +github.com/uptrace/uptrace-go v0.9.0 h1:Dn0rHDVsMceIP6Bo9DVSo6VDh9LUTzGReW9ZZfiYFYg= +github.com/uptrace/uptrace-go v0.9.0/go.mod h1:KEiwLRmkq19nIiafMBDn1aTPmFbRjV4lTi6Dmp2EqK0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= @@ -1058,23 +1059,23 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 h1:ZQxlOelL8x2D9uiCN0r7aiCHIttvPfyF6XDJN4t7jhs= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383/go.mod h1:sBkAGYUQSh1f+owCK0aPV2uLcUB6rPHEOWjdvuE2SdQ= -go.opentelemetry.io/contrib v0.17.0 h1:F9qs5F/A+BF7wvN9pXNHs67bsEyq0cCCwockpVJ1URk= -go.opentelemetry.io/contrib v0.17.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.17.0 h1:FwwGUfB95A0SRLKD1OtCW8wWyxBGCoZtR9a6YqkzTbc= -go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.17.0/go.mod h1:enhR45LXh2I5D3afc2Xdl9dm3vU23sKIZjkt0a4e+JE= -go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U= -go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= -go.opentelemetry.io/otel/exporters/stdout v0.17.0/go.mod h1:NJ6kp8glOLKmXyjTM3I/ChQwUcE6rSdWd8AqGO/Av/w= -go.opentelemetry.io/otel/metric v0.17.0 h1:t+5EioN8YFXQ2EH+1j6FHCKMUj+57zIDSnSGr/mWuug= -go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= -go.opentelemetry.io/otel/oteltest v0.17.0 h1:TyAihUowTDLqb4+m5ePAsR71xPJaTBJl4KDArIdi9k4= -go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= -go.opentelemetry.io/otel/sdk v0.17.0 h1:eHXQwanmbtSHM/GcJYbJ8FyyH/sT9a0e+1Z9ZWkF7Ug= -go.opentelemetry.io/otel/sdk v0.17.0/go.mod h1:INs1PePjjF2hf842AXsxGTe5lH023QfLTZRFPiV/RUk= -go.opentelemetry.io/otel/sdk/export/metric v0.17.0/go.mod h1:G9SxRFvGmGpdmJ8TEXnTEnnRuR5p3cg/tRvWkA/XHvo= -go.opentelemetry.io/otel/sdk/metric v0.17.0/go.mod h1:zAX55SrmDMpZwfQrz1PKIPbCP5beU+JPQTfNko01deo= -go.opentelemetry.io/otel/trace v0.17.0 h1:SBOj64/GAOyWzs5F680yW1ITIfJkm6cJWL2YAvuL9xY= -go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= +go.opentelemetry.io/contrib v0.18.0 h1:uqBh0brileIvG6luvBjdxzoFL8lxDGuhxJWsvK3BveI= +go.opentelemetry.io/contrib v0.18.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.18.0 h1:Qc7uU8GzpQ0Gak2oOmEcpiL9uRaVhatxkE1EzNhJW00= +go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.18.0/go.mod h1:iK1G0FgHurSJ/aYLg5LpnPI0pqdanM73S3dhyDp0Lk4= +go.opentelemetry.io/otel v0.18.0 h1:d5Of7+Zw4ANFOJB+TIn2K3QWsgS2Ht7OU9DqZHI6qu8= +go.opentelemetry.io/otel v0.18.0/go.mod h1:PT5zQj4lTsR1YeARt8YNKcFb88/c2IKoSABK9mX0r78= +go.opentelemetry.io/otel/exporters/stdout v0.18.0/go.mod h1:c4vRVKdmtlGOnPriMiPhLzVzdMzH/RlM2NJioEhm+so= +go.opentelemetry.io/otel/metric v0.18.0 h1:yuZCmY9e1ZTaMlZXLrrbAPmYW6tW1A5ozOZeOYGaTaY= +go.opentelemetry.io/otel/metric v0.18.0/go.mod h1:kEH2QtzAyBy3xDVQfGZKIcok4ZZFvd5xyKPfPcuK6pE= +go.opentelemetry.io/otel/oteltest v0.18.0 h1:FbKDFm/LnQDOHuGjED+fy3s5YMVg0z019GJ9Er66hYo= +go.opentelemetry.io/otel/oteltest v0.18.0/go.mod h1:NyierCU3/G8DLTva7KRzGii2fdxdR89zXKH1bNWY7Bo= +go.opentelemetry.io/otel/sdk v0.18.0 h1:/UiFHiJxJyEoUN2tQ6l+5f0/P01V0G9YuHeVarktRDw= +go.opentelemetry.io/otel/sdk v0.18.0/go.mod h1:nT+UdAeGQWSeTnz9vY8BBq7SEGpmWAetyo/xHUcQvxo= +go.opentelemetry.io/otel/sdk/export/metric v0.18.0/go.mod h1:CFUAd+HdaQT3efTnVFYaXXp56b6bFUqkck4iRB9wu0g= +go.opentelemetry.io/otel/sdk/metric v0.18.0/go.mod h1:NY9c56grMpjqdaYvOFon8nnsgMPBaXpde5SO1ulDyCo= +go.opentelemetry.io/otel/trace v0.18.0 h1:ilCfc/fptVKaDMK1vWk0elxpolurJbEgey9J6g6s+wk= +go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= diff --git a/exporter/uptraceexporter/translator.go b/exporter/uptraceexporter/translator.go index e05917c6425b..4f110636ac94 100644 --- a/exporter/uptraceexporter/translator.go +++ b/exporter/uptraceexporter/translator.go @@ -20,7 +20,7 @@ import ( "github.com/uptrace/uptrace-go/spanexp" "go.opentelemetry.io/collector/consumer/pdata" - "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) @@ -58,24 +58,24 @@ func (e *traceExporter) keyValueSlice(attrs pdata.AttributeMap) spanexp.KeyValue attrs.ForEach(func(key string, value pdata.AttributeValue) { switch value.Type() { case pdata.AttributeValueSTRING: - out = append(out, label.String(key, value.StringVal())) + out = append(out, attribute.String(key, value.StringVal())) case pdata.AttributeValueBOOL: - out = append(out, label.Bool(key, value.BoolVal())) + out = append(out, attribute.Bool(key, value.BoolVal())) case pdata.AttributeValueINT: - out = append(out, label.Int64(key, value.IntVal())) + out = append(out, attribute.Int64(key, value.IntVal())) case pdata.AttributeValueDOUBLE: - out = append(out, label.Float64(key, value.DoubleVal())) + out = append(out, attribute.Float64(key, value.DoubleVal())) case pdata.AttributeValueMAP: if value, ok := mapLabelValue(value.MapVal()); ok { - out = append(out, label.KeyValue{ - Key: label.Key(key), + out = append(out, attribute.KeyValue{ + Key: attribute.Key(key), Value: value, }) } case pdata.AttributeValueARRAY: if value, ok := arrayLabelValue(value.ArrayVal()); ok { - out = append(out, label.KeyValue{ - Key: label.Key(key), + out = append(out, attribute.KeyValue{ + Key: attribute.Key(key), Value: value, }) } @@ -126,7 +126,7 @@ func (e *traceExporter) uptraceLinks(links pdata.SpanLinkSlice) []spanexp.Link { //------------------------------------------------------------------------------ -func mapLabelValue(m pdata.AttributeMap) (label.Value, bool) { +func mapLabelValue(m pdata.AttributeMap) (attribute.Value, bool) { out := make(map[string]interface{}, m.Len()) m.ForEach(func(key string, val pdata.AttributeValue) { out[key] = attrAsInterface(val) @@ -134,9 +134,9 @@ func mapLabelValue(m pdata.AttributeMap) (label.Value, bool) { return jsonLabelValue(out) } -func arrayLabelValue(arr pdata.AnyValueArray) (label.Value, bool) { +func arrayLabelValue(arr pdata.AnyValueArray) (attribute.Value, bool) { if arr.Len() == 0 { - return label.Value{}, false + return attribute.Value{}, false } switch arrType := arr.At(0).Type(); arrType { @@ -145,48 +145,48 @@ func arrayLabelValue(arr pdata.AnyValueArray) (label.Value, bool) { for i := 0; i < arr.Len(); i++ { val := arr.At(i) if val.Type() != arrType { - return label.Value{}, false + return attribute.Value{}, false } out = append(out, val.StringVal()) } - return label.ArrayValue(out), true + return attribute.ArrayValue(out), true case pdata.AttributeValueBOOL: out := make([]bool, 0, arr.Len()) for i := 0; i < arr.Len(); i++ { val := arr.At(i) if val.Type() != arrType { - return label.Value{}, false + return attribute.Value{}, false } out = append(out, val.BoolVal()) } - return label.ArrayValue(out), true + return attribute.ArrayValue(out), true case pdata.AttributeValueINT: out := make([]int64, 0, arr.Len()) for i := 0; i < arr.Len(); i++ { val := arr.At(i) if val.Type() != arrType { - return label.Value{}, false + return attribute.Value{}, false } out = append(out, val.IntVal()) } - return label.ArrayValue(out), true + return attribute.ArrayValue(out), true case pdata.AttributeValueDOUBLE: out := make([]float64, 0, arr.Len()) for i := 0; i < arr.Len(); i++ { val := arr.At(i) if val.Type() != arrType { - return label.Value{}, false + return attribute.Value{}, false } out = append(out, val.DoubleVal()) } - return label.ArrayValue(out), true + return attribute.ArrayValue(out), true case pdata.AttributeValueNULL: // Ignore. Uptrace does not support nulls. - return label.Value{}, false + return attribute.Value{}, false } out := make([]interface{}, arr.Len()) @@ -196,11 +196,11 @@ func arrayLabelValue(arr pdata.AnyValueArray) (label.Value, bool) { return jsonLabelValue(out) } -func jsonLabelValue(v interface{}) (label.Value, bool) { +func jsonLabelValue(v interface{}) (attribute.Value, bool) { if b, err := json.Marshal(v); err == nil { - return label.StringValue(string(b)), true + return attribute.StringValue(string(b)), true } - return label.Value{}, false + return attribute.Value{}, false } func attrAsInterface(val pdata.AttributeValue) interface{} { diff --git a/exporter/uptraceexporter/translator_test.go b/exporter/uptraceexporter/translator_test.go index 1d12e35dfe21..d25e39d8e4d7 100644 --- a/exporter/uptraceexporter/translator_test.go +++ b/exporter/uptraceexporter/translator_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/consumer/pdata" - "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/attribute" "go.uber.org/zap" ) @@ -45,7 +45,7 @@ func TestMapLabelValue(t *testing.T) { value, ok := mapLabelValue(m) require.True(t, ok) - require.Equal(t, label.STRING, value.Type()) + require.Equal(t, attribute.STRING, value.Type()) require.Equal(t, `{"array":[true,false],"bool":true,"double":0.123,"int":123,"map":{},"null":null,"string":"bar"}`, value.AsString()) e := &traceExporter{ @@ -81,7 +81,7 @@ func TestArrayLabelValue(t *testing.T) { arr.Append(mapVal) value, ok := arrayLabelValue(arr) require.True(t, ok) - require.Equal(t, label.STRING, value.Type()) + require.Equal(t, attribute.STRING, value.Type()) type Test struct { val pdata.AttributeValue @@ -99,7 +99,7 @@ func TestArrayLabelValue(t *testing.T) { value, ok := arrayLabelValue(arr) require.True(t, ok) - require.Equal(t, label.ARRAY, value.Type()) + require.Equal(t, attribute.ARRAY, value.Type()) arr.Append(pdata.NewAttributeValueNull()) _, ok = arrayLabelValue(arr) diff --git a/go.sum b/go.sum index d5f698b6d005..ad74743e34b1 100644 --- a/go.sum +++ b/go.sum @@ -109,8 +109,8 @@ github.com/DataDog/zstd v1.4.4/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.17.0 h1:DwS87jXZh62gXN8QAG0c+qYQApxOPq1CMbVHCKt4w5o= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.17.0/go.mod h1:yZU4uaWc5QB5NYG0oAG1/1x8JKs1gOsy4sevZ9zR2Ok= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.18.0 h1:S03lqrxJv50b/VfvZqI8Jshw2kQOj7y9SeK/P1UxKCo= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.18.0/go.mod h1:BwNb4IGRRblD5OF65ceYU/6zvxGPOZo0M3MJIAfP7+A= github.com/HdrHistogram/hdrhistogram-go v0.9.0/go.mod h1:nxrse8/Tzg2tg3DZcZjm6qEclQKK70g0KxO61gFFZD4= github.com/HdrHistogram/hdrhistogram-go v1.0.1 h1:GX8GAYDuhlFQnI2fRDHQhTlkHMz8bEn0jTI6LJU0mpw= github.com/HdrHistogram/hdrhistogram-go v1.0.1/go.mod h1:BWJ+nMSHY3L41Zj7CA3uXnloDp7xxV0YvstAE7nKTaM= @@ -1492,16 +1492,16 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 h1:ZQxlOelL8x2D9uiCN0r7aiCHIttvPfyF6XDJN4t7jhs= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383/go.mod h1:sBkAGYUQSh1f+owCK0aPV2uLcUB6rPHEOWjdvuE2SdQ= -go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U= -go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= -go.opentelemetry.io/otel/metric v0.17.0 h1:t+5EioN8YFXQ2EH+1j6FHCKMUj+57zIDSnSGr/mWuug= -go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= -go.opentelemetry.io/otel/oteltest v0.17.0 h1:TyAihUowTDLqb4+m5ePAsR71xPJaTBJl4KDArIdi9k4= -go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= -go.opentelemetry.io/otel/sdk v0.17.0 h1:eHXQwanmbtSHM/GcJYbJ8FyyH/sT9a0e+1Z9ZWkF7Ug= -go.opentelemetry.io/otel/sdk v0.17.0/go.mod h1:INs1PePjjF2hf842AXsxGTe5lH023QfLTZRFPiV/RUk= -go.opentelemetry.io/otel/trace v0.17.0 h1:SBOj64/GAOyWzs5F680yW1ITIfJkm6cJWL2YAvuL9xY= -go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= +go.opentelemetry.io/otel v0.18.0 h1:d5Of7+Zw4ANFOJB+TIn2K3QWsgS2Ht7OU9DqZHI6qu8= +go.opentelemetry.io/otel v0.18.0/go.mod h1:PT5zQj4lTsR1YeARt8YNKcFb88/c2IKoSABK9mX0r78= +go.opentelemetry.io/otel/metric v0.18.0 h1:yuZCmY9e1ZTaMlZXLrrbAPmYW6tW1A5ozOZeOYGaTaY= +go.opentelemetry.io/otel/metric v0.18.0/go.mod h1:kEH2QtzAyBy3xDVQfGZKIcok4ZZFvd5xyKPfPcuK6pE= +go.opentelemetry.io/otel/oteltest v0.18.0 h1:FbKDFm/LnQDOHuGjED+fy3s5YMVg0z019GJ9Er66hYo= +go.opentelemetry.io/otel/oteltest v0.18.0/go.mod h1:NyierCU3/G8DLTva7KRzGii2fdxdR89zXKH1bNWY7Bo= +go.opentelemetry.io/otel/sdk v0.18.0 h1:/UiFHiJxJyEoUN2tQ6l+5f0/P01V0G9YuHeVarktRDw= +go.opentelemetry.io/otel/sdk v0.18.0/go.mod h1:nT+UdAeGQWSeTnz9vY8BBq7SEGpmWAetyo/xHUcQvxo= +go.opentelemetry.io/otel/trace v0.18.0 h1:ilCfc/fptVKaDMK1vWk0elxpolurJbEgey9J6g6s+wk= +go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= diff --git a/receiver/statsdreceiver/go.mod b/receiver/statsdreceiver/go.mod index 1b5020d8342f..3fc3b7ebc44d 100644 --- a/receiver/statsdreceiver/go.mod +++ b/receiver/statsdreceiver/go.mod @@ -7,7 +7,7 @@ require ( github.com/stretchr/testify v1.7.0 go.opencensus.io v0.23.0 go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 - go.opentelemetry.io/otel v0.17.0 + go.opentelemetry.io/otel v0.18.0 go.uber.org/zap v1.16.0 google.golang.org/protobuf v1.25.0 ) diff --git a/receiver/statsdreceiver/go.sum b/receiver/statsdreceiver/go.sum index 22649ceb702a..d03892a592a3 100644 --- a/receiver/statsdreceiver/go.sum +++ b/receiver/statsdreceiver/go.sum @@ -1050,11 +1050,11 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383 h1:ZQxlOelL8x2D9uiCN0r7aiCHIttvPfyF6XDJN4t7jhs= go.opentelemetry.io/collector v0.21.1-0.20210308033310-65c4c4a1b383/go.mod h1:sBkAGYUQSh1f+owCK0aPV2uLcUB6rPHEOWjdvuE2SdQ= -go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U= -go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s= -go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0= -go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE= -go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg= +go.opentelemetry.io/otel v0.18.0 h1:d5Of7+Zw4ANFOJB+TIn2K3QWsgS2Ht7OU9DqZHI6qu8= +go.opentelemetry.io/otel v0.18.0/go.mod h1:PT5zQj4lTsR1YeARt8YNKcFb88/c2IKoSABK9mX0r78= +go.opentelemetry.io/otel/metric v0.18.0/go.mod h1:kEH2QtzAyBy3xDVQfGZKIcok4ZZFvd5xyKPfPcuK6pE= +go.opentelemetry.io/otel/oteltest v0.18.0/go.mod h1:NyierCU3/G8DLTva7KRzGii2fdxdR89zXKH1bNWY7Bo= +go.opentelemetry.io/otel/trace v0.18.0/go.mod h1:FzdUu3BPwZSZebfQ1vl5/tAa8LyMLXSJN57AXIt/iDk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= diff --git a/receiver/statsdreceiver/protocol/statsd_parser.go b/receiver/statsdreceiver/protocol/statsd_parser.go index b024ce8c7853..0ccef8da369a 100644 --- a/receiver/statsdreceiver/protocol/statsd_parser.go +++ b/receiver/statsdreceiver/protocol/statsd_parser.go @@ -22,7 +22,7 @@ import ( "time" metricspb "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1" - "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/attribute" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -60,7 +60,7 @@ type statsDMetric struct { type statsDMetricdescription struct { name string statsdMetricType string - labels label.Distinct + labels attribute.Distinct } func (p *StatsDParser) Initialize(enableMetricType bool) error { @@ -164,8 +164,8 @@ func parseMessageToMetric(line string, enableMetricType bool) (statsDMetric, err additionalParts := parts[2:] - var kvs []label.KeyValue - var sortable label.Sortable + var kvs []attribute.KeyValue + var sortable attribute.Sortable for _, part := range additionalParts { // TODO: Sample rate doesn't currently have a place to go in the protocol @@ -193,7 +193,7 @@ func parseMessageToMetric(line string, enableMetricType bool) (statsDMetric, err Value: tagParts[1], HasValue: true, }) - kvs = append(kvs, label.String(tagParts[0], tagParts[1])) + kvs = append(kvs, attribute.String(tagParts[0], tagParts[1])) } } else { @@ -236,11 +236,11 @@ func parseMessageToMetric(line string, enableMetricType bool) (statsDMetric, err Value: metricType, HasValue: true, }) - kvs = append(kvs, label.String(TagMetricType, metricType)) + kvs = append(kvs, attribute.String(TagMetricType, metricType)) } if len(kvs) != 0 { - set := label.NewSetWithSortable(kvs, &sortable) + set := attribute.NewSetWithSortable(kvs, &sortable) result.description.labels = set.Equivalent() } diff --git a/receiver/statsdreceiver/protocol/statsd_parser_test.go b/receiver/statsdreceiver/protocol/statsd_parser_test.go index bf3d88bd4274..4aebbece729d 100644 --- a/receiver/statsdreceiver/protocol/statsd_parser_test.go +++ b/receiver/statsdreceiver/protocol/statsd_parser_test.go @@ -20,7 +20,7 @@ import ( metricspb "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/attribute" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -684,14 +684,14 @@ func testStatsDMetric(value string, intValue int64, sampleRate float64, labelKeys []*metricspb.LabelKey, labelValue []*metricspb.LabelValue) statsDMetric { if len(labelKeys) > 0 { - var kvs []label.KeyValue - var sortable label.Sortable + var kvs []attribute.KeyValue + var sortable attribute.Sortable for n, k := range labelKeys { if labelValue[n].HasValue { - kvs = append(kvs, label.String(k.Key, labelValue[n].Value)) + kvs = append(kvs, attribute.String(k.Key, labelValue[n].Value)) } } - set := label.NewSetWithSortable(kvs, &sortable) + set := attribute.NewSetWithSortable(kvs, &sortable) return statsDMetric{ description: statsDMetricdescription{ name: "test.metric", @@ -727,12 +727,12 @@ func testStatsDMetric(value string, intValue int64, } func testDescription(name string, statsdMetricType string, keys []string, values []string) statsDMetricdescription { - var kvs []label.KeyValue - var sortable label.Sortable + var kvs []attribute.KeyValue + var sortable attribute.Sortable for n, k := range keys { - kvs = append(kvs, label.String(k, values[n])) + kvs = append(kvs, attribute.String(k, values[n])) } - set := label.NewSetWithSortable(kvs, &sortable) + set := attribute.NewSetWithSortable(kvs, &sortable) return statsDMetricdescription{ name: name, statsdMetricType: statsdMetricType, @@ -1863,7 +1863,7 @@ func Test_contains(t *testing.T) { func TestStatsDParser_Initialize(t *testing.T) { p := &StatsDParser{} p.Initialize(true) - labels := label.Distinct{} + labels := attribute.Distinct{} teststatsdDMetricdescription := statsDMetricdescription{ name: "test", statsdMetricType: "g",