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

# Tags

> Label traces with string tags for filtering and categorization

**Tags** are string labels on traces for filtering and categorization — by environment, experiment, feature, or any dimension you care about.

## Using `observe`

Pass static tags directly to `observe`:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from traceroot import observe

    @observe(name="run_agent", type="agent", tags=["production", "v2"])
    def run_agent(query: str):
        return process(query)
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    import { observe } from '@traceroot-ai/traceroot';

    const result = await observe(
      { name: 'run_agent', type: 'agent', tags: ['production', 'v2'] },
      async () => process(query),
    );
    ```
  </Tab>
</Tabs>

## Using `using_attributes` / `usingAttributes`

Propagate tags to all traces within a block:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from traceroot import using_attributes

    with using_attributes(tags=["staging", "experiment-a"]):
        agent.run(query)
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    import { usingAttributes } from '@traceroot-ai/traceroot';

    await usingAttributes({ tags: ['staging', 'experiment-a'] }, async () => {
      await agent.run(query);
    });
    ```
  </Tab>
</Tabs>
