1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-10-31 00:07:40 +02:00

Replace use of old term label with attribute (#2790)

* Replace use of old term label with attribute

The specification has unified on the term attribute to describe
key-value pairs. There exist still many hold-overs of the use of the
term label. This updates those uses or deprecates exported types and
functions in favor of renamed forms.

* fix infinite recursion

* Remove backticks from attribute set docs

* Remove LabelFilterSelector entirely

* Remove Metadata.Labels instead of deprecate

* Update changelog with public changes

* Revert OC err msg
This commit is contained in:
Tyler Yahn
2022-04-18 07:31:31 -07:00
committed by GitHub
parent 1884de2b4b
commit a8ea3dbb46
42 changed files with 555 additions and 550 deletions

View File

@@ -25,7 +25,7 @@ import (
const conflict = 0.5
func makeLabels(n int) (_, _ *resource.Resource) {
func makeAttrs(n int) (_, _ *resource.Resource) {
used := map[string]bool{}
l1 := make([]attribute.KeyValue, n)
l2 := make([]attribute.KeyValue, n)
@@ -51,7 +51,7 @@ func makeLabels(n int) (_, _ *resource.Resource) {
}
func benchmarkMergeResource(b *testing.B, size int) {
r1, r2 := makeLabels(size)
r1, r2 := makeAttrs(size)
b.ReportAllocs()
b.ResetTimer()

View File

@@ -194,7 +194,7 @@ func Merge(a, b *Resource) (*Resource, error) {
mi := attribute.NewMergeIterator(b.Set(), a.Set())
combine := make([]attribute.KeyValue, 0, a.Len()+b.Len())
for mi.Next() {
combine = append(combine, mi.Label())
combine = append(combine, mi.Attribute())
}
merged := NewWithAttributes(schemaURL, combine...)
return merged, nil