Skip to content

Conversation

@jimmystridh
Copy link

@jimmystridh jimmystridh commented Oct 27, 2025

Summary

Fixes environment variable configuration to use the correct DD_* variable names required by the Datadog SDK.

Problem

The current implementation uses DATADOG_* environment variables (e.g., DATADOG_API_KEY, DATADOG_APP_KEY), but these never worked. The Datadog SDK only recognizes DD_* environment variables.

This means the server was non-functional with the documented variable names.

Solution

Changed the configuration to use the correct DD_* environment variable names that the Datadog SDK actually reads:

  • DD_API_KEY (required)
  • DD_APP_KEY (required)
  • DD_SITE (optional, defaults to datadoghq.com)

Breaking Change

⚠️ Users must update their environment variables:

# OLD (never worked):
export DATADOG_API_KEY=your_api_key
export DATADOG_APP_KEY=your_app_key
export DATADOG_SITE=datadoghq.eu

# NEW (correct):
export DD_API_KEY=your_api_key
export DD_APP_KEY=your_app_key
export DD_SITE=datadoghq.eu

Testing

Tested with DD_* environment variables and confirmed the Datadog API client successfully authenticates and makes API calls.

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)
@jimmystridh jimmystridh force-pushed the feat/env-var-fallback branch from 5b0bf69 to 5212655 Compare October 27, 2025 11:04
@jimmystridh jimmystridh changed the title feat(config): add DD_* env var support with DATADOG_* fallback fix(config): use correct DD_* environment variables Oct 27, 2025
Tests verify that:
- DD_* environment variables work correctly with our config loader
- Default site value works correctly
- Missing keys raise appropriate errors

Most importantly, includes a test of the Datadog SDK itself that proves
DATADOG_* variables were never functional. This confirms the fix addresses
a bug rather than introducing a breaking change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant