EricGao888 commented on code in PR #13183:
URL:
https://github.com/apache/dolphinscheduler/pull/13183#discussion_r1139679300
##########
dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/metrics/TaskMetrics.java:
##########
@@ -83,11 +84,15 @@ public void incTaskDispatch() {
taskDispatchCounter.increment();
}
- public void incTaskInstanceByState(final String state) {
- if (taskInstanceCounters.get(state) == null) {
+ public void incTaskInstanceByState(final String state, String
taskInstanceName) {
+ Counter.Builder builder = taskInstanceCountersBuild.get(state);
+ if (builder == null) {
return;
}
- taskInstanceCounters.get(state).increment();
+ if
(MasterConfigStatic.masterConfigStatic.isSupportTaskNameTagMetric()) {
Review Comment:
https://github.com/apache/dolphinscheduler/blob/1ac76e1cbbf25156f3b40dc5035ef7b15dfc9bdf/dolphinscheduler-dao/src/main/resources/sql/dolphinscheduler_mysql.sql#L468-L503
`task name` is not identical, aggregating metrics by `task name` may lead to
miscounting. `id` is identical for task definition, however, I haven't found a
way for users to get `task definition id` easily from web ui.
##########
dolphinscheduler-standalone-server/src/main/resources/application.yaml:
##########
@@ -149,6 +149,8 @@ master:
# kill yarn/k8s application when failover taskInstance, default true
kill-application-when-task-failover: true
worker-group-refresh-interval: 10s
+ # This attribute is mainly supported by task metric, allowing task instance
name to be used as a tag.
+ support-task-name-tag-metric: true
Review Comment:
Since the number of task keeps increasing, we need clean-up mechanism for
metrics tagged with task id. Otherwise, users may face memory issue. You may
refer to what we did in this PR
https://github.com/apache/dolphinscheduler/pull/13640
--
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]