Skip to content

Commit cbb64ac

Browse files
committed
1 parent 7296718 commit cbb64ac

File tree

7 files changed

+603
-3
lines changed

7 files changed

+603
-3
lines changed

flink-core/src/main/java/org/apache/flink/configuration/TraceOptions.java

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@
3535
@Experimental
3636
public class TraceOptions {
3737

38+
/** Enum for the detail level of checkpointing spans. */
39+
public enum CheckpointSpanDetailLevel {
40+
/** Sum/Max for sub-metrics per checkpoint. */
41+
SPAN_PER_CHECKPOINT,
42+
/** Sum/Max for sub-metrics per checkpoint and arrays of task aggregates. */
43+
SPAN_PER_CHECKPOINT_WITH_TASKS,
44+
/** Sub/Max for sub-metrics of checkpoint and tasks (tasks as child spans). */
45+
CHILDREN_SPANS_PER_TASK,
46+
/**
47+
* Sub/Max for sub-metrics of checkpoint, tasks, and subtasks (tasks as child spans,
48+
* subtasks as grand-child spans).
49+
*/
50+
CHILDREN_SPANS_PER_SUBTASK;
51+
}
52+
3853
private static final String NAMED_REPORTER_CONFIG_PREFIX =
3954
ConfigConstants.TRACES_REPORTER_PREFIX + "<name>";
4055

@@ -67,6 +82,59 @@ public static Configuration forReporter(Configuration configuration, String repo
6782
+ " any of the names in the list will be started. Otherwise, all reporters that could be found in"
6883
+ " the configuration will be started.");
6984

85+
/** The detail level for reporting checkpoint spans. */
86+
public static final ConfigOption<TraceOptions.CheckpointSpanDetailLevel>
87+
CHECKPOINT_SPAN_DETAIL_LEVEL =
88+
key("traces.checkpoint.span-detail-level")
89+
.enumType(CheckpointSpanDetailLevel.class)
90+
.defaultValue(CheckpointSpanDetailLevel.SPAN_PER_CHECKPOINT)
91+
.withDescription(
92+
Description.builder()
93+
.text(
94+
"Detail level for reporting checkpoint spans. Possible values:\n")
95+
.list(
96+
text(
97+
"'%s' (default): Single span per checkpoint. "
98+
+ "Aggregated sum/max for sub-metrics from all tasks and subtasks per checkpoint.",
99+
code(
100+
CheckpointSpanDetailLevel
101+
.SPAN_PER_CHECKPOINT
102+
.name())),
103+
text(
104+
"'%s': Single span per checkpoint. "
105+
+ "Same as '%s', plus arrays of aggregated values per task.",
106+
code(
107+
CheckpointSpanDetailLevel
108+
.SPAN_PER_CHECKPOINT_WITH_TASKS
109+
.name()),
110+
code(
111+
CheckpointSpanDetailLevel
112+
.SPAN_PER_CHECKPOINT
113+
.name())),
114+
text(
115+
"'%s': Same as '%s' plus children spans per each task. "
116+
+ "Each task span with aggregated sum/max sub-metrics from subtasks.",
117+
code(
118+
CheckpointSpanDetailLevel
119+
.CHILDREN_SPANS_PER_TASK
120+
.name()),
121+
code(
122+
CheckpointSpanDetailLevel
123+
.SPAN_PER_CHECKPOINT
124+
.name())),
125+
text(
126+
"'%s': Same as '%s' plus children spans per each subtask. "
127+
+ "Child spans for tasks and grand-child spans for subtasks.",
128+
code(
129+
CheckpointSpanDetailLevel
130+
.CHILDREN_SPANS_PER_SUBTASK
131+
.name()),
132+
code(
133+
CheckpointSpanDetailLevel
134+
.CHILDREN_SPANS_PER_TASK
135+
.name())))
136+
.build());
137+
70138
/**
71139
* Returns a view over the given configuration via which options can be set/retrieved for the
72140
* given reporter.

0 commit comments

Comments
 (0)