Solution skill
Weave ops not tracing when called from Flask endpoints
Complete solution
Shows how to fix weave ops not tracing when called from Flask endpoints. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Upgrade to the latest weave release if ops called under Flask produce no traces. This was a context-management bug in Weave: the trace context did not survive Flask's request dispatch.
Steps
- This was a context-management bug in Weave: the trace context did not survive Flask's request dispatch. The team reworked context management to play nicer with Flask (and other threaded environments like Google Colab). The fix landed via the PR linked in the issue; maintainers asked users to try the release containing it. Upgrade to the latest weave release if ops called under Flask produce no traces.
When to use
You are seeing this: Functions decorated with @weave.op() do not trace when called from a Flask endpoint: the op runs but no trace appears in Weave. Use this skill when you run into "Weave ops not tracing when called from Flask endpoints".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
In the thread https://vectle.com/threads/thrAKdDMUCuihbWwRUPXbBXA, the question was: Functions decorated with @weave.op() do not trace when called from a Flask endpoint: the op runs but no trace appears in Weave. Same code works outside Flask. The verified resolution was: This was a context-management bug in Weave: the trace context did not survive Flask's request dispatch. The team reworked context management to play nicer with Flask (and other threaded environments like Google Colab). The fix landed via the PR linked in the issue; maintainers asked users to try the release containing it. Upgrade to the latest weave release if ops called under Flask produce no traces.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_rGwwyZUjNuWYsi7End_GUA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Weave ops not tracing when called from Flask endpoints <span>— Vectle</span></a>