inspectit-ocelot icon indicating copy to clipboard operation
inspectit-ocelot copied to clipboard

Closes #1374 - Add Agent Command to retrieve Jar Dependencies

Open Mahir-Isikli opened this issue 2 years ago • 2 comments

closes #1374

This change is Reviewable

Mahir-Isikli avatar Apr 13 '22 17:04 Mahir-Isikli

Currently the structure of the new command is done.

The presently used logic with the RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean(); String classPath = bean.getClassPath();// is not working as intended and is resulting in an output of only the attached application, i.e. in the case of using the Spring Petclinic.jar the output is path/to/your/app/spring-petclinic.jar:inspectit-ocelot-agent-SNAPSHOT.jar

Mahir-Isikli avatar May 29 '22 22:05 Mahir-Isikli

Codecov Report

Merging #1393 (c1e7ad8) into master (00ee1e3) will decrease coverage by 0.18%. The diff coverage is 56.00%.

:exclamation: Current head c1e7ad8 differs from pull request most recent head 93bcb94. Consider uploading reports for the commit 93bcb94 to get more accurate results

@@             Coverage Diff              @@
##             master    #1393      +/-   ##
============================================
- Coverage     79.09%   78.90%   -0.18%     
+ Complexity     2233     2229       -4     
============================================
  Files           232      233       +1     
  Lines          7240     7267      +27     
  Branches        859      860       +1     
============================================
+ Hits           5726     5734       +8     
- Misses         1157     1175      +18     
- Partials        357      358       +1     
Impacted Files Coverage Δ
...celot/commons/models/command/impl/PingCommand.java 100.00% <ø> (ø)
.../handler/impl/ListDependenciesCommandExecutor.java 13.33% <13.33%> (ø)
...it/ocelot/core/exporter/JaegerExporterService.java 66.10% <66.67%> (-6.24%) :arrow_down:
...spectit/ocelot/commons/models/command/Command.java 100.00% <100.00%> (ø)
...ore/opentelemetry/OpenTelemetryControllerImpl.java 78.12% <100.00%> (ø)
...nspectit/ocelot/core/utils/HighPrecisionTimer.java 90.62% <0.00%> (+1.56%) :arrow_up:

codecov[bot] avatar May 29 '22 23:05 codecov[bot]

In the related Issue https://github.com/inspectIT/inspectit-ocelot/issues/1374 it was mentioned that with an agent command the dependencies of a jar should be listed. After some research I found a partial solution for Maven Projects, where the file structure of the .jar makes it possible to read the dependencies of that jar. However for Gradle Project .jars this method would not work, since they build the Jar differently.

Still there are some tools like jdeps that can be used to get the dependencies of a jar. While I did some personal testing with it, the results where more or less satisfying, which could also be because I don't have much experience with jdeps.

danipaniii avatar Oct 17 '22 16:10 danipaniii

If we ever pick this up, we start from scratch.

quandor avatar Mar 16 '23 14:03 quandor