Skip to content

[PROF-14955] Simplify transport config: API key implies agentless#60

Open
r1viollet wants to merge 1 commit into
mainfrom
r1viollet/auto-agentless
Open

[PROF-14955] Simplify transport config: API key implies agentless#60
r1viollet wants to merge 1 commit into
mainfrom
r1viollet/auto-agentless

Conversation

@r1viollet

@r1viollet r1viollet commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Agentless mode is now derived from DD_API_KEY being set, matching the existing CLI behavior (SetEndpoint). DD_PROFILING_AGENTLESS env var is removed.

Also fixes DD_TRACE_AGENT_UR typo → DD_TRACE_AGENT_URL.

Changes

  • IsAgentless() = !_apiKey.empty() — no more _isAgentLess field
  • DD_PROFILING_AGENTLESS removed
  • If both API key and agent settings are configured, warn and use agentless
  • ValidateTransportConfig() called at config finalization (constructor + InitializeConfiguration)
  • README updated

Testing

  • Built successfully on Windows
  • Existing tests pass
  • New tests added: Agentless_ApiKeyAndSite, Agentless_ApiKeyOnly_DefaultSite, Agent_NoApiKey, ValidateTransport_ConflictingConfig_UsesAgentless
  • Manually tested

Checklist

  • Code follows existing style
  • Documentation updated
  • No breaking changes

@datadog-datadog-prod-us1

This comment has been minimized.

@r1viollet
r1viollet force-pushed the r1viollet/auto-agentless branch from 92be95b to 9e9b5ee Compare June 16, 2026 14:40
@r1viollet
r1viollet marked this pull request as ready for review June 16, 2026 15:06
@r1viollet
r1viollet requested a review from chrisnas as a code owner June 16, 2026 15:06
@r1viollet
r1viollet marked this pull request as draft June 16, 2026 15:06
@r1viollet
r1viollet marked this pull request as ready for review June 16, 2026 15:48
@r1viollet
r1viollet force-pushed the r1viollet/auto-agentless branch 2 times, most recently from 63ff01e to c5cb64a Compare June 17, 2026 07:48
@r1viollet
r1viollet marked this pull request as draft June 17, 2026 07:48
@r1viollet
r1viollet force-pushed the r1viollet/auto-agentless branch 3 times, most recently from ebed291 to ef10ca9 Compare June 17, 2026 07:59
Comment thread src/dd-win-prof/Configuration.cpp
@r1viollet
r1viollet force-pushed the r1viollet/auto-agentless branch 2 times, most recently from e2bfb56 to 44812fd Compare June 17, 2026 09:24
@r1viollet r1viollet changed the title [PROF-14955] Auto-enable agentless mode when DD_API_KEY and DD_SITE are set [PROF-14955] Simplify transport config: API key implies agentless Jun 17, 2026
@r1viollet
r1viollet force-pushed the r1viollet/auto-agentless branch from 44812fd to ab9a55a Compare June 17, 2026 09:26
@r1viollet
r1viollet marked this pull request as ready for review June 17, 2026 09:28
@r1viollet
r1viollet requested a review from chrisnas June 17, 2026 09:38
Comment thread src/dd-win-prof/Configuration.cpp Outdated
@r1viollet
r1viollet force-pushed the r1viollet/auto-agentless branch from ab9a55a to 7771207 Compare June 17, 2026 09:56
Comment thread src/dd-win-prof/Configuration.h Outdated
// Agentless mode is derived: true when an API key is configured.
bool IsAgentless() const;
// Logs a warning if agent and agentless settings conflict.
void ValidateTransportConfig() const;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have a validate config, other fields should be checked.

@r1viollet
r1viollet force-pushed the r1viollet/auto-agentless branch from 7771207 to 857e43f Compare June 17, 2026 10:09
- Remove DD_PROFILING_AGENTLESS env var — agentless is now derived
  from DD_API_KEY being set, same as the CLI path (SetEndpoint).
- Fix DD_TRACE_AGENT_UR typo → DD_TRACE_AGENT_URL.
- Add ValidateTransportConfig: error if both API key (agentless) and
  agent settings (DD_TRACE_AGENT_URL/HOST/PORT) are configured.
- Update README and tests.
@r1viollet
r1viollet force-pushed the r1viollet/auto-agentless branch from 857e43f to 6939d4e Compare June 17, 2026 14:40
@r1viollet
r1viollet requested a review from chrisnas June 17, 2026 15:49
return false;
}

if (!_pConfiguration->ValidateTransportConfig()) {

@chrisnas chrisnas Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should also be called at the end of InitializeConfiguration() so that the error could be detected before starting the profiler in SetupProfiler().

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that calling it here is OK as it is the only common place. Do you think it changes the experience much?

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.

2 participants