Skip to content

Commit 73b72cd

Browse files
pfbyjyclaude
andauthored
Standardize environment name from "prod" to "production" (#93)
The backend Logfire env, browser Logfire env, and @vercel/otel deployment.environment all explicitly mapped VERCEL_ENV/MODAL_APP=production to 'prod'. @vercel/otel also auto-injects deployment.environment from VERCEL_ENV, so edge spans ended up tagged both 'prod' and 'production' in Logfire. Standardize on 'production' so every layer agrees and matches Vercel/Logfire's own convention. Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4b388a8 commit 73b72cd

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

backend/observability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _resolve_environment() -> str:
4444

4545
modal_app = os.environ.get("MODAL_APP_NAME", "")
4646
if modal_app == "oddish":
47-
return "prod"
47+
return "production"
4848
if modal_app.startswith("oddish-pr-"):
4949
pr = modal_app.removeprefix("oddish-pr-")
5050
if pr:

frontend/src/instrumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function register() {
2121
const environment = (() => {
2222
const explicit = process.env.LOGFIRE_ENVIRONMENT;
2323
if (explicit) return explicit;
24-
if (process.env.VERCEL_ENV === "production") return "prod";
24+
if (process.env.VERCEL_ENV === "production") return "production";
2525
const pr = process.env.VERCEL_GIT_PULL_REQUEST_ID;
2626
return pr ? `preview-pr-${pr}` : "preview";
2727
})();

frontend/src/lib/observability.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function resolveEnvironment(): string {
3030
// Per-PR bucket so previews don't all share one "preview" env. Keyed off
3131
// `NEXT_PUBLIC_VERCEL_ENV` not `NODE_ENV` — the latter is "production"
3232
// for PR-preview builds too.
33-
if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") return "prod";
33+
if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") return "production";
3434
const pr = process.env.NEXT_PUBLIC_VERCEL_GIT_PULL_REQUEST_ID;
3535
return pr ? `preview-pr-${pr}` : "preview";
3636
}

0 commit comments

Comments
 (0)