Launch Week 02 wrapped — explore all five launches

Add Tags to Traces

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.

Add Tags to Traces

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

main.py
from deepeval.tracing import observe, update_current_trace
from openai import OpenAI

client = OpenAI()

@observe(type="agent")
def llm_app(query: str):
    update_current_trace(tags=["Causal Chit-Chat"])

    return client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": query}]
    ).choices[0].message.content

llm_app("Write me a poem.")
Ready to monitor AI in production?Connect traces, alerts, dashboards, and evals in one production workflowBook a demo

Last updated on

Built byConfident AI