Skip to content

Conversation

@susheel-aroskar
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants