Skip to content

Commit

Permalink
Better document static metric filter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wavejumper committed Dec 18, 2024
1 parent ea8cd23 commit 27b2151
Showing 1 changed file with 37 additions and 16 deletions.
53 changes: 37 additions & 16 deletions src/java/io/factorhouse/kpow/MetricFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ private MetricFilter(String id) {
this.filterId = id;
}

/**
* Returns the default metricsFilter used by the streams agent.
* By default, Kpow's streams agent will only send across the topology and streams state
* on each observation.
*
* @return the default metrics filter
*/
public static MetricFilter defaultMetricFilter() {
return new MetricFilter("default")
.deny();
}

/**
* Returns a metrics filter that accepts all numeric metrics from the running Streams application.
*
Expand All @@ -71,9 +59,18 @@ public static MetricFilter acceptAllMetricFilter() {
return new MetricFilter("acceptAll").accept();
}

/**
* Returns a metrics filter that denies all metrics, only sending across the Kafka Streams topology + state
* on every observation.
*
* @return deny all metric filter
*/
public static MetricFilter denyAllMetricFilter() {
return new MetricFilter("denyAll").deny();
}

/**
* Returns a metrics filter that includes only state store (and
* Returns a metrics filter that includes only state store metrics.
*
* @return state store metrics only filter
*/
Expand All @@ -90,9 +87,33 @@ public static MetricFilter stateStoreMetricsOnlyFilter() {
.accept(stateStoreMetricsOnly);
}

public static MetricFilter essentialMetricsOnlyFilter() {
return new MetricFilter("essentialMetricsOnlyFilter")
// Lagency
/**
* Returns the default metricsFilter used by the streams agent.
* By default, Kpow's streams agent will only send across a few key Kafka Streams metrics:
* Latency:
* - commit-latency-avg
* - process-latency-avg
* - poll-latecny-avg
* Throughput:
* - process-rate
* - records-processed-rate
* Lag:
* - commit-rate
* - records-lag-max
* - records-lag
* Stability:
* - failed-stream-threads
* - rebalances
* State store health:
* - put-rate
* - get-rate
* - flush-rate
*
* @return the default metrics filter
*/
public static MetricFilter defaultMetricFilter() {
return new MetricFilter("default")
// Latency
.acceptNameStartsWith("commit-latency-avg")
.acceptNameStartsWith("process-latency-avg")
.acceptNameStartsWith("poll-latency-avg")
Expand Down

0 comments on commit 27b2151

Please sign in to comment.