@arizeai/openinference-instrumentation-bedrock-agent-runtime

中文文档
1.2.5发布于 2026/10/24Apache-2.0TypeScriptESM + CJS构建来源已验证近 30 天下载 1911

OpenInference instrumentation for AWS Bedrock Agent Runtime

原始使用文档
文档目录6 节
  1. Installation
  2. Usage
  3. Manual Instrumentation
  4. Examples
  5. Using a Custom Tracer Provider
  6. Compatibility

OpenInference Instrumentation for AWS Bedrock Agent Runtime

npm version

This module provides automatic instrumentation for the AWS Bedrock Agent Runtime Client which may be used in conjunction with @opentelemetry/sdk-trace-node.

Installation

npm install --save @arizeai/openinference-instrumentation-bedrock-agent-runtime

Usage

To load the Bedrock Agent Runtime instrumentation, specify it in the registerInstrumentations call along with any additional instrumentation you wish to enable.

import { NodeTracerProvider } = from "@opentelemetry/sdk-trace-node";
import {
  BedrockAgentInstrumentation,
} = from "@arizeai/openinference-instrumentation-bedrock-agent-runtime";
import { registerInstrumentations } = "@opentelemetry/instrumentation";

const provider = new NodeTracerProvider();
provider.register();

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

Manual Instrumentation

For cases where import order is difficult to control, you can manually instrument the Bedrock Agent Runtime client:

import { BedrockAgentInstrumentation } from "@arizeai/openinference-instrumentation-bedrock-agent-runtime";
import * as bedrockAgentRuntime from "@aws-sdk/client-bedrock-agent-runtime";

const instrumentation = new BedrockAgentInstrumentation();
instrumentation.manuallyInstrument(bedrockAgentRuntime);

// Now use the Bedrock Agent Runtime client as normal
const client = new bedrockAgentRuntime.BedrockAgentRuntimeClient({
  region: "us-east-1",
});

Examples

To run an example, run the following commands:

cd js/packages/openinference-instrumentation-bedrock-agent-runtime
pnpm install
pnpm -r build
npx -y tsx examples/run-invoke-agent.ts

For more information on OpenTelemetry Node.js SDK, see the OpenTelemetry Node.js SDK documentation.

Using a Custom Tracer Provider

You can specify a custom tracer provider when creating the Bedrock Agent Runtime instrumentation. This is useful when you want to use a non-global tracer provider or have more control over the tracing configuration.

import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
import { Resource } from "@opentelemetry/resources";
import { SEMRESATTRS_PROJECT_NAME } from "@arizeai/openinference-semantic-conventions";
import { BedrockAgentInstrumentation } from "@arizeai/openinference-instrumentation-bedrock-agent-runtime";
import { registerInstrumentations } from "@opentelemetry/instrumentation";

// Create a custom tracer provider
const customTracerProvider = new NodeTracerProvider({
  resource: new Resource({
    [SEMRESATTRS_PROJECT_NAME]: "my-bedrock-agent-project",
  }),
});

// Pass the custom tracer provider to the instrumentation
const bedrockAgentInstrumentation = new BedrockAgentInstrumentation({
  tracerProvider: customTracerProvider,
});

// Register the instrumentation with the custom tracer provider
registerInstrumentations({
  instrumentations: [bedrockAgentInstrumentation],
  tracerProvider: customTracerProvider,
});

Alternatively, you can set the tracer provider after creating the instrumentation:

const bedrockAgentInstrumentation = new BedrockAgentInstrumentation();
bedrockAgentInstrumentation.setTracerProvider(customTracerProvider);

Compatibility

@arizeai/openinference-instrumentation-bedrock-agent-runtime is compatible with the following versions of the @aws-sdk/client-bedrock-agent-runtime package:

AWS SDK VersionOpenInference Instrumentation Version
^3.0.0^0.2.0

版本与发布记录

@arizeai/openinference-instrumentation-bedrock-agent-runtime 共发布 35 个版本,首次发布于 2025/08/09;过去 12 个月发布了 27 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.2.5latest2026/10/2415 天前
1.2.42026/10/021 个月前
1.2.32026/10/021 个月前
1.2.22026/10/011 个月前
1.2.12026/09/191 个月前
1.2.02026/09/181 个月前

关于 @arizeai/openinference-instrumentation-bedrock-agent-runtime 的常见问题

@arizeai/openinference-instrumentation-bedrock-agent-runtime 是什么?

OpenInference instrumentation for AWS Bedrock Agent Runtime

如何安装 @arizeai/openinference-instrumentation-bedrock-agent-runtime?

在项目目录运行 npm install @arizeai/openinference-instrumentation-bedrock-agent-runtime,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@aws-sdk/client-bedrock-agent-runtime(^3.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@arizeai/openinference-instrumentation-bedrock-agent-runtime 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@arizeai/openinference-instrumentation-bedrock-agent-runtime 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@arizeai/openinference-instrumentation-bedrock-agent-runtime 可以商用吗?

@arizeai/openinference-instrumentation-bedrock-agent-runtime 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@arizeai/openinference-instrumentation-bedrock-agent-runtime 的下载量有多少?

根据 npm 官方下载统计,@arizeai/openinference-instrumentation-bedrock-agent-runtime 在 2026/10/07 – 2026/11/05 这 30 天内被下载 1,911 次,日均约 64 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@arizeai/openinference-instrumentation-bedrock-agent-runtime 还在维护吗?

最新版本 1.2.5 发布于 2026/10/24(15 天前);至今共发布 35 个版本,其中过去 12 个月发布了 27 个;首次发布于 2025/08/09。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。