-
Notifications
You must be signed in to change notification settings - Fork 320
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
Set stacktrace.abs_path #856
Conversation
Codecov Report
@@ Coverage Diff @@
## master #856 +/- ##
===========================================
+ Coverage 64.22% 64.83% +0.6%
Complexity 84 84
===========================================
Files 230 230
Lines 9329 9449 +120
Branches 1214 1245 +31
===========================================
+ Hits 5992 6126 +134
+ Misses 2956 2945 -11
+ Partials 381 378 -3
Continue to review full report at Codecov.
|
serializeStackFrameModule(stacktrace.getClassName()); | ||
int lastDotIndex = className.lastIndexOf('.'); | ||
if (lastDotIndex > 0) { | ||
writeField("abs_path", className.substring(0, lastDotIndex).replace('.', '/') + "/" + stacktrace.getFileName()); |
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 allocates two String objects (substring()
and replace()
) for each stack frame of each span. Can we use a char-copy to a StringBuilder that includes the char replacement as well?
If so, can it also be used for handling inner classes, lambdas and the like or that using getFileName()
will always be safer?
We decided in today's meeting that it's not a good idea to put a relative path in a field called We discovered discrepancies between the agent implementations as some put a relative path in the Going forward, we should investigate alignment with ECS for stack traces. There are discussions going on at elastic/ecs#154 and elastic/ecs#563. |
To make the integration with the Code app easier, they need the
abs_path
of the stack frame. In Java it's impossible to determine the exact path within the root of the git repository, likeapm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonSerializer.java
but based on the package name and file name, we can get something likeco/elastic/apm/agent/report/serialize/DslJsonSerializer.java
.The question is if it's ok to put a relative path in
abs_path
.Checklist
Update documentationUpdate supported-technologies.asciidocAdded an API method or config option? Document in which version this will be introduced.