You've already forked opentelemetry-go
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:
committed by
rghetia
parent
658dd7d1b9
commit
b863b8f6ab
@@ -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:])
|
||||
|
||||
Reference in New Issue
Block a user