added API level logs sampling and person level enabling feature#1329
Conversation
|
Caution Review failedPull request was closed or merged during review WalkthroughThis PR introduces staggered dynamic logging capabilities by adding a ChangesStaggered Dynamic Log Levels with Token-based Lookup
Sequence DiagramsequenceDiagram
participant Request as Request Handler
participant withModifiedEnvFn as withModifiedEnvFn
participant ModifierFn as Modifier Function
participant getDynamicLogLevelConfig as getDynamicLogLevelConfig
participant resolveDynamicLogLevel as resolveDynamicLogLevel
Request->>withModifiedEnvFn: incoming request with headers
withModifiedEnvFn->>withModifiedEnvFn: extract token from headers
withModifiedEnvFn->>ModifierFn: pass requestId, sessionId, mbToken
ModifierFn->>getDynamicLogLevelConfig: fetch HashMap Text DynamicLogLevel
ModifierFn->>ModifierFn: lookup by sanitized URL
alt URL match found
ModifierFn->>resolveDynamicLogLevel: resolve with DynamicLogLevel
else URL no match
ModifierFn->>ModifierFn: lookup by token
ModifierFn->>resolveDynamicLogLevel: resolve with DynamicLogLevel
end
resolveDynamicLogLevel->>resolveDynamicLogLevel: random percentage toss if stagger present
resolveDynamicLogLevel-->>ModifierFn: Maybe LogLevel
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Type of Change
Description
Additional Changes
Motivation and Context
How did you test it?
Checklist
./dev/format-all-files.shSummary by CodeRabbit