chore: Centralize env parsing, validation, defaults, and deprecation notices (#3487)
* chore: Centralize env parsing, defaults, deprecation * wip * test * test * tsc * docs, more validation * fix: Allow empty REDIS_URL (defaults to localhost) * test * fix: SLACK_MESSAGE_ACTIONS not bool * fix: Add SMTP port validation
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { init, tracer, addTags, markAsError } from "@theo.gravity/datadog-apm";
|
||||
import env from "@server/env";
|
||||
|
||||
export * as APM from "@theo.gravity/datadog-apm";
|
||||
|
||||
// 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) {
|
||||
if (env.DD_API_KEY) {
|
||||
init(
|
||||
{
|
||||
// SOURCE_COMMIT is used by Docker Hub
|
||||
@@ -13,7 +14,7 @@ if (process.env.DD_API_KEY) {
|
||||
service: process.env.DD_SERVICE || "outline",
|
||||
},
|
||||
{
|
||||
useMock: process.env.NODE_ENV === "test",
|
||||
useMock: env.ENVIRONMENT === "test",
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user