-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
import ddtracer from 'dd-trace'; | ||
import { logger } from 'apps/web/src/utils/logger'; | ||
|
||
const { tracer } = ddtracer; | ||
tracer.init({ | ||
service: process.env.CODEFLOW_PROJECT_NAME, | ||
}); // initialized in a different file to avoid hoisting. | ||
// Enables tracking performance trends across versions. Using commit hash as | ||
// code changes most often result in performance changes (vs deploys). | ||
// | ||
// Codeflow Docs: https://confluence.coinbase-corp.com/pages/viewpage.action?pageId=1172681623 | ||
// Datadog Docs: https://datadoghq.dev/dd-trace-js/ | ||
version: process.env.CODEFLOW_COMMIT_HASH, | ||
profiling: true, | ||
logInjection: true, | ||
startupLogs: true, | ||
logger: { | ||
error: (err) => logger.error(err), | ||
warn: (message) => logger.warn(message), | ||
info: (message) => logger.info(message), | ||
debug: (message) => logger.debug(message), | ||
}, | ||
dogstatsd: { | ||
hostname: '10.166.21.89', | ||
}, | ||
}); | ||
|
||
tracer.use('http', { | ||
service: process.env.CODEFLOW_SERVICE_NAME, | ||
enabled: true, | ||
}); | ||
// export declare const tracer: Tracer; | ||
|
||
export default tracer; |