4.x Make RegistryFactory
and its getInstance
and getRegistry
methods public
#8175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Resolves #8161
In 3.x, the
RegistryFactory
class was public in the metrics API module and usable from both SE and MP. It had public methodsgetInstance()
andgetRegistry()
and was injectable.In 4.x, we moved it to MP because it no longer applied in SE with the new neutral metrics API. At that time, I also made the class package-private because
RegistryFactory
only had a role in MP metrics now, and I anticipated that users would@Inject MetricRegistry
rather than work with theRegistryFactory
.The 4.x doc still referred to
RegistryFactory
and, in fact, it is still a valid use case to either@Inject
theRegistryFactory
or retrieve it programmatically using a static method so as to invoke itsgetRegistry
method to locate aMetricRegistry
programmatically. As we found out in our internal Slack channel, users had used these approaches in 3.x and we broke their code by removing this capability.Restoring these features, essentially to how they worked in 3.x, enlarges our surface area only very slightly as compared to 4.0.1 and allows existing user code to continue to work with only a change in
import
statements (becauseRegistryFactory
is in a different package in 4.x).This PR does the following:
RegistryFactory
and itsgetInstance()
andgetRegistry(String)
methods public.getRegistry
fromRegistry
(a package-private class) toMetricRegistry
(an MP metrics interface whichRegistry
implements).registry(String)
toRegistryFactory
which returns aRegistry
for use by our own methods in the package.RegistryFactory
instance.Documentation
Changes included in the PR.