himanshug opened a new pull request #8359: Logging emitter to publish query and other metric events as valid json objects URL: https://github.com/apache/incubator-druid/pull/8359 ### Description This patch enables pushing druid metrics in log as valid json objects which are supported out of the box by various systems used for storing and searching logs. This aids us in investigating various issues in Druid cluster. It has following changes. - LoggingEmitter is modified to emit `jsonMapper.writeValueAsString(event)` instead of `format("Event [%s]", jsonMapper.writeValueAsString(event))` . - QueryMetrics puts the query context into metric event as is instead of converting it to String. - `EmittingRequestLoggerProvider` uses only available `DefaultRequestLogEventBuilderFactory` by default when publishing request logs using the emitter. Side note: I also drop following in my log4j.xml to send the json object published as is... ``` <Configuration status="WARN"> <Appenders> ... <Console name="msgonly" target="SYSTEM_OUT"> <PatternLayout pattern="%m%n"/> </Console> ... </Appenders> <Loggers> ... <Logger name="org.apache.druid.java.util.emitter.core.LoggingEmitter" additivity="false" level="info"> <AppenderRef ref="msgonly"/> </Logger> ... </Loggers> </Configuration> ``` <hr> This PR has: - [x] been self-reviewed. - [x] been tested in a Druid cluster. <hr>
---------------------------------------------------------------- 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. 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]
