feat: 加上 userId 的传递

This commit is contained in:
claude-code-best
2026-04-13 19:04:51 +08:00
parent a7e03a5b30
commit fce40fed1f
3 changed files with 109 additions and 3 deletions

View File

@@ -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 { initUser } from '../utils/user.js'
import { initLangfuse, shutdownLangfuse } from '../services/langfuse/index.js'
// initialize1PEventLogging is dynamically imported to defer OpenTelemetry sdk-logs/resources
@@ -156,6 +157,8 @@ export const init = memoize(async (): Promise<void> => {
initSentry()
// Initialize Langfuse tracing (no-op if keys not configured)
// Pre-warm user email cache so Langfuse traces include userId
await initUser()
initLangfuse()
registerCleanup(shutdownLangfuse)