-
Notifications
You must be signed in to change notification settings - Fork 375
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
Implement global configuration using configuration API #714
Conversation
8fa4a8b
to
f8b69bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 🔥 🔥
Nice, a lot of this looks like shuffling around existing classes? Looks that way, but not sure why the diff didn't pick them up as a file name?
@brettlangdon Yeah, exactly. There's a lot of shuffling, and a few classes/modules had their responsibilities split and redistributed elsewhere: e.g. If there aren't any referential errors after this refactor (e.g. if I missed a constant name on a code path or something like that), then the only other risk posed by this re-shuffle would be if someone referenced these constant names directly elsewhere, which I think is low probability and out of scope of what's supported in our public API. I will test this locally a bit more, make sure everything seems sane still. |
f8b69bb
to
5f20991
Compare
5f20991
to
c28ce31
Compare
To allow for better management of configuration options, this pull request implements global configuration options as a configuration object accessible via
Datadog.configuration
.The configuration API remains backwards compatible, meaning
Datadog.configure { |c| c.tracer options }
and other configuration paradigms will continue to function. However, it provides a base for new options to be defined (or extracted from elsewhere). For example the following option could be defined inDatadog::Configuration::Settings
:Then it can be set using:
Or accessed using via
Datadog.configuration.debug
.(Note this is just an example:
debug
option has not yet been defined this way.)While implementing this feature, this pull request does a few ambitious things:
Configuration::Proxy
,Contrib::Base
, etc.)Options
) toDatadog::Configuration
fromContrib
Contrib
(e.g.Registry
) and theContrib::Extensions
module.Datadog::Configuration
withDatadog::Configuration::Settings
, which implements options just like integrations do.