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

Disable decorators via config #1152

Merged
merged 1 commit into from
Dec 20, 2019
Merged

Conversation

randomanderson
Copy link
Contributor

@randomanderson randomanderson commented Dec 19, 2019

Adds the ability to disable individual decorators with config.

ex: -Ddd.trace.status404decorator.enabled=false
Note: system properties are case sensitive, and we do a toLowerCase, so the system property should also be all lowercase.

Closes #1143

@@ -596,6 +596,10 @@ public boolean isJmxFetchIntegrationEnabled(
return jmxFetchIntegrationEnabled(integrationNames, defaultEnabled);
}

public boolean isDecoratorEnabled(final String name) {
return getBooleanSettingFromEnvironment("trace." + name.toLowerCase() + ".enabled", true);
Copy link
Contributor

Choose a reason for hiding this comment

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

@andrewsouthard1 any objections to this config setting?

Choose a reason for hiding this comment

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

👍

@randomanderson randomanderson merged commit 7920a25 into master Dec 20, 2019
@randomanderson randomanderson deleted the landerson/decorator-flag branch December 20, 2019 16:09
new Status5XXDecorator(),
new URLAsResourceName())) {

if (Config.get().isDecoratorEnabled(decorator.getClass().getSimpleName())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I realize I'm a bit late, but none-the-less...
I think it is better to have a separate name other than the class name for any configuration setting.

Fortunately, It won't be hard for us to make that change in the future.

@tylerbenson
Copy link
Contributor

FYI, system properties are case sensitive, so the property needs to be set as lowercase. I'll update the PR description.

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

Successfully merging this pull request may close these issues.

Add the posibility to customize default decorators
5 participants