You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-15 01:04:25 +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:
@ -22,9 +22,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
"go.opentelemetry.io/otel/exporters/stdout"
|
||||
"go.opentelemetry.io/otel/label"
|
||||
export "go.opentelemetry.io/otel/sdk/export/trace"
|
||||
"go.opentelemetry.io/otel/sdk/resource"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
@ -42,10 +42,10 @@ func TestExporter_ExportSpan(t *testing.T) {
|
||||
now := time.Now()
|
||||
traceID, _ := trace.TraceIDFromHex("0102030405060708090a0b0c0d0e0f10")
|
||||
spanID, _ := trace.SpanIDFromHex("0102030405060708")
|
||||
traceState, _ := trace.TraceStateFromKeyValues(label.String("key", "val"))
|
||||
traceState, _ := trace.TraceStateFromKeyValues(attribute.String("key", "val"))
|
||||
keyValue := "value"
|
||||
doubleValue := 123.456
|
||||
resource := resource.NewWithAttributes(label.String("rk1", "rv11"))
|
||||
resource := resource.NewWithAttributes(attribute.String("rk1", "rv11"))
|
||||
|
||||
testSpan := &export.SpanSnapshot{
|
||||
SpanContext: trace.SpanContext{
|
||||
@ -56,13 +56,13 @@ func TestExporter_ExportSpan(t *testing.T) {
|
||||
Name: "/foo",
|
||||
StartTime: now,
|
||||
EndTime: now,
|
||||
Attributes: []label.KeyValue{
|
||||
label.String("key", keyValue),
|
||||
label.Float64("double", doubleValue),
|
||||
Attributes: []attribute.KeyValue{
|
||||
attribute.String("key", keyValue),
|
||||
attribute.Float64("double", doubleValue),
|
||||
},
|
||||
MessageEvents: []trace.Event{
|
||||
{Name: "foo", Attributes: []label.KeyValue{label.String("key", keyValue)}, Time: now},
|
||||
{Name: "bar", Attributes: []label.KeyValue{label.Float64("double", doubleValue)}, Time: now},
|
||||
{Name: "foo", Attributes: []attribute.KeyValue{attribute.String("key", keyValue)}, Time: now},
|
||||
{Name: "bar", Attributes: []attribute.KeyValue{attribute.Float64("double", doubleValue)}, Time: now},
|
||||
},
|
||||
SpanKind: trace.SpanKindInternal,
|
||||
StatusCode: codes.Error,
|
||||
|
Reference in New Issue
Block a user