make sampling still works when the trace ignores plug-in activation (#6146)

This commit is contained in:
Jared Tan 2021-01-07 21:33:01 +08:00 committed by GitHub
parent 1e93cd2860
commit c989bb286c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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();
}
}

View File

@ -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.