.env
file in the root of your project (if you don’t have one already) and add the following line:
your_project_api_key_here
with the actual key you copied.
observe
decorator/wrapper to trace specific functions in your application:
observe()
.
This is especially helpful when you want to trace functions, or group
separate functions into a single trace.my_function
and the OpenAI call, which is nested inside it, in the same trace. Notice that the OpenAI span is a child of my_function
. Parent-child relationships are automatically detected and visualized with tree hierarchy.