Skip to content

add support for max_traces_per_second option to datadog.conf#291

Merged
hkaj merged 4 commits into
DataDog:masterfrom
joshuabaird:feature/max_traces_per_second
Mar 15, 2018
Merged

add support for max_traces_per_second option to datadog.conf#291
hkaj merged 4 commits into
DataDog:masterfrom
joshuabaird:feature/max_traces_per_second

Conversation

@joshuabaird

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@xvello xvello left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread entrypoint.sh Outdated


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

Copy link
Copy Markdown
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
Copy Markdown
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