Skip to main content

Available in @arizeai/phoenix-otel 1.0.0+

@arizeai/phoenix-otel now re-exports the full @arizeai/openinference-core and @arizeai/openinference-semantic-conventions surface so you can register tracing, wrap functions, decorate methods, set context attributes, and build rich OpenInference spans from a single import.

Tracing Helpers#

withSpan, traceChain, traceAgent, and traceTool wrap functions with OpenInference spans. Each helper records inputs, outputs, errors, and span kind, and resolves the default tracer when the wrapped function runs — so helpers defined at module scope follow global provider changes.

Decorators#

The observe decorator wraps class methods with tracing while preserving this. Use TypeScript 5+ standard decorators.

Context Attribute Setters#

Propagate session IDs, user IDs, metadata, tags, and prompt templates to all child spans inside a context scope.

Available setters: setSession, setUser, setMetadata, setTags, setAttributes, setPromptTemplate. For manual spans, copy propagated attributes with getAttributesFromContext(context.active()).

OpenInference Semantic Conventions#

@arizeai/openinference-semantic-conventions is now re-exported directly from @arizeai/phoenix-otel. Import SemanticConventions, OpenInferenceSpanKind, and attribute name constants from one place instead of adding a second dependency.

Attribute Builders#

Build OpenInference-compatible span attributes directly for raw OpenTelemetry spans or custom processors.

Available builders: getLLMAttributes, getEmbeddingAttributes, getRetrieverAttributes, getToolAttributes, getMetadataAttributes, getInputAttributes, getOutputAttributes, defaultProcessInput, defaultProcessOutput.

Redaction With OITracer#

OITracer wraps an OpenTelemetry tracer and redacts or drops sensitive OpenInference attributes before spans are written. Configure via traceConfig or the OPENINFERENCE_HIDE_* environment variables.