Skip to content

Commit

Permalink
[venice-thin-client][da-vinci-client] Do not emit system store client…
Browse files Browse the repository at this point in the history
… metrics (#708)

The venice_system stores are internal to venice architecture and clients should not be looking into them. Also for DaVinci client each store per instance emits around 400 metrics, and 120 of them are for system-stores. This PR stops emission of system store client metrics which would reduce ~1/3 metrics in clients

---------

Co-authored-by: Sourav Maji <[email protected]>
  • Loading branch information
majisourav99 and Sourav Maji authored Oct 26, 2023
1 parent 0ad5eba commit 585036c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@


public abstract class AbstractVeniceHttpStats extends AbstractVeniceStats {
private static final String SYSTEM_STORE_NAME_PREFIX = "venice_system_store_";
private static final MetricsRepository dummySystemStoreMetricRepo = new MetricsRepository();

private final RequestType requestType;

public AbstractVeniceHttpStats(MetricsRepository metricsRepository, String storeName, RequestType requestType) {
super(metricsRepository, storeName);
super(storeName.startsWith(SYSTEM_STORE_NAME_PREFIX) ? dummySystemStoreMetricRepo : metricsRepository, storeName);
this.requestType = requestType;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package com.linkedin.venice.stats;

import static org.testng.AssertJUnit.assertTrue;

import com.linkedin.venice.client.stats.BasicClientStats;
import com.linkedin.venice.client.stats.ClientStats;
import com.linkedin.venice.client.store.ClientConfig;
import com.linkedin.venice.read.RequestType;
import io.tehuti.Metric;
import io.tehuti.metrics.MeasurableStat;
import io.tehuti.metrics.MetricConfig;
Expand Down Expand Up @@ -83,4 +89,22 @@ public void testRegisterSensorAttributeGauge() {
Assert.assertEquals(metricsRepository.getMetric(".myMetric--foo.bar").value(), 1.0);
Assert.assertEquals(metricsRepository.getMetric(".myMetric--foo.bar2").value(), 2.0);
}

@Test
public void testMetricPrefix() {
String storeName = "test_store";
MetricsRepository metricsRepository1 = new MetricsRepository();
// Without prefix
ClientConfig config1 = new ClientConfig(storeName);
BasicClientStats.getClientStats(metricsRepository1, storeName, RequestType.SINGLE_GET, config1);
// Check metric name
assertTrue(metricsRepository1.metrics().size() > 0);

String prefix = "venice_system_store_meta_store_abc";
ClientConfig config2 = new ClientConfig(storeName).setStatsPrefix(prefix);
ClientStats clientStats =
ClientStats.getClientStats(new MetricsRepository(), storeName, RequestType.SINGLE_GET, config2);
clientStats.recordRequestRetryCount();
}

}

0 comments on commit 585036c

Please sign in to comment.