inspectIT / inspectit-ocelot

inspectIT Ocelot - Java agent for collecting application performance, tracing and behavior data
http://www.inspectit.rocks/
Apache License 2.0
204 stars 69 forks source link

feat: Implemented functionality to support synchronous instrumentation #1501

Closed ClaudioWaldvogel closed 1 year ago

ClaudioWaldvogel commented 2 years ago

This change is Reviewable

codecov[bot] commented 2 years ago

Codecov Report

Merging #1501 (c3f2388) into master (4ae7a26) will decrease coverage by 1.26%. The diff coverage is 53.91%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1501 +/- ## ============================================ - Coverage 78.64% 77.38% -1.26% - Complexity 2271 2318 +47 ============================================ Files 232 240 +8 Lines 7438 7735 +297 Branches 887 923 +36 ============================================ + Hits 5849 5985 +136 - Misses 1219 1361 +142 - Partials 370 389 +19 ``` | [Impacted Files](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT) | Coverage Δ | | |---|---|---| | [.../src/main/java/com/mindprod/jarcheck/JarCheck.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1jb3JlL3NyYy9tYWluL2phdmEvY29tL21pbmRwcm9kL2phcmNoZWNrL0phckNoZWNrLmphdmE=) | `0.00% <0.00%> (ø)` | | | [.../instrumentation/event/ClassInstrumentedEvent.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1jb3JlL3NyYy9tYWluL2phdmEvcm9ja3MvaW5zcGVjdGl0L29jZWxvdC9jb3JlL2luc3RydW1lbnRhdGlvbi9ldmVudC9DbGFzc0luc3RydW1lbnRlZEV2ZW50LmphdmE=) | `100.00% <ø> (ø)` | | | [...nstrumentation/event/TransformerShutdownEvent.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1jb3JlL3NyYy9tYWluL2phdmEvcm9ja3MvaW5zcGVjdGl0L29jZWxvdC9jb3JlL2luc3RydW1lbnRhdGlvbi9ldmVudC9UcmFuc2Zvcm1lclNodXRkb3duRXZlbnQuamF2YQ==) | `100.00% <ø> (ø)` | | | [...t/ocelot/core/instrumentation/hook/MethodHook.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1jb3JlL3NyYy9tYWluL2phdmEvcm9ja3MvaW5zcGVjdGl0L29jZWxvdC9jb3JlL2luc3RydW1lbnRhdGlvbi9ob29rL01ldGhvZEhvb2suamF2YQ==) | `72.60% <ø> (ø)` | | | [...umentation/injection/JigsawModuleInstrumenter.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1jb3JlL3NyYy9tYWluL2phdmEvcm9ja3MvaW5zcGVjdGl0L29jZWxvdC9jb3JlL2luc3RydW1lbnRhdGlvbi9pbmplY3Rpb24vSmlnc2F3TW9kdWxlSW5zdHJ1bWVudGVyLmphdmE=) | `13.73% <4.17%> (-3.77%)` | :arrow_down: | | [...n/java/rocks/inspectit/ocelot/agent/AgentMain.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1hZ2VudC9zcmMvbWFpbi9qYXZhL3JvY2tzL2luc3BlY3RpdC9vY2Vsb3QvYWdlbnQvQWdlbnRNYWluLmphdmE=) | `42.86% <16.67%> (-4.60%)` | :arrow_down: | | [...onfig/model/ClassInstrumentationConfiguration.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1jb3JlL3NyYy9tYWluL2phdmEvcm9ja3MvaW5zcGVjdGl0L29jZWxvdC9jb3JlL2luc3RydW1lbnRhdGlvbi9jb25maWcvbW9kZWwvQ2xhc3NJbnN0cnVtZW50YXRpb25Db25maWd1cmF0aW9uLmphdmE=) | `88.24% <50.00%> (+0.74%)` | :arrow_up: | | [...service/DynamicallyActivatableServiceObserver.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1jb3JlL3NyYy9tYWluL2phdmEvcm9ja3MvaW5zcGVjdGl0L29jZWxvdC9jb3JlL3NlbGZtb25pdG9yaW5nL3NlcnZpY2UvRHluYW1pY2FsbHlBY3RpdmF0YWJsZVNlcnZpY2VPYnNlcnZlci5qYXZh) | `50.00% <50.00%> (ø)` | | | [...trumentation/transformer/SyncClassTransformer.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1jb3JlL3NyYy9tYWluL2phdmEvcm9ja3MvaW5zcGVjdGl0L29jZWxvdC9jb3JlL2luc3RydW1lbnRhdGlvbi90cmFuc2Zvcm1lci9TeW5jQ2xhc3NUcmFuc2Zvcm1lci5qYXZh) | `56.25% <56.25%> (ø)` | | | [...nstrumentation/TypeDescriptionWithClassLoader.java](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT#diff-aW5zcGVjdGl0LW9jZWxvdC1jb3JlL3NyYy9tYWluL2phdmEvcm9ja3MvaW5zcGVjdGl0L29jZWxvdC9jb3JlL2luc3RydW1lbnRhdGlvbi9UeXBlRGVzY3JpcHRpb25XaXRoQ2xhc3NMb2FkZXIuamF2YQ==) | `69.23% <69.23%> (ø)` | | | ... and [31 more](https://codecov.io/gh/inspectIT/inspectit-ocelot/pull/1501/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=inspectIT) | |
heiko-holz commented 1 year ago

inspectit-ocelot-agent/src/main/java/rocks/inspectit/ocelot/agent/AgentMain.java line 49 at r2 (raw file):

Previously, ClaudioWaldvogel (woodywoodse) wrote…
At this point Spring is not yet intialized

good point :)

heiko-holz commented 1 year ago

inspectit-ocelot-agent/src/main/java/rocks/inspectit/ocelot/agent/AgentMain.java line 96 at r2 (raw file):

Previously, ClaudioWaldvogel (woodywoodse) wrote…
The message says that async is disabled in pre Java 9 environments and this will have significant performance degradations

Ahhh, okay so pre Java 9 we should rather do synchronous instrumentation (what you just have implemented). Got it, thanks!

heiko-holz commented 1 year ago

inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/instrumentation/TypeDescriptionWithClassLoader.java line 58 at r2 (raw file):

Previously, heiko-holz (Heiko Holz) wrote…
I think we resolved this in a discussion. I had the idea that we implement the same `class.staticMethod` structure for the `TypeDescriptionWithClassloader`, so that the access to the `of` method is differently for loaded and for unloaded types. e.g., by implementing nested classes with names such as `ForLoadedType` and `ForUnloadedType` and then have these two classes implement the `of` method

nice idea, not implemented.