You can add attributes or tags to spans in Phoenix using OpenInference helpers. In Python, use the `using_attributes` context manager to set custom attributes, tags, or metadata (e.g., product features) on spans. For example:
```
from openinference.instrumentation import using_attributes
with using_attributes(tags=["feature_x", "feature_y"], metadata={"product_feature": "feature_x"}):
# Your agent code here
...
```
This will attach the specified tags and metadata to all spans created within the context, making them available for cost summaries and filtering in Phoenix. For more details, see the <https://arize.com/docs/phoenix/tracing/how-to-tracing/add-metadata/customize-spans#specifying-tags|Phoenix documentation on customizing spans> and <https://github.com/Arize-ai/openinference/blob/main/python/openinference-instrumentation/README.md|OpenInference instrumentation>.
Would you like more detail or examples for a specific language or framework?
Sources:
- <https://github.com/Arize-ai/openinference/blob/main/python/openinference-instrumentation/README.md|OpenInference Instrumentation README>