Skip to content
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

Add an agent plugin to support elasticsearch7 #6759

Merged
merged 29 commits into from
Apr 16, 2021
Merged

Add an agent plugin to support elasticsearch7 #6759

merged 29 commits into from
Apr 16, 2021

Conversation

zifeihan
Copy link
Member

@zifeihan zifeihan commented Apr 15, 2021

Add an agent plugin to support elasticsearch7

Hello, I found that the current es6 plugin is not applicable to the transport-related api on es7, not only the transport api, so the es7 plugin is used to process the related logic of es7. The following exceptions may occur when using the original es6 plugin, and it will cause span not to exit normally, and threadLocal will not be cleaned up, log message such as

{
  "@timestamp": "2021-04-08 03:53:23:984",
  "agent_name": "teachers@10278",
  "level": "ERROR",
  "throwable": "\njava.lang.NoSuchMethodError: org.elasticsearch.search.SearchHits.getTotalHits()J\n\tat org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.AdapterActionFutureActionGetMethodsInterceptor.parseSearchResponse(AdapterActionFutureActionGetMethodsInterceptor.java:118)\n\tat org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.AdapterActionFutureActionGetMethodsInterceptor.parseResponseInfo(AdapterActionFutureActionGetMethodsInterceptor.java:86)\n\tat org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.AdapterActionFutureActionGetMethodsInterceptor.afterMethod(AdapterActionFutureActionGetMethodsInterceptor.java:66)\n\tat org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:102)\n\tat org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java)\n\tat org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:52)\n\tat com.zhangmen.teacher.service.internal.impl.TeacherArrangeServiceImpl.getBatchTeaSimpleInfoByEs(TeacherArrangeServiceImpl.java:224)\n\tat com.zhangmen.teacher.service.internal.impl.TeacherArrangeServiceImpl$$FastClassBySpringCGLIB$$e5aec092.invoke(<generated>)\n\tat org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)\n\tat org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)\n\tat org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)\n\tat org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.lang.Thread.run(Thread.java:748)\n",
  "logger": "InstMethodsInter",
  "thread": "http-nio-8080-exec-7",
  "message": "class[class org.elasticsearch.action.support.PlainActionFuture] after method[actionGet] intercept failure"
}

@wu-sheng wu-sheng requested a review from dmsolr April 15, 2021 09:58
@wu-sheng wu-sheng added agent Language agent related. feature New feature plugin Plugin for agent or collector. Be used to extend the capabilities of default implementor. labels Apr 15, 2021
@wu-sheng wu-sheng added this to the 8.6.0 milestone Apr 15, 2021
@wu-sheng
Copy link
Member

Hello, I found that the current es6 plugin is not applicable to the transport-related api on es7, not only the transport api, so the es7 plugin is used to process the related logic of es7.

You missed the update of supported-list.md

@wu-sheng
Copy link
Member

@zifeihan Please check CI

@codecov
Copy link

codecov bot commented Apr 15, 2021

Codecov Report

Merging #6759 (104145f) into master (b2216f9) will increase coverage by 2.62%.
The diff coverage is 0.00%.

❗ Current head 104145f differs from pull request most recent head 85d9223. Consider uploading reports for the commit 85d9223 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master    #6759      +/-   ##
============================================
+ Coverage     54.29%   56.92%   +2.62%     
+ Complexity     4194     4175      -19     
============================================
  Files          1801     1037     -764     
  Lines         38545    25785   -12760     
  Branches       4249     2532    -1717     
============================================
- Hits          20928    14677    -6251     
+ Misses        16613     9830    -6783     
- Partials       1004     1278     +274     
Impacted Files Coverage Δ Complexity Δ
.../apm/agent/core/context/ids/GlobalIdGenerator.java 68.18% <0.00%> (-1.39%) 3.00 <0.00> (ø)
...che/skywalking/apm/agent/core/meter/MeterType.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
...e/skywalking/apm/agent/core/meter/CounterMode.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
...org/apache/skywalking/apm/toolkit/meter/Gauge.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
...g/oap/server/core/cluster/ClusterHealthStatus.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
...ng/apm/agent/core/context/trace/LogDataEntity.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
...p/server/core/analysis/metrics/MinLongMetrics.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
...er/exporter/provider/grpc/GRPCExporterSetting.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
...ent/core/plugin/bytebuddy/ReturnTypeNameMatch.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
...core/plugin/bytebuddy/AnnotationTypeNameMatch.java 0.00% <0.00%> (-100.00%) 0.00% <0.00%> (ø%)
... and 1245 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc1043e...85d9223. Read the comment docs.

@zifeihan
Copy link
Member Author

Hello, I found that the current es6 plugin is not applicable to the transport-related api on es7, not only the transport api, so the es7 plugin is used to process the related logic of es7.

You missed the update of supported-list.md

fixed.

@dmsolr
Copy link
Member

dmsolr commented Apr 15, 2021

I just took a look and it is almost ok. Let me have a look tomorrow. :)

@wu-sheng
Copy link
Member

--- /home/runner/work/skywalking/skywalking/tools/plugin/md-javaagent-plugin-list.txt 2021-04-16 00:06:27.776825759 +0000
+++ /home/runner/work/skywalking/skywalking/tools/plugin/genernate-javaagent-plugin-list.txt 2021-04-16 00:06:27.772825656 +0000
@@ -18,0 +19 @@
+elasticsearch-7.x

Please check the CI task, you add a new plugin.

Copy link
Member

@dmsolr dmsolr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let us wait for CI to pass.

@wu-sheng wu-sheng merged commit 3a7d6c0 into apache:master Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Language agent related. feature New feature plugin Plugin for agent or collector. Be used to extend the capabilities of default implementor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants