Skip to content

Conversation

GeLi2001
Copy link
Contributor

@GeLi2001 GeLi2001 commented Oct 2, 2025

resolves #2231


Note

Introduces a new JS package providing OpenInference/OpenTelemetry instrumentation for Anthropic messages.create, including streaming, tool use, token usage, examples, and tests.

  • New package: js/packages/openinference-instrumentation-anthropic
    • v1.0.0 initial release with TypeScript support, README, and CHANGELOG.
  • Instrumentation:
    • Adds AnthropicInstrumentation (src/instrumentation.ts, exported via src/index.ts) to trace anthropic.messages.create().
    • Supports streaming responses (consumes Stream chunks), tool/function calling, and token usage attributes.
    • Emits OpenInference-compliant LLM spans with input/output messages, invocation params, model/provider, and error status handling.
    • Optional traceConfig and custom TracerProvider support.
  • Examples: Basic usage, streaming, and tool-use demos in examples/*.
  • Tests: Basic enable/disable and config tests in test/instrumentation.test.ts.
  • Build/Config: Package metadata (package.json), tsconfigs, Vitest config; workspace lockfile updated.

Written by Cursor Bugbot for commit a6f68d5. This will update automatically on new commits. Configure here.

@GeLi2001 GeLi2001 requested a review from a team as a code owner October 2, 2025 05:04
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Oct 2, 2025
Copy link

pkg-pr-new bot commented Oct 2, 2025

Open in StackBlitz

@arizeai/openinference-core

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-core@2261

@arizeai/openinference-instrumentation-anthropic

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-anthropic@2261

@arizeai/openinference-instrumentation-bedrock

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-bedrock@2261

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

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-bedrock-agent-runtime@2261

@arizeai/openinference-instrumentation-beeai

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-beeai@2261

@arizeai/openinference-instrumentation-langchain

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-langchain@2261

@arizeai/openinference-instrumentation-mcp

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-mcp@2261

@arizeai/openinference-instrumentation-openai

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-instrumentation-openai@2261

@arizeai/openinference-mastra

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-mastra@2261

@arizeai/openinference-semantic-conventions

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-semantic-conventions@2261

@arizeai/openinference-vercel

npm i https://pkg.pr.new/Arize-ai/openinference/@arizeai/openinference-vercel@2261

commit: a6f68d5

cursor[bot]

This comment was marked as outdated.

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Oct 2, 2025
@GeLi2001 GeLi2001 marked this pull request as draft October 2, 2025 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

🗺️ [instrumentation][js] @arizeai/openinference-instrumentation-anthropic
1 participant