1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-27 22:49:15 +02:00

Rename CurrentSpan to SpanFromContext & SetCurrentSpan to ContextWithSpan (#379)

Signed-off-by: vineeth <vineethpothulapati@outlook.com>
This commit is contained in:
Vineeth Pothulapati
2019-12-11 22:21:32 +05:30
committed by rghetia
parent 658dd7d1b9
commit b863b8f6ab
22 changed files with 45 additions and 45 deletions

View File

@@ -65,7 +65,7 @@ func ExampleNewHandler() {
case "":
err = fmt.Errorf("expected /hello/:name in %q", s)
default:
trace.CurrentSpan(ctx).SetAttributes(core.Key("name").String(pp[1]))
trace.SpanFromContext(ctx).SetAttributes(core.Key("name").String(pp[1]))
}
return pp[1], err
}
@@ -77,7 +77,7 @@ func ExampleNewHandler() {
ctx := r.Context()
var name string
// Wrap another function in it's own span
if err := trace.CurrentSpan(ctx).Tracer().WithSpan(ctx, "figureOutName",
if err := trace.SpanFromContext(ctx).Tracer().WithSpan(ctx, "figureOutName",
func(ctx context.Context) error {
var err error
name, err = figureOutName(ctx, r.URL.Path[1:])