Skip to content

Conversation

@ofek
Copy link
Contributor

@ofek ofek commented Jul 28, 2025

The next PR will add usage documentation to the Agent repo's site.

A good way to test would be to

  1. Run dda env qa start to start the linux-container QA environment
  2. Run dda env qa run agent status to confirm it's working
  3. Run dda env qa config find to locate the datadog.yaml file and modify its contents in some way
  4. In the directory that contains the datadog.yaml file (also can open directly in your file manager via the dda env qa config explore command) add an integrations directory with a subdirectory postgres containing a conf.yaml file (or any file ending in .yaml/.yml) with valid contents like:
    instances:
    - name: foo
  5. Run dda env qa config show to confirm your changes appear correct
  6. Run dda env qa config sync to update the configuration used by the Agent
  7. Run dda env qa run agent status to confirm that the postgres integration is now running
  8. Run dda env qa stop -r to stop and remove the QA environment (or the more involved dda env qa stop followed by dda env qa remove)

@ofek ofek requested a review from a team as a code owner July 28, 2025 07:11
@ofek ofek marked this pull request as draft July 28, 2025 12:59
@ofek ofek force-pushed the ofek/qa branch 3 times, most recently from 73cdda0 to deb7722 Compare July 28, 2025 13:05
@ofek ofek marked this pull request as ready for review July 28, 2025 13:17
@ofek ofek force-pushed the ofek/qa branch 2 times, most recently from 3019566 to b8c8b58 Compare August 5, 2025 12:47
@ofek ofek marked this pull request as draft November 3, 2025 20:49
@ofek ofek marked this pull request as ready for review November 4, 2025 04:34
Copy link
Member

@KevinFairise2 KevinFairise2 left a comment

Choose a reason for hiding this comment

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

No big blocker to have it merged as is on my end. Just left some comments to raise few points that we might need to update at some point when we want to support more complex environments.
But that looks great!

return self.state_dir / "agent_config"

@cached_property
def agent_config(self) -> AgentConfig:
Copy link
Member

Choose a reason for hiding this comment

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

I think we will need a way to make the AgentConfig dependent on the Environment.
Depending on the way the agent is installed and the environment it can be quite different than just a datadog.yaml file.
Docker -> Environment variable list
K8s + Helm -> Values.yaml
K8s + operator -> DatadogAgent crd

"""

@abstractmethod
def run_command(self, command: list[str]) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

I do not think that method will make sense on every QA environment. For VM yes, for Docker probably also, this is more complicated with Kubernetes/ECS environment, as running a command is not something explicit, we could decide to run the command in a random pod where the agent is running but that seems a bit too magic.

Comment on lines +167 to +168
env_vars = agent_config_to_env_vars(agent_config)
env_vars.update(self.config.env)
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need that? Shouldn't we just mount the config file that the agent use?
Or just have a AgentConfigTemplate that reflect the way the Agent running in docker should be configured, i.e directly with environment variables? To me it sounds acceptable that when you are running the agent in Docker you configure it the Docker way (through environment variable) instead of doing a mapping of the config file to environment variables on our end.
That will not work that way with Kubernetes based environment where the agent configuration is done with Helm values

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.

3 participants