@arizeai/phoenix-otel re-exports the OpenTelemetry trace, context, and SpanStatusCode APIs, plus the @arizeai/openinference-core attribute builders, OITracer, and utility helpers.
For most use cases, prefer the tracing helpers covered in Tracing Helpers. Use manual spans when you need exact span timing, low-level OpenTelemetry interop, or explicit control over which attributes are recorded.
Relevant Source Files
src/index.tsre-exports the manual tracing surfacesrc/register.tsconfigures the Phoenix exporter and providernode_modules/@arizeai/openinference-core/src/helpers/attributeHelpers.tsimplements the attribute buildersnode_modules/@arizeai/openinference-core/src/trace/trace-config/OITracer.tsimplements redaction-aware tracing
Recommended First: OpenInference Helpers#
If you do not need low-level OpenTelemetry control, use the helper wrappers first:
Raw OpenTelemetry Spans#
Use raw spans when you need full control over timing and attributes:
If you need context-propagated session, user, metadata, or prompt-template attributes on a plain tracer span, copy them explicitly with getAttributesFromContext() as shown on Context Attributes.
Attribute Helper APIs#
Use the attribute helpers to build OpenInference-compatible attribute sets for LLM, retriever, embedding, tool, input, and output spans.
Common helpers:
getLLMAttributesgetEmbeddingAttributesgetRetrieverAttributesgetToolAttributesgetMetadataAttributesgetInputAttributesgetOutputAttributesdefaultProcessInputdefaultProcessOutput
Trace Config And Redaction#
OITracer wraps an OpenTelemetry tracer and applies OpenInference trace masking rules before attributes are written. It also merges propagated context attributes automatically.
You can also configure masking via environment variables:
OPENINFERENCE_HIDE_INPUTSOPENINFERENCE_HIDE_OUTPUTSOPENINFERENCE_HIDE_INPUT_MESSAGESOPENINFERENCE_HIDE_OUTPUT_MESSAGESOPENINFERENCE_HIDE_INPUT_IMAGESOPENINFERENCE_HIDE_INPUT_TEXTOPENINFERENCE_HIDE_OUTPUT_TEXTOPENINFERENCE_HIDE_EMBEDDING_VECTORSOPENINFERENCE_BASE64_IMAGE_MAX_LENGTHOPENINFERENCE_HIDE_PROMPTSOPENINFERENCE_HIDE_LLM_TOOLS
Utility Helpers#
The package also re-exports small safety utilities:
withSafety({ fn, onError? })wraps a function and returnsnullif it throwssafelyJSONStringify(value)wrapsJSON.stringifysafelyJSONParse(value)wrapsJSON.parse
Source Map
src/index.tssrc/register.tsnode_modules/@arizeai/openinference-core/src/helpers/attributeHelpers.tsnode_modules/@arizeai/openinference-core/src/trace/trace-config/OITracer.tsnode_modules/@arizeai/openinference-core/src/utils/index.ts

