From 344b9c6da15515d2423d4cffc1ff37df13ae46cc Mon Sep 17 00:00:00 2001 From: Brian Harrington Date: Thu, 28 Mar 2024 19:56:19 -0500 Subject: [PATCH 1/2] eval: fix spurious warnings for event expressions FinalExprEval stage would emit spurious warnings for event expressions. Ignore the non time series expressions for the eval processing as events are just passed through. --- .../com/netflix/atlas/eval/stream/FinalExprEval.scala | 4 ++++ .../netflix/atlas/eval/stream/FinalExprEvalSuite.scala | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala index 7aa055a8c..f3f8f056c 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala @@ -32,6 +32,7 @@ import com.netflix.atlas.core.model.StatefulExpr import com.netflix.atlas.core.model.StyleExpr import com.netflix.atlas.core.model.TimeSeries import com.netflix.atlas.core.util.IdentityMap +import com.netflix.atlas.eval.model.ExprType import com.netflix.atlas.eval.model.TimeGroup import com.netflix.atlas.eval.model.TimeGroupsTuple import com.netflix.atlas.eval.model.TimeSeriesMessage @@ -101,6 +102,9 @@ private[stream] class FinalExprEval(exprInterpreter: ExprInterpreter) // Compute the new set of expressions recipients = sources + .filter { s => + exprInterpreter.determineExprType(Uri(s.uri)) == ExprType.TIME_SERIES + } .flatMap { s => try { val graphCfg = exprInterpreter.eval(Uri(s.uri)) diff --git a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FinalExprEvalSuite.scala b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FinalExprEvalSuite.scala index 9879d76f5..a9ede5a63 100644 --- a/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FinalExprEvalSuite.scala +++ b/atlas-eval/src/test/scala/com/netflix/atlas/eval/stream/FinalExprEvalSuite.scala @@ -99,6 +99,14 @@ class FinalExprEvalSuite extends FunSuite { } } + test("ignore event exprs") { + val input = List( + sources(ds("a", "http://atlas/events?q=app,foo,:eq,(,message,),:table")) + ) + val output = run(input) + assert(output.isEmpty) + } + test("division with no data should result in no data line") { val input = List( sources(ds("a", "http://atlas/graph?q=name,latency,:eq,:dist-avg")), From 2a1da5d3d91ff1461810f38db89434834c0e717a Mon Sep 17 00:00:00 2001 From: Brian Harrington Date: Thu, 28 Mar 2024 20:03:22 -0500 Subject: [PATCH 2/2] fix test --- .../scala/com/netflix/atlas/eval/stream/FinalExprEval.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala index f3f8f056c..ecfb13573 100644 --- a/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala +++ b/atlas-eval/src/main/scala/com/netflix/atlas/eval/stream/FinalExprEval.scala @@ -103,7 +103,7 @@ private[stream] class FinalExprEval(exprInterpreter: ExprInterpreter) // Compute the new set of expressions recipients = sources .filter { s => - exprInterpreter.determineExprType(Uri(s.uri)) == ExprType.TIME_SERIES + exprInterpreter.determineExprType(Uri(s.uri)).isTimeSeriesType } .flatMap { s => try {