Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove job id from ingested row counter metric #1216

Merged
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
Remove job id from ingested row counter metric
Signed-off-by: Terence <terencelimxp@gmail.com>
  • Loading branch information
terryyylim committed Dec 7, 2020
commit 750d630219e3d77cfa08004402c112d1e1ba8632
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