From 9f1cc541036881bc6bf306d360d3d5070b683860 Mon Sep 17 00:00:00 2001 From: Oleksii Moskalenko Date: Tue, 12 Jan 2021 15:38:03 +0800 Subject: [PATCH] add project name to validation metric Signed-off-by: Oleksii Moskalenko --- sdk/python/feast/contrib/validation/ge.py | 1 + .../src/main/scala/feast/ingestion/StreamingPipeline.scala | 3 ++- tests/e2e/test_validation.py | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/python/feast/contrib/validation/ge.py b/sdk/python/feast/contrib/validation/ge.py index 3d4bc97b33..0fd370aa67 100644 --- a/sdk/python/feast/contrib/validation/ge.py +++ b/sdk/python/feast/contrib/validation/ge.py @@ -131,6 +131,7 @@ def udf(df: pd.DataFrame) -> pd.Series: value=unexpected_count, tags=[ f"feature_table:{os.getenv('FEAST_INGESTION_FEATURE_TABLE', 'unknown')}", + f"project:{os.getenv('FEAST_INGESTION_PROJECT_NAME', 'default')}", f"check:{check_name}", ], ) diff --git a/spark/ingestion/src/main/scala/feast/ingestion/StreamingPipeline.scala b/spark/ingestion/src/main/scala/feast/ingestion/StreamingPipeline.scala index fd7035c514..c1a365c9e7 100644 --- a/spark/ingestion/src/main/scala/feast/ingestion/StreamingPipeline.scala +++ b/spark/ingestion/src/main/scala/feast/ingestion/StreamingPipeline.scala @@ -176,7 +176,8 @@ object StreamingPipeline extends BasePipeline with Serializable { Map( "STATSD_HOST" -> c.host, "STATSD_PORT" -> c.port.toString, - "FEAST_INGESTION_FEATURE_TABLE" -> config.featureTable.name + "FEAST_INGESTION_FEATURE_TABLE" -> config.featureTable.name, + "FEAST_INGESTION_PROJECT_NAME" -> config.featureTable.project ) case _ => Map.empty[String, String] } diff --git a/tests/e2e/test_validation.py b/tests/e2e/test_validation.py index 5784fada5e..b94b7f35f2 100644 --- a/tests/e2e/test_validation.py +++ b/tests/e2e/test_validation.py @@ -200,7 +200,8 @@ def test_validation_reports_metrics( expected_metrics = [ ( - f"feast_feature_validation_check_failed#check:{check_name},feature_table:validation_ge_metrics", + f"feast_feature_validation_check_failed#check:{check_name}," + f"feature_table:{feature_table.name},project:{feast_client.project}", value, ) for check_name, value in unexpected_counts.items()