Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for max_traces_per_second option to datadog.conf #291

Merged
merged 4 commits into from
Mar 15, 2018

Conversation

joshuabaird
Copy link
Contributor

What does this PR do?

This PR does two things:

  • Uncomments the [trace.sampler] section in the stock datadog.conf
  • Adds the max_traces_per_second configuration option to datadog.conf

This allows a user to configure this value by setting the MAX_TRACES_PER_SECOND environment variable.

Motivation

We are heavy users of APM. We require a higher max_traces_per_second than what the default provides (10).

What inspired you to submit this pull request?

The inability to configure max_traces_per_second via an environment variable.

@joshuabaird
Copy link
Contributor Author

Can someone please take a look at this? Anything that needs to be done before it's approved/merged?

Copy link
Contributor

@xvello xvello left a comment

Choose a reason for hiding this comment

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

hi @joshuabaird ,

Sorry for the delay. The option name is indeed specific enough that prefixing it with trace_sampler is not necessary.
I just have one comment about how you handled the missing trace.sampler section, what do you think?

entrypoint.sh Outdated
@@ -15,6 +15,7 @@ export DD_CONF_SUPERVISOR_SOCKET="/dev/shm/datadog-supervisor.sock"


##### Core config #####
sed -i '/^#.* \[trace.sampler\]/s/^# //' ${DD_ETC_ROOT}/datadog.conf
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of adding the section here, what do you think about patching set_property in config_builder.py to do

if not self.config.has_section(section):
    self.config.add_section(section)

See https://docs.python.org/2/library/configparser.html#ConfigParser.RawConfigParser.add_section

I do think failing in config_builder.py because the section does not exist is a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea - much better than my original hack. Done!

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