To instrument your application, use the register function from @arizeai/phoenix-otel and manually instrument the Bedrock SDK.Create the instrumentation.ts file:
import { register } from "@arizeai/phoenix-otel";import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime";import { BedrockInstrumentation } from "@arizeai/openinference-instrumentation-bedrock";// Initialize Phoenix tracingconst tracerProvider = register({ projectName: "bedrock-app", // If using Phoenix Cloud: // url: "https://app.phoenix.arize.com/s/your-space-name", // apiKey: process.env.PHOENIX_API_KEY, // If using self-hosted Phoenix: // url: "http://localhost:6006",});// Set up Bedrock instrumentationconst instrumentation = new BedrockInstrumentation();instrumentation.manuallyInstrument(BedrockRuntimeClient);console.log("Bedrock instrumentation registered");