-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-38353][spans] FLIP-483: Add support for children Spans #26985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
.defaultValue(CheckpointSpanDetailLevel.SPANS_PER_CHECKPOINT) | ||
.withDescription( | ||
"Detail level for reporting checkpoint spans. Possible values:\n" | ||
+ "- SPAN_PER_CHECKPOINT (default): Single span per checkpoint. Aggregated sum/max for submetrics from all tasks and subtasks per checkpoint\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ "- SPAN_PER_CHECKPOINT (default): Single span per checkpoint. Aggregated sum/max for submetrics from all tasks and subtasks per checkpoint\n" | |
+ "- SPANS_PER_CHECKPOINT (default): Single span per checkpoint. Aggregated sum/max for submetrics from all tasks and subtasks per checkpoint\n" |
Same for a few more times across the description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Efrat19 in the case of SPAN_PER_CHECKPOINT there is only one span so singular makes sense top me. The others could have multiple so are SPANS.
SPANS_PER_TASK will have a SPAN for each task plus one for the PARENT, so is a bit misleading. We could say
CHILDEN_SPANS_PER_TASK and CHILDEN_SPANS_PER_SUBTASK if we think this is clearer. WDYT @pnowojski ? I do not have strong views to change this, but thought I would bring it to your attention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, lets keep the first two singular other plural with CHILDREN_SPANS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have also re-used constants to avoid problems with names getting out of sync.
// TODO: not yet supported | ||
// for (Span childSpan : span.getChildren()) { | ||
// notifyOfAddedSpanInternal(childSpan, currentOtelSpan); | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove comment? (code is identical to the loop below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been removed?
.withDescription( | ||
String.format( | ||
"Detail level for reporting checkpoint spans. Possible values:\n" | ||
+ "- %s (default): Single span per checkpoint. Aggregated sum/max for submetrics from all tasks and subtasks per checkpoint\n" | ||
+ "- %s: Single span per checkpoint. Same as %s, plus arrays of aggregated values per task.\n" | ||
+ "- %s: Same as %s plus children spans per each task. Each task span with aggregated sum/max submetrics from subtasks.\n" | ||
+ "- %s: Same as %s plus children spans per each subtask. Child spans for tasks and grand-child spans for subtasks.", | ||
CheckpointSpanDetailLevel.SPAN_PER_CHECKPOINT.name(), | ||
CheckpointSpanDetailLevel.SPAN_PER_CHECKPOINT_WITH_TASKS | ||
.name(), | ||
CheckpointSpanDetailLevel.SPAN_PER_CHECKPOINT.name(), | ||
CheckpointSpanDetailLevel.CHILDREN_SPANS_PER_TASK | ||
.name(), | ||
CheckpointSpanDetailLevel.SPAN_PER_CHECKPOINT.name(), | ||
CheckpointSpanDetailLevel.CHILDREN_SPANS_PER_SUBTASK | ||
.name(), | ||
CheckpointSpanDetailLevel.CHILDREN_SPANS_PER_TASK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use the APIs 'Description.builder().list() ... ' to construct the description ?
Such as PipelineOptions#SERIALIZATION_CONFIG...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pointer, I was not aware of that utility.
flink-core/src/main/java/org/apache/flink/configuration/TraceOptions.java
Outdated
Show resolved
Hide resolved
flink-core/src/main/java/org/apache/flink/configuration/TraceOptions.java
Outdated
Show resolved
Hide resolved
flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/traces/SimpleSpan.java
Outdated
Show resolved
Hide resolved
...ime/src/test/java/org/apache/flink/runtime/checkpoint/DefaultCheckpointStatsTrackerTest.java
Outdated
Show resolved
Hide resolved
assertThat(reportedEvents.size()).isEqualTo(1); | ||
|
||
Map<String, Object> expected = new HashMap<>(); | ||
expected.put("checkpointId", 42L); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this constants be extracted as immutable strings?
- One advantage of doing so is that it avoids using them directly in multiple places.
- Of course, such a change might come at the cost of some readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is worth here due to the sheer amount of the constants 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Could this constants be extracted as immutable strings?
Just a trivial comment. Please ignore it.
What is the purpose of the change
https://cwiki.apache.org/confluence/display/FLINK/FLIP-483%3A+Add+support+for+children+Spans
Brief change log
Please check individual commit messages.
Verifying this change
Adds a couple of unit tests and extends the existing ITCase
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation