Files
outline/server/logging/tracing.ts
2022-03-18 22:15:56 -07:00

22 lines
589 B
TypeScript

import { init, tracer } from "@theo.gravity/datadog-apm";
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) {
init(
{
// SOURCE_COMMIT is used by Docker Hub
// SOURCE_VERSION is used by Heroku
version: process.env.SOURCE_COMMIT || process.env.SOURCE_VERSION,
service: "outline",
},
{
useMock: process.env.NODE_ENV === "test",
}
);
}
export default tracer;