susheel-aroskar opened a new pull request, #53076:
URL: https://github.com/apache/spark/pull/53076
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR:
https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g.,
'[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a
faster review.
7. If you want to add a new configuration, please read the guideline first
for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the
guideline first in
'common/utils/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
Optionally transmitting client-side code location details (function name,
file name and line number) along with actions.
### Why are the changes needed?
Right now there is no information sent to Spark Connect server that will aid
in pointing the location of the call (i.e. Spark data frame action) in the
client application code. By making this change, client application call stack
details are sent to the server as a list of (function name, file name, line
number) tuples where they can be logged in the server logs, included in
corresponding open telemetry spans as attributes etc. This will help users
looking from server side UI or Console to quickly pinpoint call locations of
erring or slow calls in their own (client application) code without server
needing to have access to the actual code.
### Does this PR introduce _any_ user-facing change?
It includes a new ENV variable `SPARK_CONNECT_DEBUG_CLIENT_CALL_STACK` which
user can set to true / 1 to opt into transmitting client application code
locations to server. If opted into, the client app call stack trace details are
included in the `user_context.extensions` field of the Spark Connect protobufs
### How was this patch tested?
By adding new unit test `test_client_call_stack_trace.py`
### Was this patch authored or co-authored using generative AI tooling?
Yes.
Some of the unit tests were Generated-by: Cursor
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]