JavaScript APIbeeai

Core

Instrumentation

Integrations

JavaScript · Instrumentation

@arizeai/openinference-instrumentation-beeai

OpenInference Instrumentation for BeeAI framework

Version
1.6.6
Instruments
beeai-framework ^0.1.13

Install

npm install @arizeai/openinference-instrumentation-beeai

Usage

Register the instrumentation once, at startup, before the library is imported. The BeeAIInstrumentation reference below lists its options.

import { registerInstrumentations } from "@opentelemetry/instrumentation";
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
import { BeeAIInstrumentation } from "@arizeai/openinference-instrumentation-beeai";

const provider = new NodeTracerProvider({
  // ...a span processor that exports to Phoenix or any OTLP backend.
});
provider.register();

registerInstrumentations({
  instrumentations: [new BeeAIInstrumentation()],
});

If the library is imported first (as ES modules often are), patch it directly with manuallyInstrument().

@arizeai/openinference-instrumentation-beeai

isPatched

functionSource ↗
function isPatched(): boolean

function to check if instrumentation is enabled / disabled

BeeAIInstrumentation

classSource ↗
class BeeAIInstrumentation extends InstrumentationBase

Properties

NameType
tracerTracer

new BeeAIInstrumentation

constructorSource ↗
new BeeAIInstrumentation(
  options?: {
    instrumentationConfig?: InstrumentationConfig;
    traceConfig?: TraceConfigOptions;
    tracerProvider?: TracerProvider;
  },
): BeeAIInstrumentation

Parameters

NameTypeDescription
instrumentationConfig?InstrumentationConfig

The config for the instrumentation

traceConfig?TraceConfigOptions

The OpenInference trace configuration. Can be used to mask or redact sensitive information on spans.

tracerProvider?TracerProvider

An optional custom trace provider to be used for tracing. If not provided, a tracer will be created using the global tracer provider. This is useful if you want to use a non-global tracer provider.

manuallyInstrument

methodSource ↗
manuallyInstrument(module: __module): void

Manually instruments the BeeAI module. This is needed when the module is not loaded via require (commonjs)

setTracerProvider

methodSource ↗
setTracerProvider(tracerProvider: TracerProvider): void

Sets TraceProvider to this plugin