HDDS-6168. Add config to disable registering S3 Gateway metrics#9771
HDDS-6168. Add config to disable registering S3 Gateway metrics#9771vyalamar wants to merge 7 commits intoapache:masterfrom
Conversation
|
@adoroszlai, @ivanzlenko, and @Russole pls help review. |
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @vyalamar for the patch.
| if (!conf.getBoolean(S3GatewayConfigKeys.OZONE_S3G_METRICS_ENABLED, | ||
| S3GatewayConfigKeys.OZONE_S3G_METRICS_ENABLED_DEFAULT)) { |
There was a problem hiding this comment.
Let's cache the result in a static Boolean variable.
if (metricsEnabled == null) {
metricsEnabled = conf.getBoolean(...);
}
if (!metricsEnabled) {
return null;
}There was a problem hiding this comment.
isn't it supposed to be called once? in this case there is no need for a cache.
4f0b098 to
3c7b2b4
Compare
3c7b2b4 to
c2e8389
Compare
c2e8389 to
0eb6f79
Compare
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @vyalamar for updating the patch.
|
@adoroszlai updated. |
| instance = ms.register(SOURCE_NAME, "S3 Gateway Metrics", instance); | ||
| } else { | ||
| // Initialize annotated metrics fields without publishing the source. | ||
| MetricsAnnotations.makeSource(instance); |
There was a problem hiding this comment.
would it produce non-null instance after this call?
|
@adoroszlai sure, let me go to older version of the code and try to reproduce? |
|
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days. |
|
Thank you for your contribution. This PR is being closed due to inactivity. Please contact a maintainer if you would like to reopen it. |
Summary
Testing