From 7f8e94066507c0d84cc0cc77b0587f6d874e0f96 Mon Sep 17 00:00:00 2001 From: Vitaly Drogan Date: Tue, 12 Nov 2024 14:39:04 +0100 Subject: [PATCH] tweak metrics names --- proxy/metrics.go | 17 ++++++----------- proxy/sharing.go | 1 - 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/proxy/metrics.go b/proxy/metrics.go index 6bc4460..f2ab57f 100644 --- a/proxy/metrics.go +++ b/proxy/metrics.go @@ -9,22 +9,22 @@ import ( var ( archiveEventsProcessedTotalCounter = metrics.NewCounter("orderflow_proxy_archive_events_processed_total") archiveEventsProcessedErrCounter = metrics.NewCounter("orderflow_proxy_archive_events_processed_err") - - archiveEventsRPCErrors = metrics.NewCounter("orderflow_proxy_events_rpc_errors") - archiveEventsRPCSentCounter = metrics.NewCounter("orderflow_proxy_events_rpc_sent") - archiveEventsRPCDuration = metrics.NewSummary("orderflow_proxy_events_rpc_duration_milliseconds") + // number of events sent successfully to orderflow archive. i.e. if we batch 10 events into 1 request this would be increment by 10 + archiveEventsRPCSentCounter = metrics.NewCounter("orderflow_proxy_archive_events_sent_ok") + archiveEventsRPCDuration = metrics.NewSummary("orderflow_proxy_archive_rpc_duration_milliseconds") + archiveEventsRPCErrors = metrics.NewCounter("orderflow_proxy_archive_rpc_errors") confighubErrorsCounter = metrics.NewCounter("orderflow_proxy_confighub_errors") shareQueueInternalErrors = metrics.NewCounter("orderflow_proxy_share_queue_internal_errors") - apiLocalRateLimits = metrics.NewCounter("orderflow_proxy_api_local_rate_limits") + + apiLocalRateLimits = metrics.NewCounter("orderflow_proxy_api_local_rate_limits") ) const ( apiIncomingRequestsByPeer = `orderflow_proxy_api_incoming_requests_by_peer{peer="%s"}` apiDuplicateRequestsByPeer = `orderflow_proxy_api_duplicate_requests_by_peer{peer="%s"}` - shareQueuePeerTotalRequestsLabel = `orderflow_proxy_share_queue_peer_total_requests{peer="%s"}` shareQueuePeerStallingErrorsLabel = `orderflow_proxy_share_queue_peer_stalling_errors{peer="%s"}` shareQueuePeerRPCErrorsLabel = `orderflow_proxy_share_queue_peer_rpc_errors{peer="%s"}` shareQueuePeerRPCDurationLabel = `orderflow_proxy_share_queue_peer_rpc_duration_milliseconds{peer="%s"}` @@ -44,11 +44,6 @@ func incAPILocalRateLimits() { apiLocalRateLimits.Inc() } -func incShareQueueTotalRequests(peer string) { - l := fmt.Sprintf(shareQueuePeerTotalRequestsLabel, peer) - metrics.GetOrCreateCounter(l).Inc() -} - func incShareQueuePeerStallingErrors(peer string) { l := fmt.Sprintf(shareQueuePeerStallingErrorsLabel, peer) metrics.GetOrCreateCounter(l).Inc() diff --git a/proxy/sharing.go b/proxy/sharing.go index da0b6fa..b4adcdf 100644 --- a/proxy/sharing.go +++ b/proxy/sharing.go @@ -165,7 +165,6 @@ func (sq *ShareQueue) proxyRequests(peer *shareQueuePeer, worker int) { logger.Warn("Error returned from target while proxying", slog.Any("error", resp.Error)) incShareQueuePeerRPCErrors(peer.name) } - incShareQueueTotalRequests(peer.name) proxiedRequestCount += 1 logger.Debug("Message proxied") }