Skip to content

Commit 6991813

Browse files
authored
fix: use DD_ENV for PinoLogger environment field (#152)
Prefer DD_ENV (set by Terraform per environment) over NODE_ENV which is always "production" in all deployed environments, causing logs to show the wrong environment in Datadog.
1 parent 4c4b989 commit 6991813

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

platform/wab/src/wab/server/observability/PinoLogger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { context, trace } from "@opentelemetry/api";
77
import pino, { Logger as PinoLog } from "pino";
88

99
const SERVICE_NAME = process.env.OTEL_SERVICE_NAME || "unknown-service";
10-
const ENVIRONMENT = process.env.NODE_ENV || "development";
10+
const ENVIRONMENT = process.env.DD_ENV || process.env.NODE_ENV || "development";
1111
const POD_NAME = process.env.HOSTNAME || "";
1212
const PINO_LOGGER_LEVEL = process.env.PINO_LOGGER_LEVEL || "debug";
1313

0 commit comments

Comments
 (0)