From a2f06b72b4617d59248a135e2c9ff029823053a0 Mon Sep 17 00:00:00 2001 From: "Siyu Jiang (See-You John)" <91580504+jsy1218@users.noreply.github.com> Date: Mon, 15 Jul 2024 11:25:37 -0700 Subject: [PATCH] seperate quicknode geth vs. reth metrics via different provider naming (#781) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want to differentiate the latency metrics between quicknode geth vs reth. We do so by differentiating the provider name, based on part of the url, which is a substring of the domain name: ![Screenshot 2024-07-15 at 8.03.13 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/BB54fKe6Y10GvrrdKXQN/5b88cd52-a7ad-43e3-96da-fde2abb2aaa0.png) --- lib/handlers/evm/provider/ProviderName.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/handlers/evm/provider/ProviderName.ts b/lib/handlers/evm/provider/ProviderName.ts index 7b6fd93eca..bfcf7614ed 100644 --- a/lib/handlers/evm/provider/ProviderName.ts +++ b/lib/handlers/evm/provider/ProviderName.ts @@ -1,6 +1,8 @@ export enum ProviderName { INFURA = 'INFURA', QUIKNODE = 'QUIKNODE', // quicknode doesn't have letter c in the RPC endpoint + QUIKNODE_GETH = 'QUIKNODE_GETH', + QUIKNODE_RETH = 'QUIKNODE_RETH', FORNO = 'FORNO', ALCHEMY = 'ALCHEMY', NIRVANA = 'NIRVANA', @@ -10,7 +12,17 @@ export enum ProviderName { export function deriveProviderName(url: string): ProviderName { for (const name in ProviderName) { if (url.toUpperCase().includes(name)) { - return ProviderName[name as keyof typeof ProviderName] + if (url.toUpperCase().includes(ProviderName.QUIKNODE)) { + if (url.toLowerCase().includes('solitary')) { + return ProviderName.QUIKNODE_GETH + } else if (url.toLowerCase().includes('ancient')) { + return ProviderName.QUIKNODE_RETH + } else { + return ProviderName.QUIKNODE + } + } else { + return ProviderName[name as keyof typeof ProviderName] + } } }