-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Add ingest/processed/bytes metric #17581
Merged
kfaraz
merged 15 commits into
apache:master
from
neha-ellur:feature-processedBytesMetric
Jan 24, 2025
+61
−2
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7c1e15b
changes
neha-ellur 4991db1
changes
neha-ellur d435068
move the logic
neha-ellur 2a95606
fix imports
neha-ellur 23d6c2f
fix imports
neha-ellur 62b12db
fix checkstyle
neha-ellur b5e6879
fix tests
neha-ellur 6dba948
address comments
neha-ellur 89b1cc3
refactor
neha-ellur 05003c2
cleanup
neha-ellur ce0a935
input bytes metric alreadye exists
neha-ellur 67ad7f6
rename to input bytes
neha-ellur 3db203f
add the parent stage filter
neha-ellur 109b17f
nits
neha-ellur 9f066dd
fix build tests
neha-ellur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This seems like a wrong place to put this logic .
Ingest/processed/bytes seems like a ingestion only metric no ?
If that is the case, we should emit the metric only if the query is an ingestion query.
you could probably expose a method here
https://github.com/apache/druid/blob/9bebe7f1e5ab0f40efbff620769d0413c943683c/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java#L517
saying emit summary metrics and have the task report and the query passed to it.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.
Moved the logic
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 think the place where it has moved is correct.
Rather than ingest in the metric name can we rename the matric to
input/processed/bytes
or something since we would want that metric in msq selects as well.Also the msq code might need to be adjusted so that only leaf nodes contribute to this metric no ? as an equivalent batch ingest with range partitioning will show less
processed bytes
since the shuffle stage input is not being counted for. A simple test should be sufficient to rule this out.Try a query like
replace bar all using select * from extern(http) partitioned by day clustered by col1
and an equivalent range partitioning spec for batch ingestion for the same http input source.cc @kfaraz
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.
@cryptoe This metric will be used in a fronting UI and should be named
ingest/processed/bytes
.Regarding the msq code to being on the leaf nodes, where would that be? Regarding the test, any pointers to existing tests would be helpful, this is my first time in this area of code.
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 am not sure ingest/processed/bytes make sense for select query.
MSQ runs using a DAG of stages.
druid/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/kernel/QueryDefinition.java
Line 48 in cedf9bb
private final Map<StageId, StageDefinition> stageDefinitions;
And each stage definition would have
private final List<InputSpec> inputSpecs;
I think the metric makes sense when we check if the input spec is not a
StageInputSpec
and only then plumb the input bytes to the final summary metric.A UT like this can help you debug stuff :
druid/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQInsertTest.java
Line 404 in cedf9bb
Attach breakpoint to
druid/extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/exec/ControllerImpl.java
Line 372 in cedf9bb
Hope it helps.