Choose integration depth to match your wrapper and avoid duplicate telemetry.
Agent hint
Use when user has LangChain/LiteLLM middleware or custom retry wrapper — pick one instrumentation path.
In scope
Out of scope
| Your harness | Recommended | Double-count risk |
|---|---|---|
| None — raw SDK calls | Auto-hook or patch_all() | Low |
| Partial — custom retry/logging wrapper | Manual log_event at wrapper boundary | Low if patch disabled |
| Full — LangChain/LiteLLM + OTel | wrap() with workflow_id; avoid patch + wrap | Medium — use __aurex_patched__ guards |
auditor.patch_openai() # guarded with __aurex_patched__
result = auditor.wrap(
call_fn=openai.chat.completions.create,
build_params=lambda: {"model": "gpt-4o", "messages": [...]},
options={"workflow_id": "checkout_agent"},
)const response = await auditor.wrap(
(params) => openai.chat.completions.create(params),
() => ({ model: "gpt-4o", messages: [...] }),
{ workflowId: "checkout_agent" },
);auditor.log_event(
model=response.model,
input_tokens=response.usage.prompt_tokens,
output_tokens=response.usage.completion_tokens,
workflow_id=workflow_id,
)auditor.logEvent({
model: response.model,
inputTokens: response.usage.prompt_tokens,
outputTokens: response.usage.completion_tokens,
workflowId,
});Call get_health() for patch_status. In tests, call AurexAuditor.reset() before re-configuring.