{"record":{"id":"9c031d51e85e53c8","repo":"BerriAI/litellm","slug":"langfuse-public-key-and-langfuse-secret-key-must-b","errorCode":null,"errorMessage":"LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY must be set for Langfuse OpenTelemetry integration.","messagePattern":"LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY must be set for Langfuse OpenTelemetry integration\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/langfuse/langfuse_otel.py","lineNumber":301,"sourceCode":"        \"\"\"\n        Retrieves the Langfuse OpenTelemetry configuration based on environment variables.\n\n        Environment Variables:\n            LANGFUSE_PUBLIC_KEY: Required. Langfuse public key for authentication.\n            LANGFUSE_SECRET_KEY: Required. Langfuse secret key for authentication.\n            LANGFUSE_HOST: Optional. Custom Langfuse host URL. Defaults to US cloud.\n\n        Returns:\n            OpenTelemetryConfig: A Pydantic model containing Langfuse OTEL configuration.\n\n        Raises:\n            ValueError: If required keys are missing.\n        \"\"\"\n        public_key: Final = os.environ.get(\"LANGFUSE_PUBLIC_KEY\", None)\n        secret_key: Final = os.environ.get(\"LANGFUSE_SECRET_KEY\", None)\n\n        if not public_key or not secret_key:\n            raise ValueError(\n                \"LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY must be set for Langfuse OpenTelemetry integration.\"\n            )\n\n        return LangfuseOtelLogger._build_langfuse_otel_config(\n            public_key=public_key,\n            secret_key=secret_key,\n            langfuse_host=LangfuseOtelLogger._get_langfuse_otel_host(),\n        )\n\n    @staticmethod\n    def _build_langfuse_otel_config(\n        public_key: str, secret_key: str, langfuse_host: str | None\n    ) -> \"OpenTelemetryConfig\":\n        \"\"\"\n        Builds an OTLP HTTP config pointing at the Langfuse OTEL endpoint for the\n        given host (US cloud when no host is provided), authorized with the given keys.\n        \"\"\"\n        if langfuse_host:","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/langfuse/langfuse_otel.py#L283-L319","documentation":"Configuration guard for Langfuse OpenTelemetry: one or both of LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY are absent from the environment, so an OTEL exporter cannot be authenticated and the config builder refuses to return a partial config.","triggerScenarios":"Enabling Langfuse OpenTelemetry export without both required keys set.","commonSituations":"Only one of the two keys exported, or .env not loaded before proxy start.","solutions":["Set LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY environment variables before enabling the Langfuse OpenTelemetry integration."],"exampleFix":"export LANGFUSE_PUBLIC_KEY=pk-lf-... LANGFUSE_SECRET_KEY=sk-lf-...","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}