Skip to content

Commit 2ad35fe

Browse files
authored
[WEAVE] New limits page (#1798)
Resolves [DOCS-1244](https://wandb.atlassian.net/browse/DOCS-1244). Documents Weave retry behavior, but also documents a few other behaviors and limitation in a new Limits and Expected Behaviors doc. Eventually this doc will become part of a new "Details" section, but I've placed it in the Tools and Resources section for now. [DOCS-1244]: https://wandb.atlassian.net/browse/DOCS-1244?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 1077a70 commit 2ad35fe

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,8 @@
880880
"pages": [
881881
"weave/guides/core-types/env-vars",
882882
"weave/guides/troubleshooting",
883-
"weave/guides/tracking/faqs"
883+
"weave/guides/tracking/faqs",
884+
"weave/guides/tools/limits"
884885
]
885886
}
886887
]

weave/guides/tools/limits.mdx

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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

Comments
 (0)