diff --git a/wrangler-transform/src/main/java/io/cdap/wrangler/Wrangler.java b/wrangler-transform/src/main/java/io/cdap/wrangler/Wrangler.java index a8e39e7ea..d5e57ae69 100644 --- a/wrangler-transform/src/main/java/io/cdap/wrangler/Wrangler.java +++ b/wrangler-transform/src/main/java/io/cdap/wrangler/Wrangler.java @@ -600,8 +600,8 @@ private Optional> getExpressionFactory(RelationalTranf */ private void emitDirectiveMetrics(List directives, Metrics metrics) throws DirectiveLoadException { for (Directive directive : directives) { - // skip emitting metrics if the directive is not system metric - if (registry.get(Contexts.SYSTEM, directive.define().getDirectiveName()) != null) { + // skip emitting metrics if the directive is not system directive + if (registry.get(Contexts.SYSTEM, directive.define().getDirectiveName()) == null) { continue; } List countMetrics = new ArrayList<>();