Skip to content

Add calibrate.tracing.log for non-blocking trace sending - #3

Open
dalmia wants to merge 1 commit into
mainfrom
add-fire-and-forget-trace-logging
Open

Add calibrate.tracing.log for non-blocking trace sending#3
dalmia wants to merge 1 commit into
mainfrom
add-fire-and-forget-trace-logging

Conversation

@dalmia

@dalmia dalmia commented Aug 15, 2026

Copy link
Copy Markdown
Owner
from calibrate.tracing import log

log(agent_id="...", input=history, output={"response": reply})

Returns immediately. The POST runs on a background thread, and a failed send is logged and dropped, so an unreachable Calibrate never slows down or breaks the agent it is only meant to observe. The generated client waits for the response, which is the wrong trade in a request path.

Reads CALIBRATE_API_KEY and CALIBRATE_BASE_URL, or takes both as arguments.

src/calibrate/tracing.py and tests/test_tracing.py are handwritten, so both are listed in .fernignore to survive the next fern generate.

Needs ARTPARK-SAHAI-ORG/calibrate-backend#181 deployed before POST /traces accepts these calls.

3 tests pass.

🤖 Generated with Claude Code

The generated client waits for the HTTP response, which is the wrong
trade in a request path: a slow or unreachable Calibrate would slow down
the agent it is only meant to observe. log() hands the POST to a
background thread, and a failed send is logged and dropped rather than
raised.

Handwritten, so both files are listed in .fernignore to survive the next
fern generate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant