[ 
https://issues.apache.org/jira/browse/SOLR-18455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mikhail Khludnev updated SOLR-18455:
------------------------------------
    Priority: Minor  (was: Major)

> <metrics enabled=false> is too shallow
> --------------------------------------
>
>                 Key: SOLR-18455
>                 URL: https://issues.apache.org/jira/browse/SOLR-18455
>             Project: Solr
>          Issue Type: Bug
>          Components: metrics
>    Affects Versions: 10.0, main(11.0)
>         Environment: - Solr 11.0.0-SNAPSHOT (`solr-11.0.0-SNAPSHOT-slim`)
> - OpenJDK 21.0.12+8, `-Xmx2g -XX:+UseG1GC`
> - 3 cores, sustained indexing with frequent commits
>            Reporter: Mikhail Khludnev
>            Priority: Minor
>              Labels: pull-request-available
>
> h2. No way to disable it
> {{<metrics enabled="false"/>}} in {{solr.xml}} does *not* stop this. That 
> flag only short-circuits the suppliers and reporters:
> {code:java}
> // SolrXmlConfig.java:681-688
> private static MetricsConfig getMetricsConfig(ConfigNode metrics) {
>   MetricsConfig.MetricsConfigBuilder builder = new 
> MetricsConfig.MetricsConfigBuilder();
>   boolean enabled = metrics.boolAttr("enabled", true);
>   builder.setEnabled(enabled);
>   if (!enabled) {
>     log.info("Metrics collection is disabled.");
>     return builder.build();
>   }
> {code}
> and the only consumer of the resulting config is the reporter list:
> {code:java}
> // CoreContainer.java:913
> PluginInfo[] metricReporters = cfg.getMetricsConfig().getMetricReporters();
> {code}
> The registration path never consults the flag -- {{SolrMetricManager}} 
> contains no reference to it at all, and goes straight to the meter:
> {code:java}
> // SolrMetricManager.java
> public ObservableLongGauge observableLongGauge(
>     String registry, String gaugeName, String description,
>     Consumer<ObservableLongMeasurement> callback, OtelUnit unit) {
>   return longGaugeBuilder(registry, gaugeName, description, 
> unit).buildWithCallback(callback);
> }
> {code}
> This was confirmed empirically: *the histograms above are from a run with 
> {{<metrics enabled="false"/>}} applied.* Reporting was off; the instruments 
> were still built and still leaked at +623 searchers per ten minutes.
> So an affected node has no configuration escape -- only reducing its commit 
> rate, which slows the leak proportionally without stopping it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to