adarshsanjeev commented on code in PR #18121:
URL: https://github.com/apache/druid/pull/18121#discussion_r2179833279
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java:
##########
@@ -553,11 +554,31 @@ private MSQTaskReportPayload runInternal(final
QueryListener queryListener, fina
countersSnapshot,
null
);
- // Emit summary metrics
+ // Emit metrics
+ emitQueryMetrics(queryDef, taskStateForReport.isSuccess());
emitSummaryMetrics(msqTaskReportPayload, querySpec);
return msqTaskReportPayload;
}
+ private void emitQueryMetrics(@Nullable final QueryDefinition queryDef,
final boolean success)
+ {
+ final Set<String> datasources = new HashSet<>();
+ final Set<Interval> intervals = new HashSet<>();
+ if (queryDef != null) {
+ for (StageDefinition stageDefinition : queryDef.getStageDefinitions()) {
+ datasources.addAll(MSQMetricUtils.getDatasources(stageDefinition));
+ intervals.addAll(MSQMetricUtils.getIntervals(stageDefinition));
+ }
+ }
+
+ long startTime =
DateTimeUtils.getInstantMillis(MultiStageQueryContext.getStartTime(querySpec.getContext()));
+ context.emitMetric(
+ "query/time",
+ MSQMetricUtils.createQueryMetricDimensions(datasources, intervals,
success),
+ startTime - System.currentTimeMillis()
Review Comment:
Ah, thanks for catching this!
--
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]