Nagarjunanm commented on code in PR #20559:
URL: https://github.com/apache/druid/pull/20559#discussion_r4290941366
##########
extensions-contrib/kafka-emitter/src/main/java/org/apache/druid/emitter/kafka/KafkaEmitter.java:
##########
@@ -242,8 +266,14 @@ public void emit(final Event event)
Set<EventType> eventTypes = config.getEventTypes();
if (event instanceof ServiceMetricEvent) {
+ if (shouldSampleOut((ServiceMetricEvent) event)) {
Review Comment:
Agreed, thanks. Fixed in e3d4bcf: `emit()` now calls `shouldSampleOut()`
before `toMap()`, extra dimensions, JSON serialization and UTF-8 encoding, so a
sampled-out metric skips all of that work. Added
`testSamplingHappensBeforeSerialization`. It uses a dimension that can't be
serialized: a sampled-out event is now counted as sampled rather than invalid,
and a kept event is still counted as invalid as before. The test fails without
the fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]