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


##########
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:
   I see this conversion happens a lot. Is it worth making a conversion utility 
method for this? But I saw you added the deprecated annotation below so are you 
trying to just have everything inline.



##########
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:
   Internal/not makes sense but what about `REPLICA_TYPE_ATTR` which you 
removed? There is only 3 (NRT/TLOG/PULL) so not much cardinality and you can 
add them all up in your backend but was this removed on purpose as well?



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