mirror of
https://github.com/simple-login/app.git
synced 2024-09-30 05:31:30 +02:00
send Custom/smtp_connection_time to newrelic
This commit is contained in:
parent
2cd50c582a
commit
22cf8cfe38
@ -17,6 +17,7 @@ from typing import Tuple, List, Optional, Union
|
|||||||
|
|
||||||
import arrow
|
import arrow
|
||||||
import dkim
|
import dkim
|
||||||
|
import newrelic.agent
|
||||||
import re2 as re
|
import re2 as re
|
||||||
import spf
|
import spf
|
||||||
from cachetools import cached, TTLCache
|
from cachetools import cached, TTLCache
|
||||||
@ -1307,7 +1308,9 @@ def sl_sendmail(
|
|||||||
if POSTFIX_SUBMISSION_TLS:
|
if POSTFIX_SUBMISSION_TLS:
|
||||||
smtp.starttls()
|
smtp.starttls()
|
||||||
|
|
||||||
LOG.d("getting a smtp connection takes seconds %s", time.time() - start)
|
elapsed = time.time() - start
|
||||||
|
LOG.d("getting a smtp connection takes seconds %s", elapsed)
|
||||||
|
newrelic.agent.record_custom_metric("Custom/smtp_connection_time", elapsed)
|
||||||
|
|
||||||
# smtp.send_message has UnicodeEncodeError
|
# smtp.send_message has UnicodeEncodeError
|
||||||
# encode message raw directly instead
|
# encode message raw directly instead
|
||||||
|
Loading…
Reference in New Issue
Block a user