From 65b76a96562758eecd8dc91fc015cf5cdbf7ac38 Mon Sep 17 00:00:00 2001 From: Carson Ip Date: Fri, 13 Oct 2023 22:52:21 +0100 Subject: [PATCH 1/2] docs: Fix Go distributed tracing example --- docs/tab-widgets/distributed-trace-receive.asciidoc | 2 +- docs/tab-widgets/distributed-trace-send.asciidoc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tab-widgets/distributed-trace-receive.asciidoc b/docs/tab-widgets/distributed-trace-receive.asciidoc index 60dcbd1dd11..b7d5944538a 100644 --- a/docs/tab-widgets/distributed-trace-receive.asciidoc +++ b/docs/tab-widgets/distributed-trace-receive.asciidoc @@ -21,7 +21,7 @@ traceContext.State, _ = apmhttp.ParseTracestateHeader(r.Header["Tracestate"]...) opts := apm.TransactionOptions{ TraceContext: traceContext, <3> } -transaction := apm.DefaultTracer.StartTransactionOptions("GET /", "request", opts) <4> +transaction := apm.DefaultTracer().StartTransactionOptions("GET /", "request", opts) <4> ---- <1> Parse the `TraceParent` header <2> Parse the `Tracestate` header diff --git a/docs/tab-widgets/distributed-trace-send.asciidoc b/docs/tab-widgets/distributed-trace-send.asciidoc index af3a689f6b0..b38b179f4f0 100644 --- a/docs/tab-widgets/distributed-trace-send.asciidoc +++ b/docs/tab-widgets/distributed-trace-send.asciidoc @@ -12,11 +12,11 @@ Example: [source,go] ---- -transaction := apm.DefaultTracer.StartTransaction("GET /", "request") <1> +transaction := apm.DefaultTracer().StartTransaction("GET /", "request") <1> traceContext := transaction.TraceContext() <2> // Send TraceContext to receiving service -traceparent := apmhttp.FormatTraceparentHeader(traceContext)) <3> +traceparent := apmhttp.FormatTraceparentHeader(traceContext) <3> tracestate := traceContext.State.String() ---- <1> Start a transaction From 867dcd53b8bce33b6daaec52c0fb33d406db7a29 Mon Sep 17 00:00:00 2001 From: Carson Ip Date: Mon, 16 Oct 2023 23:57:33 +0100 Subject: [PATCH 2/2] Link to go agent v2 docs --- docs/tab-widgets/distributed-trace-receive.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tab-widgets/distributed-trace-receive.asciidoc b/docs/tab-widgets/distributed-trace-receive.asciidoc index b7d5944538a..ecbeebfaa1f 100644 --- a/docs/tab-widgets/distributed-trace-receive.asciidoc +++ b/docs/tab-widgets/distributed-trace-receive.asciidoc @@ -3,8 +3,8 @@ // Need help with this example 1. Parse the incoming `TraceContext` with -https://godoc.org/go.elastic.co/apm/module/apmhttp#ParseTraceparentHeader[`ParseTraceparentHeader`] or -https://godoc.org/go.elastic.co/apm/module/apmhttp#ParseTracestateHeader[`ParseTracestateHeader`]. +https://pkg.go.dev/go.elastic.co/apm/module/apmhttp/v2#ParseTraceparentHeader[`ParseTraceparentHeader`] or +https://pkg.go.dev/go.elastic.co/apm/module/apmhttp/v2#ParseTracestateHeader[`ParseTracestateHeader`]. 2. Start a new transaction or span as a child of the incoming transaction with {apm-go-ref}/api.html#tracer-api-start-transaction-options[`StartTransactionOptions`] or