kfaraz commented on code in PR #13333:
URL: https://github.com/apache/druid/pull/13333#discussion_r1018771882
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/actions/LocalTaskActionClient.java:
##########
@@ -72,14 +77,35 @@ public <RetType> RetType submit(TaskAction<RetType>
taskAction)
final long performStartTime = System.currentTimeMillis();
final RetType result = taskAction.perform(task, toolbox);
- emitTimerMetric("task/action/run/time", System.currentTimeMillis() -
performStartTime);
+ emitTimerMetric("task/action/run/time", taskAction,
System.currentTimeMillis() - performStartTime);
return result;
}
- private void emitTimerMetric(final String metric, final long time)
+ private void emitTimerMetric(final String metric, final TaskAction<?>
action, final long time)
{
final ServiceMetricEvent.Builder metricBuilder =
ServiceMetricEvent.builder();
IndexTaskUtils.setTaskDimensions(metricBuilder, task);
+ final String actionType = getActionType(toolbox.getJsonMapper(), action);
+ if (actionType != null) {
+ metricBuilder.setDimension("taskActionType", actionType);
+ }
toolbox.getEmitter().emit(metricBuilder.build(metric, Math.max(0, time)));
}
+
+ @Nullable
+ static String getActionType(final ObjectMapper jsonMapper, final
TaskAction<?> action)
+ {
+ try {
+ final Map<String, Object> m = jsonMapper.convertValue(action,
JacksonUtils.TYPE_REFERENCE_MAP_STRING_OBJECT);
Review Comment:
Yeah, actions themselves are pretty heavy. Thanks for the clarification.
--
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]