Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
e6350e2e
Unverified
Commit
e6350e2e
authored
Apr 29, 2021
by
Annie Ke
Committed by
GitHub
Apr 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat[dtl]: add endpoint metrics (#698)
* add prom bundle to measure endpoint metrics * add changeset
parent
0bd11296
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
2 deletions
+29
-2
famous-dragons-eat.md
.changeset/famous-dragons-eat.md
+5
-0
package.json
packages/data-transport-layer/package.json
+2
-1
service.ts
packages/data-transport-layer/src/services/server/service.ts
+8
-0
yarn.lock
yarn.lock
+14
-1
No files found.
.changeset/famous-dragons-eat.md
0 → 100644
View file @
e6350e2e
---
'
@eth-optimism/data-transport-layer'
:
patch
---
add metrics to measure http endpoint latency
packages/data-transport-layer/package.json
View file @
e6350e2e
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
"build"
:
"tsc -p tsconfig.build.json"
"build"
:
"tsc -p tsconfig.build.json"
},
},
"dependencies"
:
{
"dependencies"
:
{
"@eth-optimism/common-ts"
:
"^0.0.1"
,
"@eth-optimism/contracts"
:
"^0.2.8"
,
"@eth-optimism/contracts"
:
"^0.2.8"
,
"@eth-optimism/core-utils"
:
"^0.3.2"
,
"@eth-optimism/core-utils"
:
"^0.3.2"
,
"@eth-optimism/common-ts"
:
"^0.0.1"
,
"@ethersproject/providers"
:
"^5.0.21"
,
"@ethersproject/providers"
:
"^5.0.21"
,
"@sentry/node"
:
"^6.3.1"
,
"@sentry/node"
:
"^6.3.1"
,
"@sentry/tracing"
:
"^6.3.1"
,
"@sentry/tracing"
:
"^6.3.1"
,
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
"dotenv"
:
"^8.2.0"
,
"dotenv"
:
"^8.2.0"
,
"ethers"
:
"^5.0.26"
,
"ethers"
:
"^5.0.26"
,
"express"
:
"^4.17.1"
,
"express"
:
"^4.17.1"
,
"express-prom-bundle"
:
"^6.3.6"
,
"level"
:
"^6.0.1"
,
"level"
:
"^6.0.1"
,
"levelup"
:
"^4.4.0"
,
"levelup"
:
"^4.4.0"
,
"node-fetch"
:
"^2.6.1"
"node-fetch"
:
"^2.6.1"
...
...
packages/data-transport-layer/src/services/server/service.ts
View file @
e6350e2e
/* Imports: External */
/* Imports: External */
import
{
BaseService
}
from
'
@eth-optimism/common-ts
'
import
{
BaseService
}
from
'
@eth-optimism/common-ts
'
import
express
,
{
Request
,
Response
}
from
'
express
'
import
express
,
{
Request
,
Response
}
from
'
express
'
import
promBundle
from
'
express-prom-bundle
'
import
cors
from
'
cors
'
import
cors
from
'
cors
'
import
{
BigNumber
}
from
'
ethers
'
import
{
BigNumber
}
from
'
ethers
'
import
{
JsonRpcProvider
}
from
'
@ethersproject/providers
'
import
{
JsonRpcProvider
}
from
'
@ethersproject/providers
'
...
@@ -105,6 +106,7 @@ export class L1TransportServer extends BaseService<L1TransportServerOptions> {
...
@@ -105,6 +106,7 @@ export class L1TransportServer extends BaseService<L1TransportServerOptions> {
private
_initializeApp
()
{
private
_initializeApp
()
{
// TODO: Maybe pass this in as a parameter instead of creating it here?
// TODO: Maybe pass this in as a parameter instead of creating it here?
this
.
state
.
app
=
express
()
this
.
state
.
app
=
express
()
// Init Sentry options
Sentry
.
init
({
Sentry
.
init
({
dsn
:
this
.
options
.
sentryDsn
,
dsn
:
this
.
options
.
sentryDsn
,
release
:
`data-transport-layer@
${
process
.
env
.
npm_package_version
}
`
,
release
:
`data-transport-layer@
${
process
.
env
.
npm_package_version
}
`
,
...
@@ -118,6 +120,12 @@ export class L1TransportServer extends BaseService<L1TransportServerOptions> {
...
@@ -118,6 +120,12 @@ export class L1TransportServer extends BaseService<L1TransportServerOptions> {
})
})
this
.
state
.
app
.
use
(
Sentry
.
Handlers
.
requestHandler
())
this
.
state
.
app
.
use
(
Sentry
.
Handlers
.
requestHandler
())
this
.
state
.
app
.
use
(
Sentry
.
Handlers
.
tracingHandler
())
this
.
state
.
app
.
use
(
Sentry
.
Handlers
.
tracingHandler
())
// Init metrics
const
metricsMiddleware
=
promBundle
({
includeMethod
:
true
,
includePath
:
true
,
})
this
.
state
.
app
.
use
(
metricsMiddleware
)
this
.
state
.
app
.
use
(
cors
())
this
.
state
.
app
.
use
(
cors
())
this
.
_registerAllRoutes
()
this
.
_registerAllRoutes
()
this
.
state
.
app
.
use
(
Sentry
.
Handlers
.
errorHandler
())
this
.
state
.
app
.
use
(
Sentry
.
Handlers
.
errorHandler
())
...
...
yarn.lock
View file @
e6350e2e
...
@@ -6068,6 +6068,14 @@ expand-template@^2.0.3:
...
@@ -6068,6 +6068,14 @@ expand-template@^2.0.3:
resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==
integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==
express-prom-bundle@^6.3.6:
version "6.3.6"
resolved "https://registry.yarnpkg.com/express-prom-bundle/-/express-prom-bundle-6.3.6.tgz#c8da1c1024edfcc54953c365991aca57ffd0cfda"
integrity sha512-IRsTRCEKCVCHEriQlZ1FuutjEFc89KASsveXh+1HcGEnuZKiAC4LugxrsGEIdySqYvqOYSr2SWHJ6L8/BK2SHA==
dependencies:
on-finished "^2.3.0"
url-value-parser "^2.0.0"
express@^4.14.0, express@^4.17.1:
express@^4.14.0, express@^4.17.1:
version "4.17.1"
version "4.17.1"
resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134"
resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134"
...
@@ -9933,7 +9941,7 @@ oboe@2.1.4:
...
@@ -9933,7 +9941,7 @@ oboe@2.1.4:
ethers "5.0.0"
ethers "5.0.0"
ganache-core "^2.12.1"
ganache-core "^2.12.1"
on-finished@~2.3.0:
on-finished@
^2.3.0, on-finished@
~2.3.0:
version "2.3.0"
version "2.3.0"
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=
integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=
...
@@ -13082,6 +13090,11 @@ url-to-options@^1.0.1:
...
@@ -13082,6 +13090,11 @@ url-to-options@^1.0.1:
resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9"
resolved "https://registry.yarnpkg.com/url-to-options/-/url-to-options-1.0.1.tgz#1505a03a289a48cbd7a434efbaeec5055f5633a9"
integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=
integrity sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=
url-value-parser@^2.0.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/url-value-parser/-/url-value-parser-2.0.3.tgz#cd4b8d6754e458d65e8125260c09718d926e6e21"
integrity sha512-FjIX+Q9lYmDM9uYIGdMYfQW0uLbWVwN2NrL2ayAI7BTOvEwzH+VoDdNquwB9h4dFAx+u6mb0ONLa3sHD5DvyvA==
url@^0.11.0:
url@^0.11.0:
version "0.11.0"
version "0.11.0"
resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment