Skip to content

Commit

Permalink
refactor: ensure DTL Logger is using Sentry for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
snario committed Jun 10, 2021
1 parent fee5943 commit bcf4089
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/data-transport-layer/src/services/main/service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Imports: External */
import { BaseService } from '@eth-optimism/common-ts'
import { BaseService, Logger } from '@eth-optimism/common-ts'
import { LevelUp } from 'levelup'
import level from 'level'

Expand Down
11 changes: 9 additions & 2 deletions packages/data-transport-layer/src/services/server/service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Imports: External */
import { BaseService, Metrics } from '@eth-optimism/common-ts'
import { BaseService, Logger, Metrics } from '@eth-optimism/common-ts'
import express, { Request, Response } from 'express'
import promBundle from 'express-prom-bundle'
import cors from 'cors'
Expand Down Expand Up @@ -125,10 +125,17 @@ export class L1TransportServer extends BaseService<L1TransportServerOptions> {
* Initialize Sentry and related middleware
*/
private _initSentry() {
Sentry.init({
const sentryOptions = {
dsn: this.options.sentryDsn,
release: this.options.release,
environment: this.options.ethNetworkName,
}
this.logger = new Logger({
name: this.name,
sentryOptions,
})
Sentry.init({
...sentryOptions,
integrations: [
new Sentry.Integrations.Http({ tracing: true }),
new Tracing.Integrations.Express({
Expand Down

0 comments on commit bcf4089

Please sign in to comment.