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

Rename otel/label -> otel/attribute (#1541)

* Rename otel/label -> otel/attr

Leave the imported name alone, to avoid a large diff and conflicts

* Better import comment

* Update CHANGELOG.md

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* otel/attr -> otel/attribute

* Missed the changelog entry

* Get rid of import renaming

* Merge remaining conflicts

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
This commit is contained in:
Punya Biswal
2021-02-18 12:59:37 -05:00
committed by GitHub
parent 1b5b662136
commit ecf65d7968
123 changed files with 1715 additions and 1715 deletions

View File

@@ -19,8 +19,8 @@ import (
"net/url"
"strings"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/internal/baggage"
"go.opentelemetry.io/otel/label"
)
const baggageHeader = "baggage"
@@ -38,7 +38,7 @@ func (b Baggage) Inject(ctx context.Context, carrier TextMapCarrier) {
baggageMap := baggage.MapFromContext(ctx)
firstIter := true
var headerValueBuilder strings.Builder
baggageMap.Foreach(func(kv label.KeyValue) bool {
baggageMap.Foreach(func(kv attribute.KeyValue) bool {
if !firstIter {
headerValueBuilder.WriteRune(',')
}
@@ -62,7 +62,7 @@ func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context
}
baggageValues := strings.Split(bVal, ",")
keyValues := make([]label.KeyValue, 0, len(baggageValues))
keyValues := make([]attribute.KeyValue, 0, len(baggageValues))
for _, baggageValue := range baggageValues {
valueAndProps := strings.Split(baggageValue, ";")
if len(valueAndProps) < 1 {
@@ -92,7 +92,7 @@ func (b Baggage) Extract(parent context.Context, carrier TextMapCarrier) context
trimmedValueWithProps.WriteString(prop)
}
keyValues = append(keyValues, label.String(trimmedName, trimmedValueWithProps.String()))
keyValues = append(keyValues, attribute.String(trimmedName, trimmedValueWithProps.String()))
}
if len(keyValues) > 0 {