dsmiley commented on code in PR #3826:
URL: https://github.com/apache/solr/pull/3826#discussion_r2487828564


##########
solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java:
##########
@@ -852,57 +852,61 @@ public void initializeMetrics(SolrMetricsContext 
parentContext, Attributes attri
 
     ObservableLongMeasurement indexSizeMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_index_size", "Size of the index in bytes", 
OtelUnit.BYTES);
+            "solr_core_replication_index_size",
+            "Size of the index in megabytes",
+            OtelUnit.MEGABYTES);
 
     ObservableLongMeasurement indexVersionMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_index_version", "Current index version");
+            "solr_core_replication_index_version", "Current index version");
 
     ObservableLongMeasurement indexGenerationMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_index_generation", "Current index generation");
+            "solr_core_replication_index_generation", "Current index 
generation");
 
     ObservableLongMeasurement isLeaderMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_is_leader", "Whether this node is a leader (1) 
or not (0)");
+            "solr_core_replication_is_leader", "Whether this node is a leader 
(1) or not (0)");
 
     ObservableLongMeasurement isFollowerMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_is_follower", "Whether this node is a follower 
(1) or not (0)");
+            "solr_core_replication_is_follower", "Whether this node is a 
follower (1) or not (0)");
 
     ObservableLongMeasurement replicationEnabledMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_is_enabled", "Whether replication is enabled (1) 
or not (0)");
+            "solr_core_replication_is_enabled", "Whether replication is 
enabled (1) or not (0)");
 
     ObservableLongMeasurement isPollingDisabledMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_is_polling_disabled", "Whether polling is 
disabled (1) or not (0)");
+            "solr_core_replication_is_polling_disabled",
+            "Whether polling is disabled (1) or not (0)");
 
     ObservableLongMeasurement isReplicatingMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_is_replicating", "Whether replication is in 
progress (1) or not (0)");
+            "solr_core_replication_is_replicating",
+            "Whether replication is in progress (1) or not (0)");
 
     ObservableLongMeasurement timeElapsedMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_time_elapsed",
+            "solr_core_replication_time_elapsed",
             "Time elapsed during replication in seconds",
             OtelUnit.SECONDS);
 
     ObservableLongMeasurement bytesDownloadedMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_downloaded_size",
+            "solr_core_replication_downloaded_size",
             "Total bytes downloaded during replication",
             OtelUnit.BYTES);
 
     ObservableLongMeasurement downloadSpeedMetric =
         solrMetricsContext.longGaugeMeasurement(
-            "solr_replication_download_speed", "Download speed in bytes per 
second");
+            "solr_core_replication_download_speed", "Download speed in bytes 
per second");
 
     metricsCallback =
         solrMetricsContext.batchCallback(
             () -> {
               if (core != null && !core.isClosed()) {
-                indexSizeMetric.record(core.getIndexSize(), 
replicationAttributes);
+                indexSizeMetric.record(core.getIndexSize() / (1024 * 1024), 
replicationAttributes);

Review Comment:
   Yeah, I was thinking the same.  A static utility method could go on 
SolrMetricManager.  Or I un-deprecate MetricUtils.



##########
solr/core/src/java/org/apache/solr/metrics/otel/instruments/AttributedInstrumentFactory.java:
##########
@@ -36,16 +34,19 @@
  * Factory for creating metrics instruments that can write to either single or 
dual registries (core
  * and node).
  */
+// TODO consider making this a base abstraction with a simple impl and another 
"Dual" one.
 public class AttributedInstrumentFactory {
 
+  // These attributes are on a core but don't want to aggregate them.
   private static final Set<AttributeKey<?>> FILTER_ATTRS_SET =
-      Set.of(COLLECTION_ATTR, CORE_ATTR, SHARD_ATTR, REPLICA_TYPE_ATTR, 
INTERNAL_ATTR);

Review Comment:
   I was a little torn on that one TBH.  Ultimately I settled on excluding 
attributes relating to the identity of the core.  The type is somewhat of a 
gray area; not identity.  So even though I have no use case in mind for it; 
nonetheless it didn't meet the filter-out criteria.  I'll remove it if you 
prefer.



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