-
Notifications
You must be signed in to change notification settings - Fork 103
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 TOML configuration file support #1238
base: main
Are you sure you want to change the base?
Conversation
e3cad69
to
5819561
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.
Approving from my end, waiting on @hmstepanek to approve as well before merging.
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.
There are a couple more complicated settings that we have that I don't think are currently compatible with this parser. I went through our core config and looked for some others that are more complex like this. transaction_segment_terms
is even more complex than the example below that I've noted and looks like:
transaction_segment_terms = [
{
prefix = "WebTransaction/Custom",
terms = ["one", "two", "three"]
},
{
prefix = "WebTransaction/Uri",
terms = ["seven", "eight", "nine"]
}
]
Layout is: [tool.newrelic] app_name = "app name" Keys with . in them are expanded to be subkeys: [tool.newrelic.browser_monitoring] enabled = true Anything that is a list in the layout is made into a string joined with a single space. import-hook: is translated as such: [tool.newrelic.import-hook.module_name] "sub.sub" = ["item1", "item2"] error_collector.ignore_errors: [tool.newrelic.error_collector] ignore_errors = ["module.name:ClassName", "module.name:ClassName2"] Environment use the tool.newrelic.env namespace: [tool.newrelic.env.production] app_name = "production name"
That also appears to be one that is processed separately like url_rules and not taken from the configuration. |
Yes all 4 of these settings are not possible to configure with a config file.
|
Overview
This adds support for reading configuration from a TOML file such as
pyproject.toml
to reduce clutter.Layout is:
Keys with . in them are expanded to be subkeys:
Anything that is a list in the layout is made into a string joined with a single space.
import-hook:...
is translated as such and requires quotes in the keys:error_collector.ignore_errors
:Environments use the
tool.newrelic.env
namespace:Expansion of the subkeys includes doing so in an environment section:
Related Github Issue
#1229
Testing
Tests have been added.