Skip to content

Commit 1f5ace4

Browse files
authored
Remove job id from ingested row counter metric (#1216)
Signed-off-by: Terence <terencelimxp@gmail.com>
1 parent 5f3ddcb commit 1f5ace4

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

spark/ingestion/src/main/scala/org/apache/spark/metrics/source/RedisSinkMetricSource.scala

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,27 @@ class RedisSinkMetricSource extends Source {
3232

3333
private val executorId = sparkConfig.get("spark.executor.id", "")
3434

35-
private def nameWithLabels(name: String) = {
35+
private def metricWithLabels(name: String) = {
3636
if (metricLabels.isEmpty) {
3737
name
3838
} else {
3939
s"$name#$metricLabels,job_id=$appId-$executorId"
4040
}
4141
}
4242

43+
private def counterWithLabels(name: String) = {
44+
if (metricLabels.isEmpty) {
45+
name
46+
} else {
47+
s"$name#$metricLabels"
48+
}
49+
}
50+
4351
val METRIC_TOTAL_ROWS_INSERTED =
44-
metricRegistry.counter(nameWithLabels("feast_ingestion_feature_row_ingested_count"))
52+
metricRegistry.counter(counterWithLabels("feast_ingestion_feature_row_ingested_count"))
4553

4654
val METRIC_ROWS_LAG =
47-
metricRegistry.histogram(nameWithLabels("feast_ingestion_feature_row_lag_ms"))
55+
metricRegistry.histogram(metricWithLabels("feast_ingestion_feature_row_lag_ms"))
4856
}
4957

5058
object RedisSinkMetricSource {

0 commit comments

Comments
 (0)