🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
build: add new deployment region (#12558)
Steffen Schmitzc6dc19336beb
diff --git a/.claude/skills/backend-dev-guidelines/resources/configuration.md b/.claude/skills/backend-dev-guidelines/resources/configuration.mdindex 75a13ce913..25bb7877d7 100644--- a/.claude/skills/backend-dev-guidelines/resources/configuration.md+++ b/.claude/skills/backend-dev-guidelines/resources/configuration.md@@ -75,7 +75,7 @@ export const env = createEnv({// Client-side variables (exposed to browser)client: {NEXT_PUBLIC_LANGFUSE_CLOUD_REGION: z- .enum(["US", "EU", "STAGING", "DEV", "HIPAA"])+ .enum(["US", "EU", "STAGING", "DEV", "HIPAA", "JP"]).optional(),NEXT_PUBLIC_SIGN_UP_DISABLED: z.enum(["true", "false"]).default("false"),// ... client variables@@ -274,7 +274,7 @@ const licenseKey = env.LANGFUSE_EE_LICENSE_KEY;**Purpose:** Identifies the cloud deployment region for Langfuse Cloud.-**Type:** `"US" | "EU" | "STAGING" | "DEV" | "HIPAA" | undefined`+**Type:** `"US" | "EU" | "STAGING" | "DEV" | "HIPAA" | "JP" | undefined`**Where Used:**@@ -286,11 +286,12 @@ const licenseKey = env.LANGFUSE_EE_LICENSE_KEY;**When Set:**| Environment | Value | Purpose |-| ------------------------ | ---------------------- | ---------------------------------------------- |+|--------------------------|------------------------|------------------------------------------------|| **Developer Laptop** | `"DEV"` or `"STAGING"` | Local development against cloud infrastructure || **Langfuse Cloud US** | `"US"` | Production US region || **Langfuse Cloud EU** | `"EU"` | Production EU region || **Langfuse Cloud HIPAA** | `"HIPAA"` | HIPAA-compliant region |+| **Langfuse Cloud JP** | `"JP"` | Production JP region || **OSS Self-Hosted** | `undefined` (not set) | Self-hosted deployments don't have region |**Use Cases:**diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.ymlindex 70f9766225..7906410e92 100644--- a/.github/workflows/deploy.yml+++ b/.github/workflows/deploy.yml@@ -24,6 +24,7 @@ on:- prod-eu- prod-us- prod-hipaa+ - prod-jprequired: trueconcurrency:@@ -81,7 +82,7 @@ jobs:return `["staging"]`}if (context.ref === "refs/heads/production") {- return `["prod-eu", "prod-us", "prod-hipaa"]`+ return `["prod-eu", "prod-us", "prod-hipaa", "prod-jp"]`}}return "[]"diff --git a/packages/shared/src/server/clickhouse/client.ts b/packages/shared/src/server/clickhouse/client.tsindex e5d2af0c0a..5321385b90 100644--- a/packages/shared/src/server/clickhouse/client.ts+++ b/packages/shared/src/server/clickhouse/client.ts@@ -107,7 +107,7 @@ export class ClickHouseClientManager {const cloudOptions: Record<string, unknown> = {};if (- ["STAGING", "EU", "US", "HIPAA"].includes(+ ["STAGING", "EU", "US", "HIPAA", "JP"].includes(env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION ?? "",)) {diff --git a/packages/shared/src/server/services/email/organizationInvitation/sendMembershipInvitationEmail.ts b/packages/shared/src/server/services/email/organizationInvitation/sendMembershipInvitationEmail.tsindex cdf6119a1d..9b98d5ae29 100644--- a/packages/shared/src/server/services/email/organizationInvitation/sendMembershipInvitationEmail.ts+++ b/packages/shared/src/server/services/email/organizationInvitation/sendMembershipInvitationEmail.ts@@ -10,6 +10,7 @@ const langfuseUrls = {EU: "https://cloud.langfuse.com",STAGING: "https://staging.langfuse.com",HIPAA: "https://hipaa.cloud.langfuse.com",+ JP: "https://jp.cloud.langfuse.com",};type SendMembershipInvitationParams = {@@ -50,6 +51,7 @@ export const sendMembershipInvitationEmail = async ({env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION === "US" ||env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION === "EU" ||env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION === "HIPAA" ||+ env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION === "JP" ||env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION === "STAGING"? langfuseUrls[env.NEXT_PUBLIC_LANGFUSE_CLOUD_REGION]: env.NEXTAUTH_URL;diff --git a/web/src/components/EnvLabel.tsx b/web/src/components/EnvLabel.tsxindex 63bc697d94..b4689f528b 100644--- a/web/src/components/EnvLabel.tsx+++ b/web/src/components/EnvLabel.tsx@@ -23,7 +23,7 @@ export const EnvLabel = ({ className }: { className?: string }) => {)}onClick={() => setIsHidden(true)}>- {region && ["EU", "US", "HIPAA"].includes(region)+ {region && ["EU", "US", "HIPAA", "JP"].includes(region)? `PROD-${region}`: region}</div>diff --git a/web/src/env.mjs b/web/src/env.mjsindex a290b04821..80777fda9f 100644--- a/web/src/env.mjs+++ b/web/src/env.mjs@@ -437,7 +437,7 @@ export const env = createEnv({// NEXT_PUBLIC_CLIENTVAR: z.string().min(1),NEXT_PUBLIC_LANGFUSE_CLOUD_REGION: z- .enum(["US", "EU", "STAGING", "DEV", "HIPAA"])+ .enum(["US", "EU", "STAGING", "DEV", "HIPAA", "JP"]).optional(),NEXT_PUBLIC_DEMO_PROJECT_ID: z.string().optional(),NEXT_PUBLIC_DEMO_ORG_ID: z.string().optional(),diff --git a/web/src/features/auth/components/AuthCloudRegionSwitch.tsx b/web/src/features/auth/components/AuthCloudRegionSwitch.tsxindex 3161d68f58..d23def7399 100644--- a/web/src/features/auth/components/AuthCloudRegionSwitch.tsx+++ b/web/src/features/auth/components/AuthCloudRegionSwitch.tsx@@ -46,6 +46,11 @@ const regions =hostname: "cloud.langfuse.com",flag: "🇪🇺",},+ {+ name: "JP",+ hostname: "jp.cloud.langfuse.com",+ flag: "️🇯🇵",+ },{name: "HIPAA",hostname: "hipaa.cloud.langfuse.com",diff --git a/web/src/features/natural-language-filters/server/router.ts b/web/src/features/natural-language-filters/server/router.tsindex c0ec3537c5..ec20f349bd 100644--- a/web/src/features/natural-language-filters/server/router.ts+++ b/web/src/features/natural-language-filters/server/router.ts@@ -65,6 +65,7 @@ export const naturalLanguageFilterRouter = createTRPCRouter({case "US":case "EU":case "HIPAA":+ case "JP":return "prod";case "STAGING":return "staging";diff --git a/worker/src/env.ts b/worker/src/env.tsindex 39aea33e70..24d78e5697 100644--- a/worker/src/env.ts+++ b/worker/src/env.ts@@ -17,7 +17,7 @@ const EnvSchema = z.object({NEXTAUTH_URL: z.string().optional(),NEXT_PUBLIC_LANGFUSE_CLOUD_REGION: z- .enum(["US", "EU", "STAGING", "DEV", "HIPAA"])+ .enum(["US", "EU", "STAGING", "DEV", "HIPAA", "JP"]).optional(),STRIPE_SECRET_KEY: z.string().optional(),