Add an agent plugin to support Jackson#39
Conversation
There was a problem hiding this comment.
Apart from the comments inline, I'd also like to discuss whether we should also include part of the JSON string / bytes in the trace, for example, collect the first 64 bytes as a tag content and the 64 is configurable.
Currently we only have the time cost in (de)serializing and the length of the content, but it makes little sense that we don't know what the content is when the time cost is too long, including part of the content might give the users some hints what content makes the JSON lib slower.
...n/src/main/java/org/apache/skywalking/apm/plugin/jackson/define/AbstractInstrumentation.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/org/apache/skywalking/apm/plugin/jackson/define/AbstractInstrumentation.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/skywalking/apm/plugin/jackson/define/ObjectMapperInstrumentation.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/skywalking/apm/plugin/jackson/define/ObjectMapperInstrumentation.java
Outdated
Show resolved
Hide resolved
...x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jackson/BasicMethodsInterceptor.java
Show resolved
Hide resolved
...n/src/main/java/org/apache/skywalking/apm/plugin/jackson/define/AbstractInstrumentation.java
Outdated
Show resolved
Hide resolved
…org/apache/skywalking/apm/plugin/jackson/define/ObjectMapperInstrumentation.java Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
…org/apache/skywalking/apm/plugin/jackson/define/AbstractInstrumentation.java Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
…org/apache/skywalking/apm/plugin/jackson/define/AbstractInstrumentation.java Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
Agree, collecting content is a risk. I prefer we don't do this. |
I think that providing JSON length can satisfy most user scenarios. It is not recommended to collect JSON content. |
|
@kezhenxu94 use the guava |
ok. We need some adjustments of the check style settings |
|
@kezhenxu94 use the Is it necessary to do this? |
I think guava is bundled with agent core already |
It doesn't look like this now. the <dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
......
</dependencyManagement>and the <dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>apm-agent-core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency> |
|
Using this 3rd party APIs, AFAIK, you need to shade. This dependency is there, but indirectly(gRPC depending on it) and shaded in the runtime. |
I noticed this, the source code shaded in |
|
Plugin default class loader is singleton and wouldn't be GC. Any new class file loaded will be a load for JVM memory permanently. Let's try to keep plugin codes as simple as possible. |
Use guava |
OK I remember it wrong, what is bundled is GSON dependency. But the idea is not to create too many anonymous inner classes, initializing the map in constructor is also good to me |
|
@wu-sheng @kezhenxu94 How about init |
Okay to me |
Thank u. |
|
@kezhenxu94 |
kezhenxu94
left a comment
There was a problem hiding this comment.
Thank you @VictorZeng . One nit: it seems that you didn't import our code style settings, the new files still don't respect to the code styles, please consider import our code style settings if you are going to contribute later
Thank you for review, I will import the checkstyle. |
* main: (28 commits) fix release doc (#61) Support Jedis' Transaction and fix duplicated enhancement (#57) Initialize 8.9.0 iteration (#59) Polish release shell and doc. (#58) fix rocketmq message header properties garbled characters issue (#54) Fix netty-socketio plugin test failure (#56) Add okhttp2.x plugin (#49) add e2e test for kafka transporter (#42) Fix version badge (#53) Add JDK17 supported declaration. (#52) Fix instrumentation v2 API doesn't work for constructor instrumentation. (#51) Add kylin jdbc plugin (#45) Fix version compatibility for JSON-RPC4J Plugin (#50) Feature add clickhouse jdbc plugin (#41) Update menu.yml (#48) Fix format. (#47) Add new menu for the document (#46) Doc: Update setup agent in kubernetes from 'containers' to 'initContainers'. (#44) The httpasyncclient-4.x-plugin does not take effect every time. (#40) Add an agent plugin to support Jackson (#39) ... # Conflicts: # .github/workflows/plugins-test.3.yaml # CHANGES.md # docs/en/setup/service-agent/java-agent/README.md # docs/menu.yml
Co-authored-by: Evan <evanljp@outlook.com>
Add an agent plugin to support
JacksonCHANGESlog.