mlbiscoc commented on code in PR #3623:
URL: https://github.com/apache/solr/pull/3623#discussion_r2325706010


##########
solr/core/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java:
##########
@@ -1,292 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.handler.admin;
-
-import java.io.StringReader;
-import java.text.NumberFormat;
-import java.util.HashSet;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import org.apache.solr.client.solrj.impl.XMLResponseParser;
-import org.apache.solr.common.SolrException;
-import org.apache.solr.common.SolrException.ErrorCode;
-import org.apache.solr.common.util.ContentStream;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.SimpleOrderedMap;
-import org.apache.solr.common.util.StrUtils;
-import org.apache.solr.core.SolrInfoBean;
-import org.apache.solr.handler.RequestHandlerBase;
-import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.response.JavaBinResponseWriter;
-import org.apache.solr.response.SolrQueryResponse;
-import org.apache.solr.security.AuthorizationContext;
-
-/** A request handler that provides info about all registered SolrInfoMBeans. 
*/
-public class SolrInfoMBeanHandler extends RequestHandlerBase {

Review Comment:
   This handler was being used to populate the admin UI "Plugins / Stats" tab 
on a core and its metrics. I did not like the idea of this tightly coupled with 
metric registries and another endpoint creating additional ways to get these 
metrics. I think there should only be one endpoint to get metrics which is 
`/admin/metrics` and create other formats there instead of making multiple 
handlers and endpoints to get metrics in different ways. If that is the case, 
implement and create a custom `OTEL metric reader` for `SolrMetricManager` to 
keep thing loosely coupled. Also the structure of this handler doesn't fit OTEL 
or prometheus with attributes/labels.



##########
solr/webapp/web/js/angular/controllers/plugins.js:
##########


Review Comment:
   I liked the structure it came out to in the screenshot categorized by the 
`category` label with tabs of the prometheus metric -> labels and values. I am 
not good with javascript and frontend but I tried my best but tbh an LLM helped 
me clean up a lot of code and the styling in `plugins.css` after I did my 
initial write as I don't know best practices. Maybe @malliaridis you know more 
about this or if all the changes here make no sense? On another note for the 
new UI, I do not think we should follow this structure anymore going forward if 
we want to show metrics on the UI.



##########
solr/core/src/java/org/apache/solr/handler/admin/PluginInfoHandler.java:
##########
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.handler.admin;
-
-import static org.apache.solr.common.params.CommonParams.NAME;
-
-import java.util.Map;
-import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.common.util.SimpleOrderedMap;
-import org.apache.solr.core.SolrCore;
-import org.apache.solr.core.SolrInfoBean;
-import org.apache.solr.handler.RequestHandlerBase;
-import org.apache.solr.request.SolrQueryRequest;
-import org.apache.solr.response.SolrQueryResponse;
-import org.apache.solr.security.AuthorizationContext;
-
-/**
- * @since solr 1.2
- */
-public class PluginInfoHandler extends RequestHandlerBase {

Review Comment:
   This API was nearly identical to the output of `SolrInfoMBeanHandler` even 
with the `stats` parameter. The `SolrInfoMBeanHandler` had some additional 
functionality though that gave it more options. I ended up deleting this 
handler as well but I am not sure if this is being used and for what? Its 
debatable if this should be removed. Maybe bring it back and remove the `stats` 
parameter? There were tests using this handler as a way to assert metrics which 
felt wrong. if someone feels strong this should come back or be changed in some 
other way, happy to discuss how it should change.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to