diff --git a/website_docs/getting-started.md b/website_docs/getting-started.md index 35886692be4..ce89d61f2a9 100644 --- a/website_docs/getting-started.md +++ b/website_docs/getting-started.md @@ -184,16 +184,15 @@ Start by instrumenting the `Run` method. // Run starts polling users for Fibonacci number requests and writes results. func (a *App) Run(ctx context.Context) error { for { - var span trace.Span - ctx, span = otel.Tracer(name).Start(ctx, "Run") + newCtx, span := otel.Tracer(name).Start(ctx, "Run") - n, err := a.Poll(ctx) + n, err := a.Poll(newCtx) if err != nil { span.End() return err } - a.Write(ctx, n) + a.Write(newCtx, n) span.End() } }