Skip to content

Commit

Permalink
add client facing tag to input queue sampler
Browse files Browse the repository at this point in the history
  • Loading branch information
emoscovici committed Feb 10, 2024
1 parent 7fd5f3a commit 5f281d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.stream.Collectors;

import static com.datorama.oss.timbermill.TaskIndexer.logErrorInEventsMap;
import static com.datorama.oss.timbermill.pipe.LocalOutputPipe.tryReportClientFacingInputQueueMetric;
import static com.datorama.oss.timbermill.pipe.LocalOutputPipe.tryReportInputQueueMetricWithTag;

public class ElasticsearchUtil {
public static final String CLIENT = "client";
Expand Down Expand Up @@ -324,7 +324,7 @@ public static void drainAndIndex(BlockingQueue<Event> eventsQueue, TaskIndexer t
eventsQueue.drainTo(unfilteredEvents, maxElement);
Collection<Event> events = filterEvents(unfilteredEvents, skipEventsAtDrainFlag, notToSkipRegex);
events.forEach(e -> {
if(!tryReportClientFacingInputQueueMetric(e, false)) {
if(!tryReportInputQueueMetricWithTag(e, false)) {
KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withoutTags().decrement();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ public static void doPushEventToQueues(PersistenceHandler persistenceHandler, Bl
KamonConstants.MESSAGES_IN_OVERFLOWED_QUEUE_RANGE_SAMPLER.withoutTags().increment();
}
} else {
if(!tryReportClientFacingInputQueueMetric(event, true)) {
if(!tryReportInputQueueMetricWithTag(event, true)) {
KamonConstants.MESSAGES_IN_INPUT_QUEUE_RANGE_SAMPLER.withoutTags().increment();
}
}
}


public static boolean tryReportClientFacingInputQueueMetric(Event event, boolean isIncrement) {
public static boolean tryReportInputQueueMetricWithTag(Event event, boolean isIncrement) {
LOG.info("about to tryReportClientFacingInputQueueMetric for event name:{}", event.getName());
boolean success = false;
//todo: remove
Expand Down

0 comments on commit 5f281d3

Please sign in to comment.