> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trace0hq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Transaction Tags

> Use tags to attach important business context to a transaction, such as a customer ID or order ID,

Tags let you attach important business context to a transaction, such as a customer ID, order ID, tenant ID, etc.

Tags use the `trace0.tag.*` namespace and can be added through logs or span attributes.

**1. Logs**

Tags can be included in standard log messages:

```java theme={null}
log.info("Processing order trace0.tag.customer.id=12345");
```

Or as fields when using structured logging:

```json theme={null}
{
  "message":"Processing order",
  "trace0.tag.customer.id":"12345"
}
```

​**2. Span attributes**

Tags can also be added directly as OpenTelemetry span attributes:

```java theme={null}
span.setAttribute("trace0.tag.customer.id", "12345");
```

Trace0 extracts these values and displays them as Tags on the corresponding transaction.

![Transaction Tags Light](https://mintcdn.com/trace0/k4iKF3hacuwsSLr5/images/transaction-tags-light.png?fit=max\&auto=format\&n=k4iKF3hacuwsSLr5\&q=85\&s=ca45b1868e554fc3bb5529abcb93a9af)

You can include tags in natual language search and in Trace0QL queries.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.