-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Restore behavior of management.metrics.export.simple.enabled #12106
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
Conversation
| } | ||
|
|
||
| @Override | ||
| public boolean enabled() { |
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.
Having this property at all in SimpleConfig was a mistake. When this is merged, I'll remove it.
| * Enable in-memory metrics that aren't published anywhere (allows you to see | ||
| * what metrics are collected in the metrics actuator endpoint). | ||
| */ | ||
| private boolean enabled; |
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.
The default value here should be true. And we shouldn't have a property at all since it's not used anywhere in the code.
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.
Yep, I guess adding it to additional-spring-configuration-metadata.json accomplishes the same.
| /** | ||
| * Enable publishing to the backend. | ||
| * Enable in-memory metrics that aren't published anywhere (allows you to see | ||
| * what metrics are collected in the metrics actuator endpoint). |
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.
I think that's a bit misleading and we should rephrase that.
* pr/12106: Polish "Restore behavior of management.metrics.export.simple.enabled" Restore behavior of management.metrics.export.simple.enabled
At some point when all the individual implementation configurations were changed to auto-configurations in Boot 2, the conditionalization of the config based on
managament.metrics.export.simple.enabledwas dropped. It existed previously so that users could flip off even in-memory metrics collection, leaving an empty CompositeMeterRegistry that was essentially a NOOP (seeCompositeMeterRegistryPostProcessorTests#registerWhenHasNoMeterRegistryShouldRegisterEmptyComposite).See #12089 (comment)