From 857e47e5398bed41ca0a4fef42ef90189011cb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Mon, 14 Jun 2021 22:00:06 +0300 Subject: [PATCH] Clean up metrics --- pinecrypt/server/api/events.py | 8 ++++---- pinecrypt/server/api/utils/firewall.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pinecrypt/server/api/events.py b/pinecrypt/server/api/events.py index c127540..b054be4 100644 --- a/pinecrypt/server/api/events.py +++ b/pinecrypt/server/api/events.py @@ -11,10 +11,10 @@ from sanic_prometheus import monitor from bson.objectid import ObjectId -streams_opened = Counter("pinecrypt_events_stream_opened", - "Event stream opened count") -events_emitted = Counter("pinecrypt_events_emitted", - "Events emitted count") +streams_opened = Counter("pinecrypt_gateway_streams_started", + "Total number event stream has been opened.") +events_emitted = Counter("pinecrypt_gateway_events_emitted", + "Total number of events emitted via event streams.") app = Sanic("events") diff --git a/pinecrypt/server/api/utils/firewall.py b/pinecrypt/server/api/utils/firewall.py index 2376adc..1cb0d09 100644 --- a/pinecrypt/server/api/utils/firewall.py +++ b/pinecrypt/server/api/utils/firewall.py @@ -16,11 +16,15 @@ from pinecrypt.server.user import User from pinecrypt.server import const, errors, db from prometheus_client import Counter, Histogram -clock_skew = Histogram("pinecrypt_authority_clock_skew", - "Histogram of client-server clock skew", ["method", "path", "passed"], +clock_skew = Histogram( + "pinecrypt_gateway_clock_skew", + "Histogram of client-server clock skew.", + ["method", "path", "passed"], buckets=(0.1, 0.5, 1.0, 5.0, 10.0, 50.0, 100.0, 500.0, 1000.0, 5000.0)) -whitelist_blocked_requests = Counter("pinecrypt_authority_whitelist_blocked_requests", - "Requests blocked by whitelists", ["method", "path"]) +whitelist_blocked_requests = Counter( + "pinecrypt_gateway_whitelist_blocked_requests", + "Requests blocked by whitelists.", + ["method", "path"]) logger = logging.getLogger(__name__)