Basic Features
Trace URLs
7 min
toggleeach trace has a unique url that you can use to share it with others or to access it directly get trace url sometimes, it is useful to get the trace url directly in the sdk e g to add it to your logs or interactively look at it when running experiments in notebooks with python sdk when using the @observe() decorator from abvdev import observe, get client @observe() def process data() abv = get client() \# get the url of the current trace trace url = abv get trace url() print(f"view trace at {trace url}") \# or pass the trace id trace id = abv get current trace id() trace url = abv get trace url(trace id=trace id) when using context managers from abvdev import get client abv = get client() with abv start as current span(name="process request") as span \# get the url of this trace trace url = abv get trace url() print(f"view trace at {trace url}") \# or pass the trace id trace id = abv get current trace id() trace url = abv get trace url(trace id=trace id) with js/ts sdk import { abvclient } from "@abvdev/client"; import { startobservation } from "@abvdev/tracing"; const abv = new abvclient(); const rootspan = startobservation("my trace"); const traceurl = await abv gettraceurl(rootspan traceid); console log("trace url ", traceurl); share trace via url by default, only members of your abv project can view a trace you can make a trace public to share it via a public link this allows others to view the trace without needing to log in or be members of your abv project via abv ui in trace view switch "private" toggle to "public" with python sdk when using the @observe() decorator from abvdev import observe, get client @observe() def process data() abv = get client() \# make the current trace public abv update current trace(public=true) when using context managers from abvdev import get client abv = get client() with abv start as current span(name="process request") as span \# make this trace public span update trace(public=true) \# get the url to share trace id = abv get current trace id() trace url = abv get trace url(trace id=trace id) print(f"share this trace at {trace url}") with js/ts sdk import { startobservation, updatetrace } from "@abvdev/tracing"; const rootspan = startobservation("my trace"); rootspan updatetrace({ public true, }); rootspan end();