@@ -76,6 +76,26 @@ default boolean checkBinderEnabledWithDefault(CapabilityEnabled config) {
76
76
return false ;
77
77
}
78
78
79
+ /**
80
+ * Determines if a capability is enabled based on the {@link MicrometerConfig} configurations and the following rules:
81
+ * <p>
82
+ * <ul>
83
+ * <li>
84
+ * The {@link MicrometerConfig#enabled()} has precedence over all configurations, it means that if <code>quarkus.micrometer.enabled</code>
85
+ * is set to <code>false</code>, all metrics are disabled.
86
+ * </li>
87
+ * <li>
88
+ * If the <code>quarkus.micrometer.binder.enable-all</code> is set to <code>true</code>, independently if the
89
+ * parameter <code>aBoolean</code> resolve to <code>true</code> or <code>false</code> the metric will be enabled.
90
+ * </li>
91
+ * <li>
92
+ * If the <code>quarkus.micrometer.binder.enable-all</code> is set to <code>false</code>, the parameter <code>aBoolean</code>
93
+ * will be used to determine if the metric is enabled or not. If <code>aBoolean</code> is empty, the metric will be disabled.
94
+ * </li>
95
+ * </ul>
96
+ * @param aBoolean the optional boolean value to check if the capability is enabled
97
+ * @return <code>true</code> if the capability is enabled, <code>false</code> otherwise.
98
+ */
79
99
default boolean isEnabled (Optional <Boolean > aBoolean ) {
80
100
if (enabled ()) {
81
101
if (this .binder ().enableAll ()) {
@@ -88,6 +108,27 @@ default boolean isEnabled(Optional<Boolean> aBoolean) {
88
108
return false ;
89
109
}
90
110
111
+ /**
112
+ * Determines if a capability is enabled based on the {@link MicrometerConfig} configurations and the following rules:
113
+ * <p>
114
+ * <ul>
115
+ * <li>
116
+ * The {@link MicrometerConfig#enabled()} has precedence over all configurations, it means that if <code>quarkus.micrometer.enabled</code>
117
+ * is set to <code>false</code>, all metrics are disabled.
118
+ * </li>
119
+ * <li>
120
+ * If the <code>quarkus.micrometer.binder.enable-all</code> is set to <code>true</code>, independently if the
121
+ * parameter <code>aBoolean</code> resolve to <code>true</code> or <code>false</code> the metric will be enabled.
122
+ * </li>
123
+ * <li>
124
+ * If the <code>quarkus.micrometer.binder.enable-all</code> is set to <code>false</code>, the parameter <code>config</code>
125
+ * will be used to determine if the metric is enabled or not. If <code>config.enabled()</code> is empty, the
126
+ * {@link MicrometerConfig#binderEnabledDefault()} will be used to determine if the metric is enabled or not.
127
+ * </li>
128
+ * </ul>
129
+ * @param config the {@link CapabilityEnabled} to check if the capability is enabled
130
+ * @return <code>true</code> if the capability is enabled, <code>false</code> otherwise.
131
+ */
91
132
default boolean isEnabled (CapabilityEnabled config ) {
92
133
if (enabled ()) {
93
134
if (this .binder ().enableAll ()) {
0 commit comments