Skip to content

Commit 5212655

Browse files
committed
fix(config): use correct DD_* environment variables
The Datadog SDK requires DD_* environment variables (DD_API_KEY, DD_APP_KEY, DD_SITE) to function correctly. The previous implementation used DATADOG_* variable names which never worked. This fix changes the configuration to use the correct DD_* variable names that the Datadog SDK actually reads and uses. Breaking Change: Users must update their environment variables from DATADOG_* to DD_* naming convention. The old DATADOG_* variables were never functional. Required changes: - DATADOG_API_KEY → DD_API_KEY - DATADOG_APP_KEY → DD_APP_KEY - DATADOG_SITE → DD_SITE (optional, defaults to datadoghq.com)
1 parent 98e6b27 commit 5212655

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

server.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,17 @@ async def app_lifespan(server: FastMCP) -> AsyncIterator[AppContext]:
8181

8282

8383
def _load_config() -> DatadogConfig:
84-
"""Load Datadog configuration from environment"""
85-
api_key = os.getenv("DATADOG_API_KEY")
86-
app_key = os.getenv("DATADOG_APP_KEY")
87-
site = os.getenv("DATADOG_SITE", "datadoghq.com")
88-
84+
"""Load Datadog configuration from environment
85+
86+
Note: Uses DD_* environment variables as required by the Datadog SDK.
87+
"""
88+
api_key = os.getenv("DD_API_KEY")
89+
app_key = os.getenv("DD_APP_KEY")
90+
site = os.getenv("DD_SITE", "datadoghq.com")
91+
8992
if not api_key or not app_key:
90-
raise ValueError("DATADOG_API_KEY and DATADOG_APP_KEY must be set")
91-
93+
raise ValueError("DD_API_KEY and DD_APP_KEY must be set")
94+
9295
return DatadogConfig(api_key=api_key, app_key=app_key, site=site)
9396

9497

0 commit comments

Comments
 (0)