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

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


The following commit(s) were added to refs/heads/master by this push:
     new 12917decd19 optimize jaeger (#23477)
12917decd19 is described below

commit 12917decd192b4267c228db409c9ffc505e59844
Author: jiangML <[email protected]>
AuthorDate: Tue Jan 10 19:01:55 2023 +0800

    optimize jaeger (#23477)
---
 .../src/main/resources/conf/agent.yaml             |  4 ++-
 .../jaeger/advice/JDBCExecutorCallbackAdvice.java  |  6 ++--
 .../observability/_index.cn.md                     | 32 ++++++++++++----------
 .../observability/_index.en.md                     | 32 ++++++++++++----------
 pom.xml                                            |  3 ++
 5 files changed, 45 insertions(+), 32 deletions(-)

diff --git a/agent/distribution/src/main/resources/conf/agent.yaml 
b/agent/distribution/src/main/resources/conf/agent.yaml
index e6e1e521e8e..794a39a2db2 100644
--- a/agent/distribution/src/main/resources/conf/agent.yaml
+++ b/agent/distribution/src/main/resources/conf/agent.yaml
@@ -29,11 +29,13 @@ plugins:
 #  tracing:
 #    Jaeger:
 #      host: "localhost"
-#      port: 5775
+#      port: 6831
 #      props:
 #        service-name: "shardingsphere"
 #        jaeger-sampler-type: "const"
 #        jaeger-sampler-param: "1"
+#        jaeger-reporter-flush-interval: "1000"
+#        jaeger-reporter-max-queue-size: "100"
 #    Zipkin:
 #      host: "localhost"
 #      port: 9411
diff --git 
a/agent/plugins/tracing/type/jaeger/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/JDBCExecutorCallbackAdvice.java
 
b/agent/plugins/tracing/type/jaeger/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/JDBCExecutorCallbackAdvice.java
index 2dbed12b4b3..97390597ddf 100644
--- 
a/agent/plugins/tracing/type/jaeger/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/JDBCExecutorCallbackAdvice.java
+++ 
b/agent/plugins/tracing/type/jaeger/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/jaeger/advice/JDBCExecutorCallbackAdvice.java
@@ -49,10 +49,10 @@ public final class JDBCExecutorCallbackAdvice implements 
InstanceMethodAdvice {
     @SneakyThrows({ReflectiveOperationException.class, SQLException.class})
     @SuppressWarnings("unchecked")
     public void beforeMethod(final TargetAdviceObject target, final Method 
method, final Object[] args) {
-        Span root = (Span) ((Map<String, Object>) 
args[2]).get(JaegerConstants.ROOT_SPAN);
+        Span rootSpan = (Span) ((Map<String, Object>) 
args[2]).get(JaegerConstants.ROOT_SPAN);
         Tracer.SpanBuilder builder = 
GlobalTracer.get().buildSpan(OPERATION_NAME);
-        if (null != root) {
-            builder = builder.asChildOf(root);
+        if (null != rootSpan) {
+            builder = builder.asChildOf(rootSpan);
         }
         JDBCExecutionUnit executionUnit = (JDBCExecutionUnit) args[0];
         Map<String, DatabaseType> storageTypes = 
AgentReflectionUtil.getFieldValue(target, "storageTypes");
diff --git 
a/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
 
b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
index 872670bc541..9226204b4bf 100644
--- 
a/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
+++ 
b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.cn.md
@@ -64,11 +64,13 @@ plugins:
 #  tracing:
 #    Jaeger:
 #      host: "localhost"
-#      port: 5775
+#      port: 6831
 #      props:
 #        service-name: "shardingsphere"
 #        jaeger-sampler-type: "const"
 #        jaeger-sampler-param: "1"
+#        jaeger-reporter-flush-interval: "1000"
+#        jaeger-reporter-max-queue-size: "100"
 #    Zipkin:
 #      host: "localhost"
 #      port: 9411
@@ -88,19 +90,21 @@ plugins:
 
 * 参数说明;
 
-| 名称                                | 说明                  |取值范围    | 默认值       
                        |
-|:----------------------------------|:--------------------|:--------- 
|:----------------------------------|
-| jvm-information-collector-enabled | 是否开启 JVM 采集器        |true、false| true    
                          |
-| service-name                      | 链路跟踪的服务名称           | 自定义 | 
shardingsphere                    |
-| jaeger-sampler-type               | Jaeger 采样率类型        | 
const、probabilistic、ratelimiting、remote | const                             |
-| jaeger-sampler-param              | Jaeger 采样率参数        
|const:0、1,probabilistic:0.0 - 1.0,ratelimiting:> 
0,自定义每秒采集数量,remote:需要自定义配置远程采样率管理服务地址,JAEGER_SAMPLER_MANAGER_HOST_PORT | 
1(const 类型)                       |
-| url-version                       | Zipkin url 地址       | 自定义 | 
/api/v2/spans                    |
-| sampler-type                      | Zipkin 采样率类型        
|const、counting、ratelimiting、boundary | const                             |
-| sampler-param                     | Zipkin 采样率参数        |const: 
0、1,counting:0.01 - 1.0,ratelimiting:> 0,自定义每秒采集数量,boundary: 0.0001 - 1.0 | 
1(const 类型)                       |
-| otel-resource-attributes          | opentelemetry 资源属性  | 字符串键值对(,分割) | 
service.name=shardingsphere-agent |
-| otel-traces-exporter              | Tracing expoter     | zipkin、jaeger | 
zipkin                            |
-| otel-traces-sampler               | opentelemetry 采样率类型 | 
always_on、always_off、traceidratio | always_on                         |
-| otel-traces-sampler-arg           | opentelemetry 采样率参数 | traceidratio:0.0 - 
1.0 | 1.0                               |
+| 名称                                | 说明                        | 取值范围         
                                                                                
                           | 默认值                               |
+|:----------------------------------|:--------------------------|:------------------------------------------------------------------------------------------------------------------------|:----------------------------------|
+| jvm-information-collector-enabled | 是否开启 JVM 采集器             | true、false    
                                                                                
                          | true                              |
+| service-name                      | 链路跟踪的服务名称               | 自定义            
                                                                                
                         | shardingsphere                    |
+| jaeger-sampler-type               | Jaeger 采样率类型              | 
const、probabilistic、ratelimiting、remote                                         
                                        | const                             |
+| jaeger-sampler-param              | Jaeger 采样率参数              | 
const:0、1,probabilistic:0.0 - 1.0,ratelimiting:> 
0,自定义每秒采集数量,remote:需要自定义配置远程采样率管理服务地址,JAEGER_SAMPLER_MANAGER_HOST_PORT | 
1(const 类型)                       |
+| jaeger-reporter-flush-interval    | Jaeger 上报数据刷新间隔(毫秒)     | 自定义            
                                                                                
                         | 1000                              |
+| jaeger-reporter-max-queue-size    | Jaeger 上报 span 时最大队列大小   | 自定义           
                                                                      | 100     
                          |
+| url-version                       | Zipkin url 地址                 | 自定义      
                                                                                
                               | /api/v2/spans                     |
+| sampler-type                      | Zipkin 采样率类型                | 
const、counting、ratelimiting、boundary                                            
                                        | const                             |
+| sampler-param                     | Zipkin 采样率参数                | const: 
0、1,counting:0.01 - 1.0,ratelimiting:> 0,自定义每秒采集数量,boundary: 0.0001 - 1.0       
                                 | 1(const 类型)                       |
+| otel-resource-attributes          | opentelemetry 资源属性          | 
字符串键值对(,分割)                                                                     
                                        | service.name=shardingsphere-agent |
+| otel-traces-exporter              | Tracing expoter                 | 
zipkin、jaeger                                                                   
                                        | zipkin                            |
+| otel-traces-sampler               | opentelemetry 采样率类型         | 
always_on、always_off、traceidratio                                               
                                        | always_on                         |
+| otel-traces-sampler-arg           | opentelemetry 采样率参数         | 
traceidratio:0.0 - 1.0                                                          
                                        | 1.0                               |
 
 ## ShardingSphere-Proxy 中使用
 
diff --git 
a/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
 
b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
index bab6de554bf..4c5aff82b4e 100644
--- 
a/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
+++ 
b/docs/document/content/user-manual/shardingsphere-proxy/observability/_index.en.md
@@ -65,11 +65,13 @@ plugins:
 #  tracing:
 #    Jaeger:
 #      host: "localhost"
-#      port: 5775
+#      port: 6831
 #      props:
 #        service-name: "shardingsphere"
 #        jaeger-sampler-type: "const"
 #        jaeger-sampler-param: "1"
+#        jaeger-reporter-flush-interval: "1000"
+#        jaeger-reporter-max-queue-size: "100"
 #    Zipkin:
 #      host: "localhost"
 #      port: 9411
@@ -89,19 +91,21 @@ plugins:
 
 * Parameter description:
 
-| Name                              | Description                         |  
Value range    |  Default value     |
-|:----------------------------------|:------------------------------------|:---------
 | :-------- |
-| jvm-information-collector-enabled | Start JVM collector                 |  
true, false  |  true  |
-| service-name                      | Tracking service name               | 
Custom | shardingsphere-agent |
-| jaeger-sampler-type               | Jaeger sample rate type             | 
const, probabilistic, ratelimiting, remote | const |
-| jaeger-sampler-param              | Jaeger sample rate parameter        
|const:0, 1, probabilistic:0.0 - 1.0, ratelimiting: > 0, Customize the number 
of acquisitions per second, remote:need to customize the remote service 
addres,JAEGER_SAMPLER_MANAGER_HOST_PORT | 1 (const type) |
-| url-version                       | Zipkin url address                  | 
Custom | /api/v2/spans                    |
-| sampler-type                      | Zipkin sample rate type             | 
const, counting, ratelimiting, boundary | const |
-| sampler-param                     | Zipkin sampling rate parameter      
|const:0, 1, counting:0.01 - 1.0, ratelimiting: > 0, boundary:0.0001 - 1.0 | 1 
(const type) |
-| otel-resource-attributes          | opentelemetry properties            | 
String key value pair (, split) | service.name=shardingsphere-agent |
-| otel-traces-exporter              | Tracing expoter                     | 
zipkin, jaeger | zipkin |
-| otel-traces-sampler               | Opentelemetry sample rate type      | 
always_on, always_off, traceidratio | always_on |
-| otel-traces-sampler-arg           | Opentelemetry sample rate parameter | 
traceidratio:0.0 - 1.0 | 1.0 |
+| Name                              | Description                              
                             | Value range                                      
                                                                                
                                                            | Default value     
                |
+|:----------------------------------|:----------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------|
+| jvm-information-collector-enabled | Start JVM collector                      
                             | true, false                                      
                                                                                
                                                            | true              
                |
+| service-name                      | Tracking service name                    
                             | Custom                                           
                                                                                
                                                            | 
shardingsphere-agent              |
+| jaeger-sampler-type               | Jaeger sample rate type                  
                             | const, probabilistic, ratelimiting, remote       
                                                                                
                                                            | const             
                |
+| jaeger-sampler-param              | Jaeger sample rate parameter             
                             | const:0, 1, probabilistic:0.0 - 1.0, 
ratelimiting: > 0, Customize the number of acquisitions per second, remote:need 
to customize the remote service addres,JAEGER_SAMPLER_MANAGER_HOST_PORT| 1 
(const type)                    |
+| jaeger-reporter-flush-interval    | Jaeger the flush interval when reporting 
spans remotely (millisecond) | Custom                                           
                                                                                
                                                            | 1000              
                |
+| jaeger-reporter-max-queue-size    | Jaeger the maximum queue size for use 
when reporting spans remotely   | Custom                                        
                                                                                
                                                               | 100            
                   |
+| url-version                       | Zipkin url address                       
                             | Custom                                           
                                                                                
                                                            | /api/v2/spans     
                |
+| sampler-type                      | Zipkin sample rate type                  
                             | const, counting, ratelimiting, boundary          
                                                                                
                                                            | const             
                |
+| sampler-param                     | Zipkin sampling rate parameter           
                             | const:0, 1, counting:0.01 - 1.0, ratelimiting: > 
0, boundary:0.0001 - 1.0                                                        
                                                            | 1 (const type)    
                |
+| otel-resource-attributes          | opentelemetry properties                 
                             | String key value pair (, split)                  
                                                                                
                                                            | 
service.name=shardingsphere-agent |
+| otel-traces-exporter              | Tracing expoter                          
                             | zipkin, jaeger                                   
                                                                                
                                                            | zipkin            
                |
+| otel-traces-sampler               | Opentelemetry sample rate type           
                             | always_on, always_off, traceidratio              
                                                                                
                                                            | always_on         
                |
+| otel-traces-sampler-arg           | Opentelemetry sample rate parameter      
                             | traceidratio:0.0 - 1.0                           
                                                                                
                                                            | 1.0               
                |
 
 ## Usage in ShardingSphere-Proxy
 
diff --git a/pom.xml b/pom.xml
index 8489cba04a0..178024903ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -698,6 +698,9 @@
                                 </excludes>
                             </filter>
                         </filters>
+                        <transformers>
+                            <transformer 
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"
 />
+                        </transformers>
                     </configuration>
                 </plugin>
                 <plugin>

Reply via email to