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}); Copy
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});
Optional
Readonly
The exporter to pass spans to.
A filter to apply to spans before exporting. If it returns true for a given span, that span will be exported.
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.
Example