Merge pull request #2916 from Netflix/le_Log_orderurl

Log certificate issuance success and metrics.
This commit is contained in:
csine-nflx 2020-02-17 12:57:00 -08:00 committed by GitHub
commit 9c56d603ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -172,7 +172,7 @@ class AcmeHandler(object):
except (AcmeError, TimeoutError): except (AcmeError, TimeoutError):
sentry.captureException(extra={"order_url": str(order.uri)}) sentry.captureException(extra={"order_url": str(order.uri)})
metrics.send("request_certificate_error", "counter", 1) metrics.send("request_certificate_error", "counter", 1, metric_tags={"uri": order.uri})
current_app.logger.error( current_app.logger.error(
f"Unable to resolve Acme order: {order.uri}", exc_info=True f"Unable to resolve Acme order: {order.uri}", exc_info=True
) )
@ -183,6 +183,11 @@ class AcmeHandler(object):
else: else:
raise raise
metrics.send("request_certificate_success", "counter", 1, metric_tags={"uri": order.uri})
current_app.logger.info(
f"Successfully resolved Acme order: {order.uri}", exc_info=True
)
pem_certificate = OpenSSL.crypto.dump_certificate( pem_certificate = OpenSSL.crypto.dump_certificate(
OpenSSL.crypto.FILETYPE_PEM, OpenSSL.crypto.FILETYPE_PEM,
OpenSSL.crypto.load_certificate( OpenSSL.crypto.load_certificate(