-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/sentry in gateway and workers (#207)
* chore: add sentry to workers * chore: added sentry to gateway
- Loading branch information
Showing
23 changed files
with
164 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { env } from '@latitude-data/env' | ||
import * as Sentry from '@sentry/node' | ||
|
||
Sentry.init({ | ||
dsn: env.SENTRY_DSN, | ||
|
||
tracesSampleRate: 1.0, | ||
}) | ||
|
||
export const captureException = (error: Error) => { | ||
if (env.NODE_ENV === 'production') { | ||
Sentry.captureException(error) | ||
} else { | ||
console.error(error) | ||
} | ||
} | ||
|
||
export const captureMessage = (message: string) => { | ||
if (env.NODE_ENV === 'production') { | ||
Sentry.captureMessage(message) | ||
} else { | ||
console.log(message) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { env } from '@latitude-data/env' | ||
import * as Sentry from '@sentry/node' | ||
|
||
Sentry.init({ | ||
dsn: env.SENTRY_DSN, | ||
|
||
tracesSampleRate: 1.0, | ||
}) | ||
|
||
export const captureException = (error: Error) => { | ||
if (env.NODE_ENV === 'production') { | ||
Sentry.captureException(error) | ||
} else { | ||
console.error(error) | ||
} | ||
} | ||
|
||
export const captureMessage = (message: string) => { | ||
if (env.NODE_ENV === 'production') { | ||
Sentry.captureMessage(message) | ||
} else { | ||
console.log(message) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...rkers/worker-definitions/defaultWorker.ts → ...rkers/worker-definitions/defaultWorker.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { env } from '@latitude-data/env' | ||
import Redis from 'ioredis' | ||
|
||
import { buildRedisConnection } from '../redis' | ||
|
||
let connection: Redis | ||
|
||
export const queues = () => { | ||
if (connection) return connection | ||
|
||
connection = buildRedisConnection({ | ||
host: env.QUEUE_HOST, | ||
port: env.QUEUE_PORT, | ||
password: env.QUEUE_PASSWORD, | ||
enableOfflineQueue: false, | ||
maxRetriesPerRequest: null, | ||
}) | ||
|
||
return connection | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.