mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
feat: 添加对 langfuse 监控的支持 (#242)
* docs: 更新类型检查的 CLAUDE.md * feat: 添加模型 1M 上下文切换 * chore: remove prefetchOfficialMcpUrls call on startup * docs: 添加 git commit 规范 * feat: 第一次接入 langfuse * fix: 修复 generation 的计时的错误 * feat: 添加多 agent 的监控 * feat: 添加 /poor 省流模式,toggle 关闭 extract_memories 和 prompt_suggestion Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: 修复 lock 文件 * chore: 更新类型依赖 --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,7 @@ import { isBetaTracingEnabled } from '../utils/telemetry/betaSessionTracing.js'
|
||||
import { getTelemetryAttributes } from '../utils/telemetryAttributes.js'
|
||||
import { setShellIfWindows } from '../utils/windowsPaths.js'
|
||||
import { initSentry } from '../utils/sentry.js'
|
||||
import { initLangfuse, shutdownLangfuse } from '../services/langfuse/index.js'
|
||||
|
||||
// initialize1PEventLogging is dynamically imported to defer OpenTelemetry sdk-logs/resources
|
||||
|
||||
@@ -154,6 +155,10 @@ export const init = memoize(async (): Promise<void> => {
|
||||
// Initialize Sentry for error reporting (no-op if SENTRY_DSN not set)
|
||||
initSentry()
|
||||
|
||||
// Initialize Langfuse tracing (no-op if keys not configured)
|
||||
initLangfuse()
|
||||
registerCleanup(shutdownLangfuse)
|
||||
|
||||
// Preconnect to the Anthropic API — overlap TCP+TLS handshake
|
||||
// (~100-200ms) with the ~100ms of action-handler work before the API
|
||||
// request. After CA certs + proxy agents are configured so the warmed
|
||||
|
||||
Reference in New Issue
Block a user