sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Support Local Variables in stack frames

Open phillipuniverse opened this issue 4 months ago • 5 comments

Problem Statement

I looked around fro local variable support in the Java integration but didn't find it.

I see there was some small level of support added recently at https://github.com/getsentry/sentry-java/pull/4686 but I don't see how to utilize that in a server-side Java/Kotlin process (in my case, a GRPC server in vanilla Kotlin on the AWS Corretto 17 JVM).

Solution Brainstorm

Coming from Rollbar, they were able to get local variables from a stack trace using a native agent. That might be the best hook point for obtaining this data.

phillipuniverse avatar Sep 11 '25 12:09 phillipuniverse

Hey @phillipuniverse thanks for opening this issue.

We can look into adding support, but I can't give any ETA at the moment.

#4686 is just to enable other SDKs using Java SDK under the hood, e.g. the Godot SDK

We already have a sentry-opentelemetry-agent which we may be able to add this to.

We'll update here when we do further investigations.

adinauer avatar Sep 11 '25 13:09 adinauer

Sentry has used -agentpath before but feedback was that it slowed down applications significantly, see https://github.com/getsentry/sentry-java/issues/617 . Not sure why that was.

adinauer avatar Sep 11 '25 13:09 adinauer

@adinauer thanks for the additional context!

Interestingly enough, the Rollbar native agent also had performance issues which I documented here

phillipuniverse avatar Sep 11 '25 14:09 phillipuniverse

Thanks for linking!

adinauer avatar Sep 12 '25 07:09 adinauer