{"record":{"id":"00318ef914e79018","repo":"BerriAI/litellm","slug":"dd-site-is-not-set-set-dd-site-example-site","errorCode":null,"errorMessage":"DD_SITE is not set, set 'DD_SITE=<>', example site = `us5.datadoghq.com`","messagePattern":"DD_SITE is not set, set 'DD_SITE=<>', example site = `us5\\.datadoghq\\.com`","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"litellm/integrations/datadog/datadog_llm_obs.py","lineNumber":117,"sourceCode":"        # When using the Agent, LLM Observability Intake does NOT require the API Key\n        # Reference: https://docs.datadoghq.com/llm_observability/setup/sdk/#agent-setup\n\n        # Use specific port for LLM Obs (Trace Agent) to avoid conflict with Logs Agent (10518)\n        agent_port: Final = os.getenv(\"LITELLM_DD_LLM_OBS_PORT\", \"8126\")\n        self.DD_SITE = \"localhost\"  # Not used for URL construction in agent mode\n        self.intake_url = f\"http://{dd_agent_host}:{agent_port}/api/intake/llm-obs/v1/trace/spans\"\n        verbose_logger.debug(\"DataDogLLMObs: Using DD Agent at %s\", self.intake_url)\n\n    def _configure_dd_direct_api(self):\n        \"\"\"\n        Configure the Datadog logger to send traces directly to the Datadog API.\n        \"\"\"\n        if not self.DD_API_KEY:\n            raise Exception(\"DD_API_KEY is not set, set 'DD_API_KEY=<>'\")\n\n        self.DD_SITE = os.getenv(\"DD_SITE\")\n        if not self.DD_SITE:\n            raise Exception(\"DD_SITE is not set, set 'DD_SITE=<>', example site = `us5.datadoghq.com`\")\n\n        self.intake_url = f\"https://api.{self.DD_SITE}/api/intake/llm-obs/v1/trace/spans\"\n\n    def _get_datadog_llm_obs_params(self) -> dict:\n        \"\"\"\n        Get the datadog_llm_observability_params from litellm.datadog_llm_observability_params\n\n        These are params specific to initializing the DataDogLLMObsLogger e.g. turn_off_message_logging\n        \"\"\"\n        dict_datadog_llm_obs_params: dict = {}\n        if litellm.datadog_llm_observability_params is not None:\n            if isinstance(litellm.datadog_llm_observability_params, DatadogLLMObsInitParams):\n                dict_datadog_llm_obs_params = litellm.datadog_llm_observability_params.model_dump()\n            elif isinstance(litellm.datadog_llm_observability_params, dict):\n                # only allow params that are of DatadogLLMObsInitParams\n                dict_datadog_llm_obs_params = DatadogLLMObsInitParams(\n                    **litellm.datadog_llm_observability_params\n                ).model_dump()","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/datadog/datadog_llm_obs.py#L99-L135","documentation":"Defensive re-check inside _configure_dd_direct_api(): after reading DD_SITE from the environment, an empty/missing value aborts direct-API configuration (message here spells 'site' correctly, unlike the __init__ variant's 'sit'). Like error 344 it uses truthiness, so DD_SITE=\"\" is rejected too. Reachable when _configure_dd_direct_api runs standalone or when the __init__ env check was bypassed (e.g. empty-string value).","triggerScenarios":"DD_SITE exported as an empty string from a templated config; direct invocation of _configure_dd_direct_api in tests; whitespace-only DD_SITE value.","commonSituations":"Helm/k8s templating that renders DD_SITE: \"\" when a value is omitted; CI variables defined but blank; env files with 'DD_SITE=' lines.","solutions":["Set DD_SITE to your region hostname (us5.datadoghq.com, datadoghq.eu, etc.) and verify it is non-empty in the running process","Audit deployment templates so DD_SITE is either fully rendered or the agent-mode variables are used instead","Confirm the value matches the region in your Datadog app URL"],"exampleFix":"# before\n# helm values: datadog: { site: \"{{ .Values.ddSite | default \"\" }}\" } -> DD_SITE=\"\"\n\n# after\n# helm values: datadog: { site: \"us5.datadoghq.com\" } -> DD_SITE=us5.datadoghq.com","handlingStrategy":"validation","validationCode":"import os\n\ndef dd_site_present_and_nonempty() -> bool:\n    return bool((os.getenv(\"DD_SITE\") or \"\").strip())","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Render deployment templates with a real default for DD_SITE, never \"\"","Startup smoke test: construct DataDogLLMObsLogger in a probe before traffic routes to the pod","Keep region configuration next to the key so they're updated together"],"tags":["datadog","llm-obs","env-var","empty-value","region"],"backgroundTag":"missing-env-var","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}