suneet-s commented on a change in pull request #10373:
URL: https://github.com/apache/druid/pull/10373#discussion_r490322046
##########
File path:
server/src/main/java/org/apache/druid/server/audit/SQLAuditManager.java
##########
@@ -93,13 +93,19 @@ public Void withHandle(Handle handle) throws Exception
@Override
public void doAudit(AuditEntry auditEntry, Handle handle) throws IOException
{
- emitter.emit(
- new ServiceMetricEvent.Builder()
- .setDimension("key", auditEntry.getKey())
- .setDimension("type", auditEntry.getType())
- .setDimension("author", auditEntry.getAuditInfo().getAuthor())
- .build("config/audit", 1)
- );
+ ServiceMetricEvent.Builder builder = new ServiceMetricEvent.Builder()
+ .setDimension("key",
auditEntry.getKey())
+ .setDimension("type",
auditEntry.getType())
+ .setDimension("author",
auditEntry.getAuditInfo().getAuthor())
+ .setDimension("comment",
auditEntry.getAuditInfo().getComment())
+
.setDimension("remote_address", auditEntry.getAuditInfo().getIp())
+ .setDimension("created_date",
auditEntry.getAuditTime().toString());
+
+ if (config.getAddPayloadToAuditMetricDimension()) {
+ builder.setDimension("payload", auditEntry.getPayload());
+ }
Review comment:
Can you add a unit test that validates this behavior please
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]