You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +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:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user