|
| 1 | +--- |
| 2 | +title: Limits and expected behaviors |
| 3 | +description: A list of Weave's limitations, known issues, and expected behaviors |
| 4 | +--- |
| 5 | + |
| 6 | +* For retryable requests, Weave retries requests starting at 1 second after receiving the first error and then doubles the amount of time between attempts up to 5 minutes. Requests timeout after 36 hours. |
| 7 | + |
| 8 | +* Instead of raising exceptions, [`.call()`](/weave/guides/tracking/tracing#creating-calls) captures exceptions and stores them in the `call.exception`. If you need to raise exceptions during execution, set the [`__should_raise` parameter](/weave/reference/python-sdk/trace/op#function-call), like this: |
| 9 | + |
| 10 | + ```python showLineNumbers |
| 11 | + # This raises exceptions |
| 12 | + result, call = foo.call(__should_raise=True) |
| 13 | + ``` |
| 14 | + |
| 15 | +* Dedicated Weave instances use a different OpenTelemetry ingress URL. See [Send OpenTelemetry Traces](/weave/guides/tracking/otel) for authoritative endpoint information. |
| 16 | + |
| 17 | +* Weave sometimes truncates large trace data objects. This occurs because default trace output is a raw, custom Python object that Weave doesn’t know how to serialize. To return all of your trace data, define a dictionary of strings, like this: |
| 18 | + |
| 19 | + ```python |
| 20 | + import weave |
| 21 | + |
| 22 | + class MyObj: |
| 23 | + """An object with a large string attribute.""" |
| 24 | + def __init__(self, x: int): |
| 25 | + self.x = x |
| 26 | + |
| 27 | + def __repr__(self): |
| 28 | + return f"MyObj(x={self.x})" |
| 29 | + |
| 30 | + def to_dict(self): |
| 31 | + return {"x": self.x} |
| 32 | + |
| 33 | + @weave.op() |
| 34 | + def make_my_obj(): |
| 35 | + x = "a" * 10_000 |
| 36 | + return MyObj(x) |
| 37 | + |
| 38 | + def main(): |
| 39 | + weave.init("<entity/project>") |
| 40 | + |
| 41 | + # Define a traceable operation that processes MyObj |
| 42 | + @weave.op() |
| 43 | + def process_obj(obj: MyObj) -> int: |
| 44 | + return len(obj.x) |
| 45 | + |
| 46 | + # Create and process a large MyObj instance |
| 47 | + large_obj = make_my_obj() |
| 48 | + length = process_obj(large_obj) |
| 49 | + print(f"Length of x in MyObj: {length}") |
| 50 | + print("dict:", large_obj.to_dict()) |
| 51 | + |
| 52 | + if __name__ == "__main__": |
| 53 | + main() |
| 54 | + ``` |
0 commit comments