Tags

Adding tags to your traces for better visibility on Confident AI

Overview

Unlike metadata, which can contain complex structured data, tags are simple string labels that make it easy to group related traces together, and cannot be applied to spans.

Tags provide a simple way to categorize and filter your traces in Confident’s observatory.

Add Tags to Traces

Tags are applied at the trace level, making them visible for all spans within that trace.

main.py
1from deepeval.tracing import observe, update_current_trace
2from openai import OpenAI
3
4client = OpenAI()
5
6@observe(type="agent")
7def llm_app(query: str):
8 update_current_trace(tags=["Causal Chit-Chat"])
9
10 return client.chat.completions.create(
11 model="gpt-4o",
12 messages=[{"role": "user", "content": query}]
13 ).choices[0].message.content
14
15llm_app("Write me a poem.")