Skip to content

Commit

Permalink
chore: add target name (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko committed Apr 5, 2023
1 parent 34a7be7 commit 563c9dc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 20 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@ethersproject/contracts": "^5.4.0",
"@ethersproject/providers": "^5.4.2",
"@ethersproject/units": "^5.4.0",
"@lido-nestjs/execution": "^1.8.1",
"@lido-nestjs/execution": "^1.9.0",
"@lido-nestjs/logger": "^1.2.0",
"@lido-nestjs/registry": "^1.4.1",
"@mikro-orm/core": "^5.3.1",
Expand Down Expand Up @@ -119,4 +119,4 @@
"coverageDirectory": "../coverage",
"testEnvironment": "node"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,26 @@ import { ExecutionProviderService } from './execution-provider.service';
urls: configService.get('EL_RPC_URLS') as NonEmptyArray<string>,
network: configService.get('ETH_NETWORK'),
fetchMiddlewares: [
// todo: metrics middleware with request name and rpc url
async (next) => {
async (next, ctx) => {
const targetName = new URL(ctx.provider.connection.url).hostname;
const reqName = 'batch';
const stop = prometheusService.outgoingELRequestsDuration.startTimer({
name: next.name,
target: next.name,
name: reqName,
target: targetName,
});
return await next()
.then((r: any) => {
prometheusService.outgoingELRequestsCount.inc({
name: next.name,
target: next.name,
name: reqName,
target: targetName,
status: RequestStatus.COMPLETE,
});
return r;
})
.catch((e: any) => {
prometheusService.outgoingELRequestsCount.inc({
name: next.name,
target: next.name,
name: reqName,
target: targetName,
status: RequestStatus.ERROR,
});
throw e;
Expand Down
34 changes: 24 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1106,10 +1106,10 @@
resolved "https://registry.yarnpkg.com/@lido-nestjs/decorators/-/decorators-1.0.0.tgz#def4d0192b032c0d522de1b9bf38d1bec3c63077"
integrity sha512-6k2eeLV7tFjKiqk26LWZHWfLowVuUbKC6+NunHHZIqEtO4xRWeOwMg6ntm0AEMdZ0WL0F6KDrFV+g7bhWB4cWA==

"@lido-nestjs/execution@^1.8.1":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@lido-nestjs/execution/-/execution-1.8.2.tgz#2fbd7dbf9019f140edfa17f628519c5f75208799"
integrity sha512-/uW+0Ho1adxuC7l2eg81e65717SPBykzW2weArHv2yY2izq9kmJ4qAnj75m/pJYSmIImNuSjnr8s8ZwIKPQ0xw==
"@lido-nestjs/execution@^1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@lido-nestjs/execution/-/execution-1.9.0.tgz#73dd0454227e74f2421c7e39b180b5730c1c19b7"
integrity sha512-Tm0rca67miBFMoTu6dUg/kDbjK1z8VKcBBMEWTEjEYnXM7KsmaLZljCRW6KVYK372CsVuDNYajx1z2xBparb/Q==
dependencies:
"@ethersproject/bignumber" "^5.5.0"
"@ethersproject/bytes" "^5.5.0"
Expand All @@ -1118,8 +1118,8 @@
"@ethersproject/properties" "^5.5.0"
"@ethersproject/providers" "^5.5.3"
"@ethersproject/web" "^5.5.1"
"@lido-nestjs/logger" "1.2.1"
"@lido-nestjs/middleware" "1.1.1"
"@lido-nestjs/logger" "1.3.0"
"@lido-nestjs/middleware" "1.2.0"

"@lido-nestjs/logger@1.2.1":
version "1.2.1"
Expand All @@ -1129,6 +1129,15 @@
nest-winston "^1.6.2"
winston "^3.4.0"

"@lido-nestjs/logger@1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@lido-nestjs/logger/-/logger-1.3.0.tgz#ac7607cc4f42acf41794f0c6677e518dce076430"
integrity sha512-vU43NfeR2aT1vQznF34SbfObB+pLY9XmIIEYC8NmvHpnvcklv8bcwbc1QpYOgOT3vHoEL8CDhTP6gwI0yYna9w==
dependencies:
nest-winston "^1.6.2"
traverse "^0.6.7"
winston "^3.4.0"

"@lido-nestjs/logger@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@lido-nestjs/logger/-/logger-1.2.0.tgz#da0b573603e1f25b86a168c1d9970b49be16d214"
Expand All @@ -1137,10 +1146,10 @@
nest-winston "^1.6.2"
winston "^3.4.0"

"@lido-nestjs/middleware@1.1.1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@lido-nestjs/middleware/-/middleware-1.1.1.tgz#ffe6cb343f5e81282b70f8746879f3cf506ac3d5"
integrity sha512-0y9e7ydM3NkAhoiiv/tSsBu8KLbvPJ19QPRiAYBy33y8Fv5PPjypA3qAG03ImBQ3qFXAp29ZUrSs18vkACf8Ng==
"@lido-nestjs/middleware@1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@lido-nestjs/middleware/-/middleware-1.2.0.tgz#0e64b69149ef1f7e4594896fd08d6e0bd9ef5382"
integrity sha512-0rkXWKXEKJPRbq1W6cN+yelhc+CruqhUqmdkNKwl4vTk631fpG9yfSfxxQFDAs3LhsTORqqgKUBpdK+epRYjIQ==

"@lido-nestjs/registry@^1.4.1":
version "1.4.1"
Expand Down Expand Up @@ -6824,6 +6833,11 @@ tr46@~0.0.3:
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==

traverse@^0.6.7:
version "0.6.7"
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.7.tgz#46961cd2d57dd8706c36664acde06a248f1173fe"
integrity sha512-/y956gpUo9ZNCb99YjxG7OaslxZWHfCHAUUfshwqOXmxUIvqLjVO581BT+gM59+QV9tFe6/CGG53tsA1Y7RSdg==

tree-kill@1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
Expand Down

0 comments on commit 563c9dc

Please sign in to comment.