mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-14 08:34:32 +00:00
Merge pull request #16833 from overleaf/bg-google-spam-add-email-metrics
Include email type and rate-limit status in metrics GitOrigin-RevId: eb5645e68d9ee3571d04b87b2c0fc09f9caa126a
This commit is contained in:
parent
f6a693c1f5
commit
9702b36c64
2 changed files with 6 additions and 2 deletions
|
@ -22,7 +22,7 @@ async function sendEmail(emailType, opts) {
|
|||
opts.html = email.html
|
||||
opts.text = email.text
|
||||
opts.subject = email.subject
|
||||
await EmailSender.promises.sendEmail(opts)
|
||||
await EmailSender.promises.sendEmail(opts, emailType)
|
||||
}
|
||||
|
||||
function sendDeferredEmail(emailType, opts, delay) {
|
||||
|
|
|
@ -66,9 +66,13 @@ function getClient() {
|
|||
return client
|
||||
}
|
||||
|
||||
async function sendEmail(options) {
|
||||
async function sendEmail(options, emailType) {
|
||||
try {
|
||||
const canContinue = await checkCanSendEmail(options)
|
||||
metrics.inc('email_status', {
|
||||
status: canContinue ? 'sent' : 'rate_limited',
|
||||
path: emailType,
|
||||
})
|
||||
if (!canContinue) {
|
||||
logger.debug(
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue