[GitHub] [lucene-solr] sigram commented on a change in pull request #825: SOLR-13677 All Metrics Gauges should be unregistered by the objects that registered them

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [lucene-solr] sigram commented on a change in pull request #825: SOLR-13677 All Metrics Gauges should be unregistered by the objects that registered them

GitBox
sigram commented on a change in pull request #825: SOLR-13677 All Metrics Gauges should be unregistered by the objects that registered them
URL: https://github.com/apache/lucene-solr/pull/825#discussion_r313737953
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java
 ##########
 @@ -145,8 +145,14 @@ public void init(NamedList args) {
 
   }
 
+  protected MetricsInfo metricsInfo;
+
+
   @Override
   public void initializeMetrics(SolrMetricManager manager, String registryName, String tag, final String scope) {
+    metricsInfo = new MetricsInfo(manager, registryName, getUniqueMetricTag(tag)) ;
+    tag = metricsInfo.getTag();
 
 Review comment:
   We can change it in 9.0 - how about this for 8x, in `SolrMetricProducer`:
   ```
   default void initializeMetrics(MetricsInfo info, scope) {
     initializeMetrics(info.manager, info.registry, info.tag, scope);
   }
   ```
   Then we can change the components that we know about to use the new API (and create the tags not in the component itself but in the parent), and still preserve back-compat for third-party components.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]