JavaScript · Instrumentation
@arizeai/openinference-instrumentation-bedrock-agent-runtime
OpenInference instrumentation for AWS Bedrock Agent Runtime
- Version
- 1.2.8
- Instruments
@aws-sdk/client-bedrock-agent-runtime ^3.0.0
Install
npm install @arizeai/openinference-instrumentation-bedrock-agent-runtimeUsage
Register the instrumentation once, at startup, before the library is imported. The BedrockAgentInstrumentation reference below lists its options.
import { registerInstrumentations } from "@opentelemetry/instrumentation";
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
import { BedrockAgentInstrumentation } from "@arizeai/openinference-instrumentation-bedrock-agent-runtime";
const provider = new NodeTracerProvider({
// ...a span processor that exports to Phoenix or any OTLP backend.
});
provider.register();
registerInstrumentations({
instrumentations: [new BedrockAgentInstrumentation()],
});If the library is imported first (as ES modules often are), patch it directly with manuallyInstrument().
@arizeai/openinference-instrumentation-bedrock-agent-runtime
isPatched
functionSource ↗function isPatched(): booleanBedrockAgentInstrumentation
classSource ↗class BedrockAgentInstrumentation extends InstrumentationBase<InstrumentationConfig>new BedrockAgentInstrumentation
constructorSource ↗new BedrockAgentInstrumentation(
options?: {
instrumentationConfig?: InstrumentationConfig;
traceConfig?: TraceConfigOptions;
tracerProvider?: TracerProvider;
},
): BedrockAgentInstrumentationParameters
| Name | Type | Description |
|---|---|---|
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): voidManually patches the BedrockAgentRuntimeClient, this allows for guaranteed patching of the module when import order is hard to control.
setTracerProvider
methodSource ↗setTracerProvider(tracerProvider: TracerProvider): voidSets TraceProvider to this plugin