From bd200f842547afd0a87e1c42ce5899af375f6293 Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:12:49 +0530 Subject: [PATCH 1/2] allow certain tags --- .../server/configurations/NoTagsMeterFilter.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/NoTagsMeterFilter.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/NoTagsMeterFilter.java index 95b1f30af77a..f341bd5e6215 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/NoTagsMeterFilter.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/NoTagsMeterFilter.java @@ -4,13 +4,27 @@ import io.micrometer.core.instrument.Tags; import io.micrometer.core.instrument.config.MeterFilter; +import java.util.List; + public class NoTagsMeterFilter implements MeterFilter { + private static final List seriesExceptionList = List.of( + "appsmith.total.plugin.execution", "appsmith.total.server.execution", "appsmith.get.datasource.context"); + @Override public Meter.Id map(Meter.Id id) { // Remove all tags from the metric - if (id.getName().startsWith("appsmith")) { + if (id.getName().startsWith("appsmith") && !startsWithAnyPrefix(id.getName())) { return id.replaceTags(Tags.empty()); } return id; } + + private boolean startsWithAnyPrefix(String metricName) { + for (String prefix : seriesExceptionList) { + if (metricName.startsWith(prefix)) { + return true; + } + } + return false; + } } From 494eede23bbf8e2762a3480b1730a28cff578cab Mon Sep 17 00:00:00 2001 From: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com> Date: Wed, 19 Feb 2025 17:06:49 +0530 Subject: [PATCH 2/2] function name change --- .../com/appsmith/server/configurations/NoTagsMeterFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/NoTagsMeterFilter.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/NoTagsMeterFilter.java index f341bd5e6215..d2011eb3199d 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/NoTagsMeterFilter.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/NoTagsMeterFilter.java @@ -13,13 +13,13 @@ public class NoTagsMeterFilter implements MeterFilter { @Override public Meter.Id map(Meter.Id id) { // Remove all tags from the metric - if (id.getName().startsWith("appsmith") && !startsWithAnyPrefix(id.getName())) { + if (id.getName().startsWith("appsmith") && !startsWithPrefix(id.getName())) { return id.replaceTags(Tags.empty()); } return id; } - private boolean startsWithAnyPrefix(String metricName) { + private boolean startsWithPrefix(String metricName) { for (String prefix : seriesExceptionList) { if (metricName.startsWith(prefix)) { return true;