gianm commented on a change in pull request #6493: Support for request logging
in kafka emitter.
URL: https://github.com/apache/incubator-druid/pull/6493#discussion_r236846679
##########
File path:
extensions-contrib/kafka-emitter/src/main/java/org/apache/druid/emitter/kafka/KafkaEmitterConfig.java
##########
@@ -47,13 +49,15 @@ public KafkaEmitterConfig(
@JsonProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG) String
bootstrapServers,
@JsonProperty("metric.topic") String metricTopic,
@JsonProperty("alert.topic") String alertTopic,
+ @JsonProperty("request.topic") String requestTopic,
@JsonProperty("clusterName") String clusterName,
@JsonProperty("producer.config") @Nullable Map<String, String>
kafkaProducerConfig
)
{
this.bootstrapServers = Preconditions.checkNotNull(bootstrapServers,
"bootstrap.servers can not be null");
this.metricTopic = Preconditions.checkNotNull(metricTopic, "metric.topic
can not be null");
this.alertTopic = Preconditions.checkNotNull(alertTopic, "alert.topic can
not be null");
+ this.requestTopic = Preconditions.checkNotNull(requestTopic,
"request.topic can not be null");
Review comment:
It's strange for this to be required even if you aren't using the "emitter"
request logger. I think the ideal behavior you'd want is:
- If you are using the emitter request logger and a Kafka emitter,
`request.topic` should be required.
- If you are not using the emitter request logger, `request.topic` should
_not_ be required. (And, in fact, it might be best to throw an exception if
it's set.)
However, it might not be easy to accomplish the above given how the code is
currently structured. IMO the best compromise is to have `request.topic` _not_
be required, and then if the emitter receives any RequestLogEvents when
`request.topic` is not set, it should drop them and log a warning. Not one
warning per query -- that would be too many -- but maybe one warning every
minute saying how many logs have been dropped.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]