1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-05 00:28:58 +02:00

Remove NewKey and update doc comment (#721)

* Update doc comment

* Remove NewKey

* NewKey->Key
This commit is contained in:
Joshua MacDonald
2020-05-13 16:21:23 -07:00
committed by GitHub
parent 1301b6f3e4
commit 587cde3352
26 changed files with 155 additions and 164 deletions

View File

@ -30,10 +30,10 @@ import (
)
var (
fooKey = kv.NewKey("ex.com/foo")
barKey = kv.NewKey("ex.com/bar")
lemonsKey = kv.NewKey("ex.com/lemons")
anotherKey = kv.NewKey("ex.com/another")
fooKey = kv.Key("ex.com/foo")
barKey = kv.Key("ex.com/bar")
lemonsKey = kv.Key("ex.com/lemons")
anotherKey = kv.Key("ex.com/another")
)
// initTracer creates and registers trace provider instance.
@ -94,7 +94,7 @@ func main() {
err := tracer.WithSpan(ctx, "operation", func(ctx context.Context) error {
trace.SpanFromContext(ctx).AddEvent(ctx, "Nice operation!", kv.NewKey("bogons").Int(100))
trace.SpanFromContext(ctx).AddEvent(ctx, "Nice operation!", kv.Key("bogons").Int(100))
trace.SpanFromContext(ctx).SetAttributes(anotherKey.String("yes"))