From 9b04d901c482d1d8909d7d5d571ddded35235b94 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Thu, 15 Aug 2019 19:14:08 -0700 Subject: [PATCH 1/3] metric for missing certificate from an endpoint --- lemur/sources/service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lemur/sources/service.py b/lemur/sources/service.py index ec988623..b6bdb1be 100644 --- a/lemur/sources/service.py +++ b/lemur/sources/service.py @@ -15,6 +15,7 @@ from lemur.sources.models import Source from lemur.certificates.models import Certificate from lemur.certificates import service as certificate_service from lemur.endpoints import service as endpoint_service +from lemur.extensions import metrics from lemur.destinations import service as destination_service from lemur.certificates.schemas import CertificateUploadInputSchema @@ -94,6 +95,8 @@ def sync_endpoints(source): certificate_name, endpoint["name"] ) ) + metrics.send("endpoint.certificate.not.found", + "counter", 1, metric_tags={"cert": certificate_name, "endpoint": endpoint["name"]}) continue policy = endpoint.pop("policy") From e5e395f0d964d6fa8b43442576ef0b92979f2a96 Mon Sep 17 00:00:00 2001 From: Javier Ramos Date: Tue, 20 Aug 2019 09:29:58 +0200 Subject: [PATCH 2/3] Show number of found items in pager This commit does not involve any additional query as the data is already in API calls' responses --- lemur/static/app/angular/pager.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lemur/static/app/angular/pager.html b/lemur/static/app/angular/pager.html index 3dc8a7d0..d9ee5204 100644 --- a/lemur/static/app/angular/pager.html +++ b/lemur/static/app/angular/pager.html @@ -4,6 +4,9 @@ +
+  Found +
From db91e48395da9273b16405283bfddf20a27ca43b Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Wed, 21 Aug 2019 09:54:18 -0700 Subject: [PATCH 3/3] adding account number for better logging, since the endpoint is not available in Lemur DB --- lemur/sources/service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lemur/sources/service.py b/lemur/sources/service.py index b6bdb1be..d5bd7426 100644 --- a/lemur/sources/service.py +++ b/lemur/sources/service.py @@ -96,7 +96,8 @@ def sync_endpoints(source): ) ) metrics.send("endpoint.certificate.not.found", - "counter", 1, metric_tags={"cert": certificate_name, "endpoint": endpoint["name"]}) + "counter", 1, + metric_tags={"cert": certificate_name, "endpoint": endpoint["name"], "acct": s.get_option("accountNumber", source.options)}) continue policy = endpoint.pop("policy")