Basic Features
Tags
5 min
tags allow you to categorize and filter traces you can tag traces programatically using the abv sdks from the abv ui to tag a trace, add a list of tags to the tags field of the trace object tags are strings and a trace may have multiple tags trace tags can be added, but not removed implementation with python sdk when using the @observe() decorator https //docs abv dev/python sdk#li pl from abvdev import observe, get client abv = get client() @observe() def my function() \# processing logic \# add tags to the trace abv update current trace(tags=\["tag 1", "tag 2"]) when creating spans or generations directly from abvdev import get client abv = get client() \# add tags when creating the root span with abv start as current span( name="my operation" ) as root span \# add tags to the trace root span update trace(tags=\["tag 1", "tag 2"]) \# you can add more tags later from any span in the same trace with root span start as current generation(name="llm call", model="gpt 4o") as gen \# processing gen update trace(tags=\["llm gen"]) # adds another tag to the same trace you can also update the tags of the current trace without a direct reference to a span with abv start as current span(name="another operation") \# processing abv update current trace(tags=\["processing", "beta feature"]) implementation with js/ts sdk when using the context manager import { startactiveobservation, startobservation, updateactivetrace, } from "@abvdev/tracing"; await startactiveobservation("context manager", async (span) => { span update({ input { query "what is the capital of france?" }, }); updateactivetrace({ tags \["tag 1", "tag 2"], }); }); when using the observe wrapper import { observe, updateactivetrace } from "@abvdev/tracing"; // an existing function async function fetchdata(source string) { updateactivetrace({ tags \["tag 1", "tag 2"], }); // logic to fetch data return { data `some data from ${source}` }; } // wrap the function to trace it const tracedfetchdata = observe(fetchdata, { name "observe wrapper", }); const result = await tracedfetchdata("api"); when creating spans manually import { startobservation } from "@abvdev/tracing"; const span = startobservation("manual observation", { input { query "what is the capital of france?" }, }); span updatetrace({ tags \["tag 1", "tag 2"], }); span update({ output "paris" }) end(); see typescript sdk overview docid\ j4sdnlmdmnfmk99ootgn7 for more details working with tags tags enable you to flexibly add metadata to your traces you can filter for tags in the abv ui and get api when choosing tags, consider what aspects of the traces you might want to filter for or group by in your analysis you may use tags to indicate specific versions of your app (‘app v1’, ‘app v2’), specific llm techniques you used (‘rag’, ‘one shot’, ‘few shot’), or the environment of your app (‘local’, ‘staging’, ‘prod’) see intent classification notebook for an end to end example on how tags can be created programmatically