{"record":{"id":"6ae22d7c598c2be1","repo":"BerriAI/litellm","slug":"levoai-collector-url-environment-variable-is-requi","errorCode":null,"errorMessage":"LEVOAI_COLLECTOR_URL environment variable is required for Levo integration. Please contact Levo support to get your collector URL.","messagePattern":"LEVOAI_COLLECTOR_URL environment variable is required for Levo integration\\. Please contact Levo support to get your collector URL\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/levo/levo.py","lineNumber":65,"sourceCode":"\n        Raises:\n            ValueError: If required environment variables are missing.\n        \"\"\"\n        # Required environment variables\n        api_key: Final = os.environ.get(\"LEVOAI_API_KEY\", None)\n        org_id: Final = os.environ.get(\"LEVOAI_ORG_ID\", None)\n        workspace_id: Final = os.environ.get(\"LEVOAI_WORKSPACE_ID\", None)\n        collector_url: Final = os.environ.get(\"LEVOAI_COLLECTOR_URL\", None)\n\n        # Validate required env vars\n        if not api_key:\n            raise ValueError(\"LEVOAI_API_KEY environment variable is required for Levo integration.\")\n        if not org_id:\n            raise ValueError(\"LEVOAI_ORG_ID environment variable is required for Levo integration.\")\n        if not workspace_id:\n            raise ValueError(\"LEVOAI_WORKSPACE_ID environment variable is required for Levo integration.\")\n        if not collector_url:\n            raise ValueError(\n                \"LEVOAI_COLLECTOR_URL environment variable is required for Levo integration. \"\n                \"Please contact Levo support to get your collector URL.\"\n            )\n\n        # Use collector URL exactly as provided by the user\n        endpoint: Final = collector_url\n        protocol: Final[Protocol] = \"otlp_http\"\n\n        # Build OTLP headers string\n        # Format: Authorization=Bearer {api_key},x-levo-organization-id={org_id},x-levo-workspace-id={workspace_id}\n        headers_parts: Final = [f\"Authorization=Bearer {api_key}\"]\n        headers_parts.append(f\"x-levo-organization-id={org_id}\")\n        headers_parts.append(f\"x-levo-workspace-id={workspace_id}\")\n\n        otlp_auth_headers: Final = \",\".join(headers_parts)\n\n        return LevoConfig(\n            otlp_auth_headers=otlp_auth_headers,","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/levo/levo.py#L47-L83","documentation":"The Levo integration constructor requires LEVOAI_COLLECTOR_URL and raises ValueError when it is unset or empty. Unlike the other Levo vars, the collector URL is the OTLP HTTP endpoint your telemetry is POSTed to, and it is used exactly as provided (no normalization), which is why the message directs you to Levo support to obtain it. Hitting this error means API key, org ID, and workspace ID have already passed validation.","triggerScenarios":"Enabling the Levo callback when LEVOAI_COLLECTOR_URL is not set in the process environment. This is the most commonly missed var because it is tenant-specific (a dedicated collector hostname) rather than something copyable from a shared account page, and onboarding often delivers it in a support email that gets lost.","commonSituations":"New Levo customers who have API key/org/workspace but were never sent the collector hostname; per-tenant collector URLs not templated into Helm values or docker-compose; the var defined in a base env file but overridden to empty in an overlay; deploying to a new environment (staging to prod) without porting the URL.","solutions":["Contact Levo support (or check your Levo onboarding material) for your dedicated collector URL, then export LEVOAI_COLLECTOR_URL=<https://your-collector-host>","Pass the variable through to the runtime context (docker-compose environment block, Kubernetes secret/env, systemd Environment=) and confirm with printenv inside that context","Provide the URL exactly as given — the code uses it verbatim as the OTLP HTTP endpoint, so do not append paths or trailing slashes unless Levo specifies them","Restart litellm so constructor validation passes"],"exampleFix":"# before\nLEVOAI_API_KEY=lv-****\nLEVOAI_ORG_ID=org-123\nLEVOAI_WORKSPACE_ID=ws-456\n# after\nLEVOAI_API_KEY=lv-****\nLEVOAI_ORG_ID=org-123\nLEVOAI_WORKSPACE_ID=ws-456\nLEVOAI_COLLECTOR_URL=https://collector-abc.levo.ai","handlingStrategy":"validation","validationCode":"import os\n\ncollector = os.environ.get('LEVOAI_COLLECTOR_URL')\nif not collector or not collector.startswith(('http://', 'https://')):\n    raise SystemExit('LEVOAI_COLLECTOR_URL must be set to a valid http(s) collector URL (obtain it from Levo support)')","typeGuard":null,"tryCatchPattern":"try:\n    cb = LevoLogger()\nexcept ValueError as e:\n    raise RuntimeError(f'Levo callback misconfigured: {e}') from e","preventionTips":["Record the collector URL in your secret manager at onboarding time — it cannot be derived from other Levo values","Validate the URL scheme at deploy time; the integration uses it verbatim with no normalization","Parametrize per-environment collector URLs (staging vs prod) in your deployment templates","Add a synthetic telemetry send in a smoke test to confirm the collector URL is reachable"],"tags":["levo","environment-variables","configuration","opentelemetry","collector-url"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}