Skip to content

docs(integrations): Anthropic Go SDK tracing (TH-8272) - #962

Draft
nik13 wants to merge 6 commits into
mainfrom
feat/th-8272-anthropic-go
Draft

nik13 wants to merge 6 commits into
mainfrom
feat/th-8272-anthropic-go

Conversation

@nik13

@nik13 nik13 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Status: draft — blocked on Anthropic credits

TH-8272 (parent TH-8103). Do not merge or publish yet. The direct-provider gate was attempted with a real Anthropic key in E2B, with ANTHROPIC_BASE_URL unset. POST https://api.anthropic.com/v1/messages returned HTTP 400 invalid_request_error: “Your credit balance is too low to access the Anthropic API.” No proxy or alternate provider was substituted. The latest fresh qualification retry reproduced the same billing response and stopped before the weather command.

Human step: add credits to the Anthropic workspace associated with the staged ANTHROPIC_API_KEY, or provision a funded key through the existing secret store. Then rerun the exact page snippet and packaged weather example to qualify successful plain, tool and streaming requests plus the intentional invalid-model error. Keep the PR draft until those claims are verified directly.

What changed and why

  • Updated src/pages/docs/integrations/traceai/go/anthropic.mdx for the released github.com/future-agi/traceAI/go/[email protected] module and its Go 1.26.0 minimum.
  • Pinned the compatible Anthropic SDK v1.82.0 and OpenTelemetry v1.33.0 packages; distinguished the SDK's /v2 import path rather than implying an untested major-version upgrade.
  • Removed the customer-facing proxy history, internal verification dates and alpha/test diaries. Preserved meaningful limitations, content-capture defaults, SDK-content-mode warnings, cached-token accounting, and endpoint privacy guidance.
  • Kept the maintained middleware + standard OTLP exporter setup, enriching the native SDK span without duplicate instrumentation. The example returns through run() before log.Fatal, so even an API failure flushes the trace.
  • Replaced cloning source with the versioned, installable example command. Added the guide to the integration catalog/sidebar.
  • Added four page-contract tests and a GitHub Actions job that extracts the exact page snippet, installs its packages, builds/vets it under Go 1.26.0, and runs the published middleware's race tests without provider credentials.
  • Merged current main (ddca13930bd9c4b9cc80384b7cf2b1a0d71fa43d) rather than rebasing or force-pushing. Head: 9839d6fd648eac02ee97b185bd704470322dbbc3.

Verification

All builds and tests ran in E2B or GitHub Actions, not on the local workstation.

E2B ant962-docs-r1 — passed

  • node --test scripts/anthropic-go-page.test.mjs: four page-contract checks passed.
  • npm run test:integrations: 277 passed, zero failed/skipped.
  • node scripts/audit-links.mjs: zero broken navigation links and zero broken content links; 31 existing orphan-page warnings.
  • Extracted the page's exact install commands and Go block with node scripts/anthropic-go-snippet.mjs.
  • Go 1.26.0: go build -o example ., go vet ./..., and go test -race github.com/future-agi/traceAI/go/anthropic passed using the published packages.

E2B ant962-direct-r1 — blocked by provider billing

  • Installed the page's exact pinned dependencies and ran the Go block unchanged. Only runtime export configuration differed: synthetic Future AGI header values and FI_BASE_URL=http://127.0.0.1:4318 routed telemetry to the sandbox's loopback collector. Future AGI Cloud credentials never entered E2B.
  • The real Anthropic key was staged only for this run, removed inside the sandbox before installation/execution, and removed from the local staging directory immediately afterward.
  • The first plain Messages call reached api.anthropic.com and failed with the insufficient-credit response above. The weather command did not run after that failure; there is no new direct-provider successful-response, streaming, tool, usage, or content-redaction qualification claim.
  • The failure path flushed one anthropic.messages.create span with gen_ai.span.kind=LLM, provider anthropic, server.address=api.anthropic.com, session/user tags, Input/Output, error.type=invalid_request_error, and status ERROR.
  • E2B ant962-error-decode-r1 decoded the captured OTLP body successfully. The collector compared the exported bytes against the real provider key in-process before writing them; the fetched body's SHA-256 matched that checked payload.
  • Forwarded that error-only trace to Future AGI Cloud project th8103-docs: collector HTTP 200, trace ID bb14a83c5ecda07b9437e7f52db27002. This is ingest acceptance, not a browser/readback assertion or evidence of a successful model call.

E2B ant962-fix-direct-r1 — billing blocker reconfirmed

  • Repeated the exact page install commands and unchanged Go snippet in a fresh E2B sandbox using Go 1.26.0, the staged real Anthropic key, and ANTHROPIC_BASE_URL unset. No source changes or model/provider substitution were made.
  • The plain call reached POST https://api.anthropic.com/v1/messages and returned HTTP 400, invalid_request_error: “Your credit balance is too low to access the Anthropic API.” The run exited 1. The packaged weather/stream/tool/invalid-model command therefore did not execute.
  • Captured one error-path OTLP body. The collector's in-process provider-key absence check passed, and the fetched payload's SHA-256 matched the checked bytes. Only synthetic Future AGI credentials entered E2B.
  • Removed staged secrets locally and inside E2B; sandbox deletion was confirmed by get_info_404=true. No new trace was forwarded to Cloud because no successful provider call was available.
  • This is an external qualification blocker, not evidence of a code defect. No new repository test can substitute for the missing funded-provider success run; the existing nine CI checks remain green at the unchanged head.
  • Still required: fund the workspace associated with the existing secret-store key, or have its owner provision a funded key through that store. Then rerun plain, streaming, tool and intentional-invalid-model checks, inspect the spans, check provider-key absence, and forward a successful trace to th8103-docs. TH-8272 stays open and this PR stays draft until then.

CI

All nine checks completed successfully on head 9839d6fd648eac02ee97b185bd704470322dbbc3.

  • PR Checks: link/catalog/redirect audit, both Helicone conformance matrix legs, and docs build/Pagefind/browser suite all passed.
  • Anthropic Go 1.26 snippet: exact page snippet build/vet and published middleware race tests passed.
  • FastMCP and Temporal Go: both triggered matrix legs passed.

The branch is conflict-free and contains current main, but this PR intentionally remains draft because direct-provider successful-call qualification is still blocked.

Review and remaining scope

E2E coverage: not applicable (this docs repository has no product e2e/ coverage harness). Documentation contracts, compilation and existing site CI are applicable. No Python, migration, backend contract or product runtime changes.

Self-review checked the actual diff against current main, the released module source, error handling, secret separation, privacy caveats and internal minimal-code/testing/PR standards. No introduced blocking code defect identified. The direct-provider success qualification remains an explicit release blocker, not something green CI can waive. No browser was driven, no screenshot was fabricated, and no ticket was closed.

Local engineering receipts:

  • /Volumes/nik-ext-1/tmp/traceai-release-20261104/e2b/runs/ant962-docs-r1/receipt.json
  • /Volumes/nik-ext-1/tmp/traceai-release-20261104/e2b/runs/ant962-direct-r1/receipt.json
  • /Volumes/nik-ext-1/tmp/traceai-release-20261104/e2b/runs/ant962-error-decode-r1/receipt.json
  • /Volumes/nik-ext-1/tmp/agent-plugins-1106/ant962-error-decoded-r1/error-summary.json
  • /Volumes/nik-ext-1/tmp/traceai-release-20261104/e2b/runs/ant962-fix-direct-r1/receipt.json
  • /Volumes/nik-ext-1/tmp/traceai-release-20261104/e2b/runs/ant962-fix-direct-r1/stderr.log (billing response at line 51)
  • /Volumes/nik-ext-1/tmp/traceai-release-20261104/e2b/runs/ant962-fix-direct-r1/fetched/captures.tgz

🤖 Generated with Claude Code

New page for the traceAI Go middleware for anthropic-sdk-go
(traceAI PR #259): install, OTLP/HTTP export to Future AGI, the span and
its attributes, the SDK's own span, FI_HIDE_* privacy settings,
limitations and troubleshooting. Alpha, verified through a stand-in
endpoint (local proxy with real Claude responses).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nik13 and others added 3 commits October 16, 2026 14:57
Matches the other Go pages (traceai/go/openai, go/gemini, go/a2a, go/eino).
New URL: /docs/integrations/traceai/go/anthropic. Not yet published, so no redirect is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The page goes live only after traceAI#259 is merged to main and go/anthropic is
tagged, so install with @latest instead of @dev or the PR branch, link the source on
main, and drop the troubleshooting row for the untagged module. The warning now says
what was run (real Claude models through an Anthropic-compatible proxy) instead of
"stand-in endpoint"; it still says api.anthropic.com was not called.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nik13 and others added 2 commits November 8, 2026 17:16
Pin released packages and Go 1.26, remove internal qualification prose, flush telemetry on API errors, and register the Go guide in the integration catalog. Add contract and cloud-only Go checks. Direct success qualification remains blocked on Anthropic credits.

Co-Authored-By: Claude Code <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant