OpenInference JS
    Preparing search index...

    Extends SimpleSpanProcessor to support OpenInference attributes. This processor enhances spans with OpenInference attributes before exporting them. It can be configured to selectively export only OpenInference spans or all spans.

    import { OpenInferenceSimpleSpanProcessor, isOpenInferenceSpan } from "@arizeai/openinference-vercel";
    import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto"

    const exporter = new OTLPTraceExporter();
    const processor = new OpenInferenceSimpleSpanProcessor({
    exporter,
    spanFilter: isOpenInferenceSpan,
    });

    const tracerProvider = new NodeTracerProvider({
    resource: resourceFromAttributes({
    [SEMRESATTRS_PROJECT_NAME]: "your-project-name",
    }),
    spanProcessors: [processor], // <-- pass processor here
    });

    Hierarchy

    Index

    Constructors

    Methods

    • Forces to export all finished spans

      Returns Promise<void>

    • Called when a Span is started, if the span.isRecording() returns true.

      Parameters

      • _span: Span
      • _parentContext: Context

      Returns void

    • Shuts down the processor. Called when SDK is shut down. This is an opportunity for processor to do any cleanup required.

      Returns Promise<void>