-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(captcha): improve telemetry on captcha error #12836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Enhanced error telemetry across captcha validation system by standardizing error messages and adding detailed metrics tracking.
- Standardized error messages in both
TurnstileDriver
andGoogleRecaptchaDriver
from 'Captcha Error' to 'unknown-error' for better error tracking - Enhanced
MetricsService
inpackages/twenty-server/src/engine/core-modules/metrics/metrics.service.ts
to support attributes in telemetry counters - Added error attributes to metrics in
CaptchaGuard
for improved failure tracking and debugging - Aligned with OpenTelemetry standards for better integration with monitoring systems
4 files reviewed, 3 comments
Edit PR Review Bot Settings | Greptile
packages/twenty-server/src/engine/core-modules/captcha/drivers/google-recaptcha.driver.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/metrics/metrics.service.ts
Show resolved
Hide resolved
...(!responseData.success && { | ||
error: responseData['error-codes']?.[0] ?? 'Captcha Error', | ||
error: responseData['error-codes']?.[0] ?? 'unknown-error', | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider adding a constant for 'unknown-error' to maintain consistency and avoid magic strings
shouldStoreInCache = true, | ||
}: { | ||
key: MetricsKeys; | ||
eventIds: string[]; | ||
attributes?: Attributes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does this work? can a counter have attributes? how does this aggregates?
…error-telemetry # Conflicts: # packages/twenty-server/src/engine/core-modules/metrics/metrics.service.ts
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:6942 This environment will automatically shut down when the PR is closed or after 5 hours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.