Skip to content

Add time_to_first_token metric to Anthropic integration#54

Merged
Matt Perpick (clutchski) merged 1 commit intomainfrom
matt/53
Apr 3, 2026
Merged

Add time_to_first_token metric to Anthropic integration#54
Matt Perpick (clutchski) merged 1 commit intomainfrom
matt/53

Conversation

@clutchski
Copy link
Copy Markdown
Contributor

Summary

  • Adds time_to_first_token metric to the Anthropic messagesTracer, matching existing OpenAI behavior
  • Streaming path: captures TTFT when the first SSE data chunk arrives
  • Non-streaming path: captures TTFT as full response latency

Fixes #53

Test plan

  • Added time_to_first_token > 0 assertion to assertSpanValid, which covers all integration tests (streaming, non-streaming, tools, multi-message)
  • make ci passes (lint + test + build)

🤖 Generated with Claude Code

Captures TTFT in both streaming (first SSE data chunk) and non-streaming
(full response latency) paths, matching existing OpenAI behavior.

Fixes #53

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@clutchski Matt Perpick (clutchski) merged commit e015507 into main Apr 3, 2026
10 checks passed
@clutchski Matt Perpick (clutchski) deleted the matt/53 branch April 3, 2026 15:39
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.

[BOT ISSUE] Anthropic integration does not capture time_to_first_token metric

2 participants