> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-update-reference-docs-40.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Trace data is truncated

Sometimes, large trace data is cut off in the Weave UI. This happens because the default trace output is a raw, custom Python object that Weave can't serialize. This page shows how to expose the full trace data so it displays in the UI.

To prevent large trace data from being cut off, define a `to_dict` method that returns a dictionary of strings containing all trace data. Because Weave can serialize dictionaries, this approach gives the UI access to the full object state. The following example shows the pattern:

```python theme={null}
import weave

class MyObj:
    def __init__(self, x: int):
        self.x = x

    def __repr__(self):
        return f"MyObj(x={self.x})"

    def to_dict(self):
        return {"x": self.x}

@weave.op()
def make_my_obj():
    x = "s" * 10_000
    return MyObj(x)
```

With this `to_dict` method in place, Weave can serialize the object and display its contents in the trace UI instead of truncating the raw representation.

***

<Badge stroke shape="pill" color="orange" size="md">[Trace Data](/support/weave/tags/trace-data)</Badge>
