diff --git a/timbermill-java/timbermill-local/src/main/java/com/datorama/oss/timbermill/common/ElasticsearchUtil.java b/timbermill-java/timbermill-local/src/main/java/com/datorama/oss/timbermill/common/ElasticsearchUtil.java index 3da4fe67..26fddb25 100644 --- a/timbermill-java/timbermill-local/src/main/java/com/datorama/oss/timbermill/common/ElasticsearchUtil.java +++ b/timbermill-java/timbermill-local/src/main/java/com/datorama/oss/timbermill/common/ElasticsearchUtil.java @@ -1,7 +1,6 @@ package com.datorama.oss.timbermill.common; import com.datorama.oss.timbermill.TaskIndexer; -import com.datorama.oss.timbermill.pipe.LocalOutputPipe; import com.datorama.oss.timbermill.unit.Event; import com.google.common.collect.Sets; import org.slf4j.Logger; @@ -308,7 +307,6 @@ public class ElasticsearchUtil { private static final Set envsSet = Sets.newConcurrentHashSet(); private static final Pattern metadataPatten = Pattern.compile("metadata.*"); private static Pattern notToSkipRegexPattern; - private static Pattern clientFacingEventsPattern = LocalOutputPipe.getClientFacingEventsPattern(); public static Set getEnvSet() { return envsSet; @@ -324,18 +322,7 @@ public static void drainAndIndex(BlockingQueue eventsQueue, TaskIndexer t Collection unfilteredEvents = new ArrayList<>(); eventsQueue.drainTo(unfilteredEvents, maxElement); Collection events = filterEvents(unfilteredEvents, skipEventsAtDrainFlag, notToSkipRegex); - - if (clientFacingEventsPattern != null){ - events.forEach(e -> { - if (clientFacingEventsPattern.matcher(e.getName()).matches()){ - KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withTag("client_facing", true).decrement(); - } else { - KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withTag("client_facing", false).decrement(); - } - }); - } else { - KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withoutTags().decrement(events.size()); - } + KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withoutTags().decrement(events.size()); logErrorInEventsMap(events.stream().filter(event -> event.getTaskId() != null).collect(Collectors.groupingBy(Event::getTaskId)), "drainAndIndex"); events.forEach(e -> { diff --git a/timbermill-java/timbermill-local/src/main/java/com/datorama/oss/timbermill/pipe/LocalOutputPipe.java b/timbermill-java/timbermill-local/src/main/java/com/datorama/oss/timbermill/pipe/LocalOutputPipe.java index 546cdf07..b9798107 100644 --- a/timbermill-java/timbermill-local/src/main/java/com/datorama/oss/timbermill/pipe/LocalOutputPipe.java +++ b/timbermill-java/timbermill-local/src/main/java/com/datorama/oss/timbermill/pipe/LocalOutputPipe.java @@ -26,7 +26,6 @@ import java.util.Map; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; -import java.util.regex.Pattern; public class LocalOutputPipe implements EventOutputPipe { @@ -42,7 +41,6 @@ public class LocalOutputPipe implements EventOutputPipe { private boolean stoppedRunning = false; private static final Logger LOG = LoggerFactory.getLogger(LocalOutputPipe.class); private LoadingCache rateLimiterMap; - private static Pattern clientFacingEventsPattern = null; private LocalOutputPipe(Builder builder) { if (builder.elasticUrl == null){ @@ -123,15 +121,7 @@ public static void doPushEventToQueues(PersistenceHandler persistenceHandler, Bl KamonConstants.MESSAGES_IN_OVERFLOWED_QUEUE_RANGE_SAMPLER.withoutTags().increment(); } } else { - if (clientFacingEventsPattern != null) { - if (clientFacingEventsPattern.matcher(event.getName()).matches()) { - KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withTag("client_facing", true).increment(); - } else { - KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withTag("client_facing", false).increment(); - } - } else { - KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withoutTags().increment(); - } + KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withoutTags().increment(); } } @@ -180,14 +170,6 @@ public void setRateLimiterMap(LoadingCache rateLimiterMap) this.rateLimiterMap = rateLimiterMap; } - public static void setClientFacingEventsPattern(Pattern newClientFacingEventsPattern){ - clientFacingEventsPattern = newClientFacingEventsPattern; - } - - public static Pattern getClientFacingEventsPattern(){ - return clientFacingEventsPattern; - } - public static class Builder { Bulker bulker; diff --git a/timbermill-java/timbermill-server/src/main/java/com/datorama/timbermill/server/service/TimbermillService.java b/timbermill-java/timbermill-server/src/main/java/com/datorama/timbermill/server/service/TimbermillService.java index b6f19789..e12c9df7 100644 --- a/timbermill-java/timbermill-server/src/main/java/com/datorama/timbermill/server/service/TimbermillService.java +++ b/timbermill-java/timbermill-server/src/main/java/com/datorama/timbermill/server/service/TimbermillService.java @@ -50,8 +50,6 @@ public class TimbermillService { private static Pattern notToSkipRegexPattern = null; private static Pattern metadataPatten = Pattern.compile("metadata.*"); - private String clientFacingEventsRegex; - public static Pattern clientFacingEventsPattern = null; private boolean skipEventsAtInsertFlag; private boolean skipEventsAtDrainFlag; @@ -118,7 +116,6 @@ public TimbermillService(@Value("${INDEX_BULK_SIZE:200000}") Integer indexBulkSi @Value("${LIMIT_FOR_PERIOD:30000}") int limitForPeriod, @Value("${LIMIT_REFRESH_PERIOD_MINUTES:1}") int limitRefreshPeriod, @Value("${RATE_LIMITER_CAPACITY:1000000}") int rateLimiterCapacity, - @Value("${client.facing.events.regex:''}") String clientFacingEventsRegex, @Value("${skip.events.at.insert.flag:false}") boolean skipEventsAtInsertFlag, @Value("${skip.events.at.drain.flag:false}") boolean skipEventsAtDrainFlag, @Value("${not.to.skip.events.regex:.*}") String notToSkipRegex){ @@ -132,10 +129,6 @@ public TimbermillService(@Value("${INDEX_BULK_SIZE:200000}") Integer indexBulkSi this.skipEventsAtDrainFlag = skipEventsAtDrainFlag; this.notToSkipRegex = notToSkipRegex; - if (!clientFacingEventsRegex.isEmpty()){ - clientFacingEventsPattern = Pattern.compile(clientFacingEventsRegex); - } - RedisService redisService = null; if (!StringUtils.isEmpty(redisHost)) { redisService = new RedisService(redisHost, redisPort, redisPass, redisMaxMemory, @@ -155,7 +148,6 @@ public TimbermillService(@Value("${INDEX_BULK_SIZE:200000}") Integer indexBulkSi AbstractCacheHandler cacheHandler = CacheHandlerUtil.getCacheHandler(cacheStrategy, cacheParams); this.eventsMaxElement = eventsMaxElement; taskIndexer = new TaskIndexer(pluginsJson, daysRotation, es, timbermillVersion, cacheHandler); - if(!(clientFacingEventsPattern == null)){LocalOutputPipe.setClientFacingEventsPattern(clientFacingEventsPattern);} cronsRunner.runCrons(bulkPersistentFetchCronExp, eventsPersistentFetchCronExp, persistenceHandler, es, deletionCronExp, eventsQueue, overflowedQueue, mergingCronExp, redisService, rateLimiterMap, indexMergerCronExp); startQueueSpillerThread();