Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,27 @@ class RedisSinkMetricSource extends Source {

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

private def nameWithLabels(name: String) = {
private def metricWithLabels(name: String) = {
if (metricLabels.isEmpty) {
name
} else {
s"$name#$metricLabels,job_id=$appId-$executorId"
}
}

private def counterWithLabels(name: String) = {
if (metricLabels.isEmpty) {
name
} else {
s"$name#$metricLabels"
}
}

val METRIC_TOTAL_ROWS_INSERTED =
metricRegistry.counter(nameWithLabels("feast_ingestion_feature_row_ingested_count"))
metricRegistry.counter(counterWithLabels("feast_ingestion_feature_row_ingested_count"))

val METRIC_ROWS_LAG =
metricRegistry.histogram(nameWithLabels("feast_ingestion_feature_row_lag_ms"))
metricRegistry.histogram(metricWithLabels("feast_ingestion_feature_row_lag_ms"))
}

object RedisSinkMetricSource {
Expand Down