You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/01/07 13:33:15 UTC

[skywalking] branch master updated: make sampling still works when the trace ignores plug-in activation (#6146)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new c989bb2  make sampling still works when the trace ignores plug-in activation (#6146)
c989bb2 is described below

commit c989bb286c80cf6341c0a87cd5c6da2168cbf61c
Author: Jared Tan <ji...@daocloud.io>
AuthorDate: Thu Jan 7 21:33:01 2021 +0800

    make sampling still works when the trace ignores plug-in activation (#6146)
---
 CHANGES.md                                                          | 1 +
 .../apm/plugin/trace/ignore/TraceIgnoreExtendService.java           | 6 +++++-
 .../java-agent/agent-optional-plugins/trace-ignore-plugin.md        | 3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/CHANGES.md b/CHANGES.md
index c6e0a45..d63f0cf 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -24,6 +24,7 @@ Release Notes.
 * Fix ArrayBlockingQueueBuffer's useless `IF_POSSIBLE` mode list
 * Support building gRPC TLS channel but CA file is not required.
 * Add Dolphinscheduler plugin definition.
+* Make sampling still works when the trace ignores plug-in activation.
 * Fix mssql-plugin occur ClassCastException when call the method of return generate key.
 
 #### OAP-Backend
diff --git a/apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/TraceIgnoreExtendService.java b/apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/TraceIgnoreExtendService.java
index 71341cd..f826838 100644
--- a/apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/TraceIgnoreExtendService.java
+++ b/apm-sniffer/optional-plugins/trace-ignore-plugin/src/main/java/org/apache/skywalking/apm/plugin/trace/ignore/TraceIgnoreExtendService.java
@@ -37,6 +37,8 @@ public class TraceIgnoreExtendService extends SamplingService {
 
     @Override
     public void boot() {
+        super.boot();
+
         IgnoreConfigInitializer.initialize();
         if (StringUtil.isNotEmpty(IgnoreConfig.Trace.IGNORE_PATH)) {
             patterns = IgnoreConfig.Trace.IGNORE_PATH.split(PATTERN_SEPARATOR);
@@ -53,6 +55,7 @@ public class TraceIgnoreExtendService extends SamplingService {
 
     @Override
     public void shutdown() {
+        super.shutdown();
     }
 
     @Override
@@ -65,10 +68,11 @@ public class TraceIgnoreExtendService extends SamplingService {
                 }
             }
         }
-        return true;
+        return super.trySampling(operationName);
     }
 
     @Override
     public void forceSampled() {
+        super.forceSampled();
     }
 }
diff --git a/docs/en/setup/service-agent/java-agent/agent-optional-plugins/trace-ignore-plugin.md b/docs/en/setup/service-agent/java-agent/agent-optional-plugins/trace-ignore-plugin.md
index 6da90cf..86889f4 100644
--- a/docs/en/setup/service-agent/java-agent/agent-optional-plugins/trace-ignore-plugin.md
+++ b/docs/en/setup/service-agent/java-agent/agent-optional-plugins/trace-ignore-plugin.md
@@ -1,6 +1,9 @@
 ## Support custom trace ignore
 Here is an optional plugin `apm-trace-ignore-plugin`
 
+**Notice:**
+Sampling still works when the trace ignores plug-in activation.
+
 ## Introduce
 - The purpose of this plugin is to filter endpoint which are expected to be ignored by the tracing system.
 - You can setup multiple URL path patterns, The endpoints match these patterns wouldn't be traced.