Tags
Tags are string labels that help you categorize and filter traces. You can apply multiple tags to a single trace or observation, and XeroML automatically aggregates tags from all observations up to the trace level.
Common uses for tags: feature area, endpoint name, experiment name, model variant, or any categorical label that’s useful for filtering.
Tag Limits
- Maximum 200 characters per tag
- Tags exceeding 200 characters are silently dropped
- No limit on number of tags per trace
Adding Tags
Use propagate_attributes() to attach tags to all observations in a context:
from xeroml import observe, propagate_attributes
@observe()def handle_request(query: str) -> str: with propagate_attributes(tags=["feature:search", "model:gpt-4o"]): result = run_search_pipeline(query) return resultTags can also be set directly when creating an observation:
from xeroml import get_client
xeroml = get_client()
with xeroml.start_as_current_observation( name="my-span", type="span", tags=["experiment:v2", "region:us-east"]) as obs: result = process()import { startActiveObservation, propagateAttributes } from "@xeroml/tracing";
await startActiveObservation({ name: "handle-request" }, async () => { await propagateAttributes( { tags: ["feature:search", "model:gpt-4o"] }, async () => { await runSearchPipeline(query); } );});from xeroml.openai import openaifrom xeroml import propagate_attributes
with propagate_attributes(tags=["endpoint:chat", "version:v2"]): response = openai.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": query}] )from xeroml import CallbackHandler, propagate_attributesfrom langchain_openai import ChatOpenAI
with propagate_attributes(tags=["pipeline:rag", "retriever:pinecone"]): handler = CallbackHandler() llm = ChatOpenAI(callbacks=[handler]) response = llm.invoke(query)Automatic Aggregation
When tags are applied to individual observations within a trace, XeroML automatically merges all unique tags onto the trace object. This means you can filter traces by tag even when the tag was only applied to a child observation.
Filtering in the UI
Tags appear as filter options in the Traces list view. Select one or more tags to narrow down traces for investigation or dataset creation.