chore: Add optional DD tracer

This commit is contained in:
Tom Moor
2021-02-11 18:58:56 -08:00
parent a1b3cfc7de
commit 2611376b21
3 changed files with 375 additions and 13 deletions

View File

@@ -1,6 +1,12 @@
// @flow
require("dotenv").config({ silent: true });
// If the DataDog agent is installed and the DD_API_KEY environment variable is
// in the environment then we can safely attempt to start the DD tracer
if (process.env.DD_API_KEY) {
require("dd-trace").init();
}
if (
!process.env.SECRET_KEY ||
process.env.SECRET_KEY === "generate_a_new_key"