Basic Features
Log Levels
5 min
traces can have a lot of observations ( data model https //docs abv dev/ ) you can differentiate the importance of observations with the level attribute to control the verbosity of your traces and highlight errors and warnings available levels debug , default , warning , error in addition to the level, you can also include a statusmessage to provide additional context implementation with python sdk when using the @observe() https //docs abv dev/python sdk#li pl from abvdev import observe, get client @observe() def my function() abv = get client() \# processing logic \# update the current span with a warning level abv update current span( level="warning", status message="this is a warning" ) when creating spans or generations directly from abvdev import get client abv = get client() \# using context managers (recommended) with abv start as current span(name="my operation") as span \# set level and status message on creation with span start as current span( name="potentially risky operation", level="warning", status message="operation may fail" ) as risky span \# do work \# or update level and status message later risky span update( level="error", status message="operation failed with unexpected input" ) \# you can also update the currently active span without a direct reference with abv start as current span(name="another operation") \# some processing abv update current span( level="debug", status message="processing intermediate results" ) levels can also be set when creating generations abv = get client() with abv start as current generation( name="llm call", model="gpt 4o", level="default" # default level ) as generation \# make llm call if error detected generation update( level="error", status message="model returned malformed output" ) implementation with js/ts sdk when using the context manager import { startactiveobservation, startobservation } from "@abvdev/tracing"; await startactiveobservation("context manager", async (span) => { span update({ input { query "what is the capital of france?" }, }); updateactiveobservation({ level "warning", statusmessage "this is a warning", }); }); when using the observe wrapper import { observe, updateactiveobservation } from "@abvdev/tracing"; // an existing function async function fetchdata(source string) { updateactiveobservation({ level "warning", statusmessage "this is a warning", }); // 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 update({ level "warning", statusmessage "this is a warning", }); span update({ output "paris" }) end(); see typescript sdk overview docid\ j4sdnlmdmnfmk99ootgn7 for more details filter trace by log level when viewing a single trace, you can filter the observations by log level