[SPARK-38234] [SQL] [SS] Added structured streaming monitoring APIs.#35547
Closed
yeskarthik wants to merge 1 commit intoapache:branch-3.1from
Closed
[SPARK-38234] [SQL] [SS] Added structured streaming monitoring APIs.#35547yeskarthik wants to merge 1 commit intoapache:branch-3.1from
yeskarthik wants to merge 1 commit intoapache:branch-3.1from
Conversation
Contributor
Author
|
@HeartSaVioR @uncleGen @dongjoon-hyun @xuanyuanking @zsxwing can you please take a look at this PR? Thanks |
|
Can one of the admins verify this patch? |
Member
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Thank you for making a PR, @yeskarthik .
However, Apache Spark has a versioning policy which doesn't allow a new feature or improvement on the released versions.
You can open a PR to master branch for Apache Spark 3.3. Thanks!
Contributor
Author
|
@dongjoon-hyun thank you! I will make a PR against master. |
Member
|
Thank you, @yeskarthik ! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
Add two monitoring REST API endpoints under SQL that provides details about the structured streaming queries. Even though a store exists for it and the data is presented in the UI under the "Structured Streaming" tab, this data is not exposed as a REST API.
Summary API
Returns the summary of all existing streaming queries.
GET
/{appId}/sql/streamingqueriesResponse is list of
StreamingQueryData.Progress API
Returns the progress events of a specific streaming query by
runId. User can also specify how many of the most recent events needs to be retrieved by using thelastquery parameter. By default, we return the most recent progress event i.e. last is set to 1.GET
/{appId}/sql/streamingqueries/{runId}/progress?last={N}Response is list of
StreamingQueryProgress.Note: We are not introducing new object definitions for the response since we are just returning the data from the store without aggregation, these are existing event structures -
StreamingQueryDataandStreamingQueryProgress.Why are the changes needed?
This data can be used for monitoring, detecting streaming and to build custom dashboards. This monitoring API will be similar to the monitoring APIs that are present for DStreams - refer SPARK-18470.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Added 4 tests under

SqlResourceWithActualMetricsSuiteto test the endpoints when streaming code is executed. Tested various cases, parameters, boundary conditionsAdded 2 tests under

SqlResourceInvalidEndpointSuite.scalato test the endpoints when no streaming code is running.As mentioned earlier, since we are just returning the objects from the store, there is no need to test them individually.