Skip to content

Commit

Permalink
avoid emitting metrics for non-sep SIT
Browse files Browse the repository at this point in the history
  • Loading branch information
sixpluszero committed Nov 18, 2024
1 parent 3187bca commit 4308008
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4404,6 +4404,10 @@ public boolean hasAllPartitionReportedCompleted() {
return true;
}

public boolean isSeparatedRealtimeTopicEnabled() {
return isSeparatedRealtimeTopicEnabled;
}

PubSubTopicPartition resolveTopicPartitionWithKafkaURL(
PubSubTopic topic,
PartitionConsumptionState partitionConsumptionState,
Expand All @@ -4420,10 +4424,6 @@ PubSubTopicPartition resolveTopicPartitionWithKafkaURL(
return pubSubTopicPartition;
}

boolean isSeparatedRealtimeTopicEnabled() {
return isSeparatedRealtimeTopicEnabled;
}

PubSubTopicRepository getPubSubTopicRepository() {
return pubSubTopicRepository;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

import com.linkedin.venice.common.VeniceSystemStoreUtils;
import com.linkedin.venice.utils.RegionUtils;
import com.linkedin.venice.utils.Utils;
import io.tehuti.metrics.MetricsRepository;
import io.tehuti.metrics.stats.AsyncGauge;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
Expand Down Expand Up @@ -344,6 +345,11 @@ protected void registerConditionalStats() {
.getServerConfig()
.getKafkaClusterIdToAliasMap()
.int2ObjectEntrySet()) {
// We will only register sensor for SIT with separate RT topic enabled to avoid unnecessary metrics.
if (getStats().getIngestionTask().isSeparatedRealtimeTopicEnabled()
&& Utils.isSeparateTopicRegion(entry.getValue())) {
continue;
}
int regionId = entry.getIntKey();
String regionNamePrefix = RegionUtils.getRegionSpecificMetricPrefix(
getStats().getIngestionTask().getServerConfig().getRegionName(),
Expand Down

0 comments on commit 4308008

Please sign in to comment.