🪢 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
fix(blob-storage): disable auto container check for Azure buckets for costsavings (#8317)
Steffen Schmitze3f8dc8bb312
diff --git a/.env.dev-azure.example b/.env.dev-azure.exampleindex 6afe864708..fae350ff23 100644--- a/.env.dev-azure.example+++ b/.env.dev-azure.example@@ -68,6 +68,7 @@ LANGFUSE_S3_EVENT_UPLOAD_FORCE_PATH_STYLE=trueLANGFUSE_S3_EVENT_UPLOAD_PREFIX=events/LANGFUSE_USE_AZURE_BLOB=true+LANGFUSE_AZURE_SKIP_CONTAINER_CHECK=false# Set during docker build of application# Used to disable environment verification at build timediff --git a/packages/shared/src/env.ts b/packages/shared/src/env.tsindex 1478b3e869..d6007dc6be 100644--- a/packages/shared/src/env.ts+++ b/packages/shared/src/env.ts@@ -92,6 +92,9 @@ const EnvSchema = z.object({LANGFUSE_S3_MEDIA_UPLOAD_SSE: z.enum(["AES256", "aws:kms"]).optional(),LANGFUSE_S3_MEDIA_UPLOAD_SSE_KMS_KEY_ID: z.string().optional(),LANGFUSE_USE_AZURE_BLOB: z.enum(["true", "false"]).default("false"),+ LANGFUSE_AZURE_SKIP_CONTAINER_CHECK: z+ .enum(["true", "false"])+ .default("true"),LANGFUSE_USE_GOOGLE_CLOUD_STORAGE: z.enum(["true", "false"]).default("false"),LANGFUSE_GOOGLE_CLOUD_STORAGE_CREDENTIALS: z.string().optional(),STRIPE_SECRET_KEY: z.string().optional(),diff --git a/packages/shared/src/server/services/StorageService.ts b/packages/shared/src/server/services/StorageService.tsindex abd4756301..8ef324696e 100644--- a/packages/shared/src/server/services/StorageService.ts+++ b/packages/shared/src/server/services/StorageService.ts@@ -104,6 +104,7 @@ export class StorageServiceFactory {}}+let azureContainersExists: Record<string, boolean> = {};class AzureBlobStorageService implements StorageService {private client: ContainerClient;private container: string;@@ -139,8 +140,18 @@ class AzureBlobStorageService implements StorageService {}private async createContainerIfNotExists(): Promise<void> {+ // Skip container existence check if environment variable is set+ if (env.LANGFUSE_AZURE_SKIP_CONTAINER_CHECK === "true") {+ return;+ }+try {+ if (azureContainersExists[this.container]) {+ return; // Container already exists, no need to create it again+ }await this.client.createIfNotExists();+ azureContainersExists[this.container] = true; // Mark container as created+ logger.info(`Azure Blob Storage container ${this.container} created`);} catch (err) {logger.error(`Failed to create Azure Blob Storage container ${this.container}`,