{"record":{"id":"a204e8378e677cea","repo":"BerriAI/litellm","slug":"arize-api-key-not-found-in-environment-variables","errorCode":null,"errorMessage":"ARIZE_API_KEY not found in environment variables","messagePattern":"ARIZE_API_KEY not found in environment variables","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/litellm_core_utils/litellm_logging.py","lineNumber":4560,"sourceCode":"                    return callback\n        elif logging_integration == \"opik\":\n            for callback in _in_memory_loggers:\n                if isinstance(callback, OpikLogger):\n                    return callback\n        elif logging_integration == \"langfuse\":\n            for callback in _in_memory_loggers:\n                if isinstance(callback, LangfusePromptManagement):\n                    return callback\n        elif logging_integration == \"otel\":\n            from litellm.integrations.opentelemetry import OpenTelemetry\n\n            for callback in _in_memory_loggers:\n                # Use exact type check to avoid matching ArizePhoenixLogger (subclass)\n                if type(callback) is OpenTelemetry:\n                    return callback\n        elif logging_integration == \"arize\":\n            if \"ARIZE_API_KEY\" not in os.environ:\n                raise ValueError(\"ARIZE_API_KEY not found in environment variables\")\n            for callback in _in_memory_loggers:\n                if isinstance(callback, ArizeLogger) and callback.callback_name == \"arize\":\n                    return callback\n        elif logging_integration == \"logfire\":\n            if \"LOGFIRE_TOKEN\" not in os.environ:\n                raise ValueError(\"LOGFIRE_TOKEN not found in environment variables\")\n            from litellm.integrations.opentelemetry import OpenTelemetry\n\n            for callback in _in_memory_loggers:\n                # Use exact type check to avoid matching ArizePhoenixLogger (subclass)\n                if type(callback) is OpenTelemetry:\n                    return callback\n\n        elif logging_integration == \"dynamic_rate_limiter\":\n            from litellm.proxy.hooks.dynamic_rate_limiter import (\n                _PROXY_DynamicRateLimitHandler,\n            )\n","sourceCodeStart":4542,"sourceCodeEnd":4578,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/litellm_core_utils/litellm_logging.py#L4542-L4578","documentation":"When the \"arize\" logging integration is initialized, LiteLLM checks that ARIZE_API_KEY exists in os.environ and raises this ValueError at setup time if it is absent. Presence is validated, not the value's correctness - the point is to fail fast instead of letting the Arize OpenTelemetry exporter silently no-op.","triggerScenarios":"Setting litellm.success_callback = [\"arize\"] (or litellm.callbacks / proxy litelly callbacks list containing \"arize\") in a process whose environment does not define ARIZE_API_KEY.","commonSituations":".env file not loaded before litellm config in the entrypoint; proxy container missing the environment entry in docker-compose/helm; CI jobs without the secret; confusion with ARIZE_SPACE_KEY / ARIZE_SPACE_ID (also required by Arize but not covered by this check).","solutions":["Export ARIZE_API_KEY (plus ARIZE_SPACE_KEY and ARIZE_SPACE_ID for your Arize space) in the process that runs litellm","For the proxy, add environment: ARIZE_API_KEY=... to docker-compose/helm values so the container has it at startup","Load dotenv at the very top of the entrypoint (from dotenv import load_dotenv; load_dotenv()) before litellm reads callback settings","Restart/redeploy so callback initialization re-runs with the variable present"],"exampleFix":"# before\nimport litellm\nlitellm.success_callback = [\"arize\"]  # ValueError: ARIZE_API_KEY not found\n\n# after\nimport os\nos.environ[\"ARIZE_API_KEY\"] = \"...\"\nos.environ[\"ARIZE_SPACE_KEY\"] = \"...\"\nos.environ[\"ARIZE_SPACE_ID\"] = \"...\"\nimport litellm\nlitellm.success_callback = [\"arize\"]","handlingStrategy":"validation","validationCode":"import os\n\nmissing = [k for k in (\"ARIZE_API_KEY\", \"ARIZE_SPACE_KEY\", \"ARIZE_SPACE_ID\") if not os.environ.get(k)]\nif missing:\n    raise SystemExit(f\"Missing env vars for arize: {missing}\")\nlitellm.success_callback = [\"arize\"]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Load .env at the entrypoint top before importing/configuring litellm callbacks","Declare observability secrets in docker-compose/helm so containers boot with them","Add a config-validation step at deploy time that fails fast on missing callback env vars"],"tags":["arize","observability","environment-variables","litellm","callbacks"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}