Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Revamp config loading and support datadog.yaml #359

Merged
merged 11 commits into from
Feb 12, 2018
Merged

Conversation

LotharSee
Copy link

@LotharSee LotharSee commented Feb 11, 2018

Built on top of rebase of #357 this PRs supersedes it.

Exhaustive changes:

From #357:

  • support documentation from datadog.yaml
    • support reading from this yaml file and its main attributes, introducing Yaml config structs
    • add apm fields to it under apm_config
    • support multiple config sources, merging them together

Added on top:

  • clean glide files
  • clean the code, refactor the different configuration sources into different merge options
  • remove dead options: APIPayloadBufferMaxSize
  • comment which config options are not documented (they are likely to get removed in future versions)
  • remove agent/trace-agent.ini and clean config/README.md. Now we should only refer to the A5 and A6 example configs.
  • deprecate -ddconfig making -config the only supported way of configuring the Agent. -ddconfig is kept for a bit before getting fully removed.
  • simplify Proxy configuration, support the one provided from A6.
  • improve coverage and clean (using external files) our config tests

@LotharSee LotharSee changed the title Benjamin/agent6 Revamp config loading and support datadog.yaml Feb 11, 2018
Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just a note regarding logging - feel free to ignore. 💯

agent/main.go Outdated
// deprecated Agent 5 trace-agent.ini config
var legacyConf *config.File

if filepath.Ext(opts.configFile) == ".conf" {
Copy link
Member

Choose a reason for hiding this comment

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

To make the precedence clear, I would probably log a line regarding what config got loaded.

Copy link
Author

Choose a reason for hiding this comment

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

Good one, updated with more logging.

Copy link

@AlexJF AlexJF left a comment

Choose a reason for hiding this comment

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

Love it. Just highlighting that some changes around the ini configs will require changes in other repos.

}

// [trace.writer.*] sections
// undocumented, should they stay all internal?
Copy link

Choose a reason for hiding this comment

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

Yeah we can keep most of them internal/hidden. Only one that has to be documented imo is the trace.writer.traces.queue_max_bytes and explain the tradeoff involved: more memory => more traces saved in case of problems but more system impact.

Copy link
Author

Choose a reason for hiding this comment

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

yup, keeping them here for now for our testing, will remove it in later versions.

return c
}

// TODO: maybe this is too many options exposed?
Copy link

Choose a reason for hiding this comment

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

Right. Kept them around until we did some experimentation with the new retry scenario. Aaditya's experiments seem to suggest it's working nicely so we could remove them. Although as long as we keep them internal, they don't really affect usability and will allow us to provide an easy hotfix if we ever detect a problem here.

Copy link
Author

Choose a reason for hiding this comment

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

yup, keeping them here for now for our testing, will remove it in later versions.

flag.StringVar(&opts.configFile, "config", "/etc/datadog/trace-agent.ini", "Trace agent ini config file.")
// TODO: load from the .yaml automatically if there
flag.StringVar(&opts.configFile, "config", "/etc/dd-agent/datadog.conf", "Datadog Agent config file location")
flag.StringVar(&opts.legacyConfigFile, "ddconfig", "/etc/dd-agent/trace-agent.ini", "Deprecated extra configuration option.")
Copy link

Choose a reason for hiding this comment

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

This requires changes here:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants