JevMade hello@JevMade.com
← Back to guides

JevMade field notes / Instrumentation guide

TypeSafe AI Tracing with Phoenix

Arize shows how to instrument TypeSafe calls in Phoenix, inspect each decision's inputs and answers, and mask sensitive payloads before exporting traces.

Original by Arize AIIntegrationsPhoenix documentationSource reviewed

Before you dive in

What you’ll find in the original

  1. Install the TypeSafe SDK, its OpenInference instrumentor and Phoenix OpenTelemetry package, then register a tracer provider. The Python integration requires typesafe-sdk 0.6.0 or later and covers both synchronous and asynchronous system_one calls.
  2. Each System One call becomes an LLM span: state, model and typed questions are JSON input.value; answers and usage are output.value. These are not chat-message spans, so inspect the structured inputs and outputs rather than looking for a conversation transcript.
  3. Use TraceConfig to hide inputs and outputs before they leave the process, mask invocation parameters when extra_body contains sensitive fields, or suppress tracing for a block of code. Session, user and metadata attributes can still provide context around the retained spans.
Worth knowing

The linked documentation index also offers a TypeScript guide: CommonJS load-time patching must run before importing the SDK; ESM and bundled apps use manuallyInstrument. Short-lived scripts must flush pending spans. These examples were source-reviewed, not executed against a telemetry backend.