1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-03 00:27:03 +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

@ -23,7 +23,7 @@ import (
"github.com/stretchr/testify/require"
"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
export "go.opentelemetry.io/otel/sdk/export/metric"
"go.opentelemetry.io/otel/sdk/export/metric/aggregation"
@ -35,7 +35,7 @@ import (
)
func getMap(t *testing.T, cont *controller.Controller) map[string]float64 {
out := processortest.NewOutput(label.DefaultEncoder())
out := processortest.NewOutput(attribute.DefaultEncoder())
require.NoError(t, cont.ForEach(
export.CumulativeExportKindSelector(),
@ -70,16 +70,16 @@ func TestControllerUsesResource(t *testing.T) {
{
name: "uses default if no resource option",
options: nil,
wanted: resource.Default().Encoded(label.DefaultEncoder())},
wanted: resource.Default().Encoded(attribute.DefaultEncoder())},
{
name: "explicit resource",
options: []controller.Option{controller.WithResource(resource.NewWithAttributes(label.String("R", "S")))},
options: []controller.Option{controller.WithResource(resource.NewWithAttributes(attribute.String("R", "S")))},
wanted: "R=S"},
{
name: "last resource wins",
options: []controller.Option{
controller.WithResource(resource.Default()),
controller.WithResource(resource.NewWithAttributes(label.String("R", "S"))),
controller.WithResource(resource.NewWithAttributes(attribute.String("R", "S"))),
},
wanted: "R=S",
},
@ -128,7 +128,7 @@ func TestStartNoExporter(t *testing.T) {
func(ctx context.Context, result metric.Int64ObserverResult) {
calls++
checkTestContext(t, ctx)
result.Observe(calls, label.String("A", "B"))
result.Observe(calls, attribute.String("A", "B"))
},
)
@ -251,7 +251,7 @@ func newBlockingExporter() *blockingExporter {
return &blockingExporter{
exporter: processortest.NewExporter(
export.CumulativeExportKindSelector(),
label.DefaultEncoder(),
attribute.DefaultEncoder(),
),
}
}
@ -332,7 +332,7 @@ func TestExportTimeout(t *testing.T) {
func TestCollectAfterStopThenStartAgain(t *testing.T) {
exp := processortest.NewExporter(
export.CumulativeExportKindSelector(),
label.DefaultEncoder(),
attribute.DefaultEncoder(),
)
cont := controller.New(
processor.New(