Skip to content

[bot] Anthropic Vertex SDK (@anthropic-ai/vertex-sdk) not covered by auto-instrumentation #2072

@braintrust-bot

Description

@braintrust-bot

Summary

Anthropic publishes a dedicated TypeScript SDK for Claude on Google Vertex AI: @anthropic-ai/vertex-sdk. It provides the same messages.create() API as @anthropic-ai/sdk but authenticates via Google Cloud credentials and routes through Vertex AI. This repository's auto-instrumentation exclusively targets @anthropic-ai/sdk module file paths; @anthropic-ai/vertex-sdk ships under a different npm package with different module paths and is not patched by any existing instrumentation config. Users who access Claude on Vertex AI via this SDK get no Braintrust spans.

What instrumentation is missing

The @anthropic-ai/vertex-sdk package exposes the same execution surface as @anthropic-ai/sdk:

SDK Method Description
client.messages.create({ model, messages, ... }) Chat completions via Vertex AI
client.messages.stream(...) Streaming messages helper
client.beta.messages.create(...) Extended-thinking and other beta APIs

Users instantiate it as:

import { AnthropicVertex } from "@anthropic-ai/vertex-sdk";

const client = new AnthropicVertex({ projectId: "MY_PROJECT_ID", region: "global" });
const result = await client.messages.create({
  model: "claude-opus-4-6",
  max_tokens: 256,
  messages: [{ role: "user", content: "Hello" }],
});

Auto-instrumentation gap:

The AST-transformation configs in js/src/auto-instrumentations/configs/anthropic.ts target @anthropic-ai/sdk at specific module file paths (resources/messages.mjs, etc.). The @anthropic-ai/vertex-sdk package has different internal module paths and is a separate npm package. None of the existing configs match @anthropic-ai/vertex-sdk, so load-time or build-time AST patching does not apply to it.

No coverage in any instrumentation layer:

  • No entry in js/src/auto-instrumentations/configs/anthropic.ts for @anthropic-ai/vertex-sdk
  • No module path targeting for @anthropic-ai/vertex-sdk in any instrumentation config
  • No e2e test scenarios for Vertex SDK
  • Grep for vertex-sdk, AnthropicVertex, or @anthropic-ai/vertex across the entire repo returns zero matches

Analogous gap already tracked:

Issue #2047 covers @anthropic-ai/bedrock-sdk (Claude on AWS Bedrock), which has the identical structure — same messages.create() API, different npm package, different module paths. The Vertex SDK gap is the same pattern applied to Google Cloud.

Braintrust docs status

unclear — The Braintrust docs at https://www.braintrust.dev/docs/integrations/ai-providers/anthropic reference @anthropic-ai/sdk and do not mention @anthropic-ai/vertex-sdk or AnthropicVertex. The official Anthropic docs at https://platform.claude.com/docs/en/api/claude-on-vertex-ai show @anthropic-ai/vertex-sdk as the official TypeScript SDK for Claude on Vertex AI.

Upstream references

Local files inspected

  • js/src/auto-instrumentations/configs/anthropic.ts — targets @anthropic-ai/sdk only, no entry for @anthropic-ai/vertex-sdk
  • js/src/auto-instrumentations/configs/all.ts@anthropic-ai/vertex-sdk not listed among any instrumentation groups
  • Full repo grep for vertex-sdk, AnthropicVertex, @anthropic-ai/vertex — zero matches
  • e2e/scenarios/ — no Vertex SDK test scenarios

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions