This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 94889e8e2cd remove opentracing module from agent (#24796)
94889e8e2cd is described below
commit 94889e8e2cdcdad1094e1c0077d7720318855960
Author: jiangML <[email protected]>
AuthorDate: Sat Mar 25 11:56:57 2023 +0800
remove opentracing module from agent (#24796)
* remove opentracing module
* remove the description related to the opentracing plugin for agent doc
* remove tracing config from agent.yaml of metrics e2e
* remove opentracing from agent.yaml
* remove opentracing module dependency from pom.xml
---
agent/plugins/tracing/type/opentracing/pom.xml | 90 ----------------
.../OpenTracingPluginLifecycleService.java | 58 -----------
.../OpenTracingJDBCExecutorCallbackAdvice.java | 63 -----------
.../advice/OpenTracingRootSpanAdvice.java | 52 ----------
.../advice/OpenTracingSQLParserEngineAdvice.java | 57 ----------
.../opentracing/constant/ErrorLogTagKeys.java | 36 -------
.../opentracing/span/OpenTracingErrorSpan.java | 52 ----------
.../META-INF/conf/opentracing-advisors.yaml | 57 ----------
...shardingsphere.agent.spi.PluginLifecycleService | 18 ----
.../OpenTracingPluginLifecycleServiceTest.java | 43 --------
.../OpenTracingJDBCExecutorCallbackAdviceTest.java | 102 ------------------
.../advice/OpenTracingRootSpanAdviceTest.java | 115 ---------------------
.../OpenTracingSQLParserEngineAdviceTest.java | 91 ----------------
agent/plugins/tracing/type/pom.xml | 1 -
distribution/agent/pom.xml | 5 -
.../agent/src/main/resources/conf/agent.yaml | 5 +-
docs/document/content/dev-manual/agent.cn.md | 1 -
docs/document/content/dev-manual/agent.en.md | 1 -
.../content/reference/observability/_index.cn.md | 2 +-
.../content/reference/observability/_index.en.md | 4 +-
.../shardingsphere-jdbc/observability/_index.cn.md | 6 +-
.../shardingsphere-jdbc/observability/_index.en.md | 6 +-
.../observability/_index.cn.md | 6 +-
.../observability/_index.en.md | 6 +-
.../test/resources/docker/agent/conf/agent.yaml | 23 -----
25 files changed, 8 insertions(+), 892 deletions(-)
diff --git a/agent/plugins/tracing/type/opentracing/pom.xml
b/agent/plugins/tracing/type/opentracing/pom.xml
deleted file mode 100644
index 24d8c1a308d..00000000000
--- a/agent/plugins/tracing/type/opentracing/pom.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-agent-tracing-type</artifactId>
- <version>5.3.2-SNAPSHOT</version>
- </parent>
- <artifactId>shardingsphere-agent-tracing-opentracing</artifactId>
- <name>${project.artifactId}</name>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-test-util</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>io.opentracing</groupId>
- <artifactId>opentracing-api</artifactId>
- </dependency>
- <dependency>
- <groupId>io.opentracing</groupId>
- <artifactId>opentracing-util</artifactId>
- </dependency>
- <dependency>
- <groupId>io.opentracing</groupId>
- <artifactId>opentracing-mock</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-shade-plugin</artifactId>
- <configuration>
-
<outputFile>${target.directory}/${project.build.finalName}.jar</outputFile>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>shade</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <relocations>
- <relocation>
- <pattern>com.google</pattern>
-
<shadedPattern>${shade.package}.com.google</shadedPattern>
- </relocation>
- <relocation>
- <pattern>net.bytebuddy</pattern>
-
<shadedPattern>${shade.package}.net.bytebuddy</shadedPattern>
- </relocation>
- <relocation>
- <pattern>io.opentracing</pattern>
-
<shadedPattern>${shade.package}.io.opentracing</shadedPattern>
- </relocation>
- <relocation>
- <pattern>org.checkerframework</pattern>
-
<shadedPattern>${shade.package}.org.checkerframework</shadedPattern>
- </relocation>
- </relocations>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/OpenTracingPluginLifecycleService.java
b/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/OpenTracingPluginLifecycleService.java
deleted file mode 100644
index 2b1ba77bb1c..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/OpenTracingPluginLifecycleService.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing;
-
-import com.google.common.base.Preconditions;
-import io.opentracing.Tracer;
-import io.opentracing.util.GlobalTracer;
-import org.apache.shardingsphere.agent.api.PluginConfiguration;
-import org.apache.shardingsphere.agent.spi.PluginLifecycleService;
-
-/**
- * Open tracing plugin lifecycle service.
- */
-public final class OpenTracingPluginLifecycleService implements
PluginLifecycleService {
-
- private static final String KEY_OPENTRACING_TRACER_CLASS_NAME =
"opentracing-tracer-class-name";
-
- @Override
- public void start(final PluginConfiguration pluginConfig, final boolean
isEnhancedForProxy) {
- String tracerClassName =
pluginConfig.getProps().getProperty(KEY_OPENTRACING_TRACER_CLASS_NAME);
- Preconditions.checkNotNull(tracerClassName, "Can not find opentracing
tracer implementation in you config");
- try {
- init((Tracer)
Class.forName(tracerClassName).getDeclaredConstructor().newInstance());
- } catch (final ReflectiveOperationException ex) {
- throw new RuntimeException("Initialize opentracing tracer class
failure.", ex);
- }
- }
-
- private void init(final Tracer tracer) {
- if (!GlobalTracer.isRegistered()) {
- GlobalTracer.register(tracer);
- }
- }
-
- @Override
- public void close() {
- }
-
- @Override
- public String getType() {
- return "OpenTracing";
- }
-}
diff --git
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingJDBCExecutorCallbackAdvice.java
b/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingJDBCExecutorCallbackAdvice.java
deleted file mode 100644
index 5911e4d9fe3..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingJDBCExecutorCallbackAdvice.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice;
-
-import io.opentracing.Scope;
-import io.opentracing.Span;
-import io.opentracing.Tracer;
-import io.opentracing.util.GlobalTracer;
-import org.apache.shardingsphere.agent.api.advice.TargetAdviceObject;
-import
org.apache.shardingsphere.agent.plugin.tracing.core.advice.TracingJDBCExecutorCallbackAdvice;
-import
org.apache.shardingsphere.agent.plugin.tracing.core.constant.AttributeConstants;
-import
org.apache.shardingsphere.agent.plugin.tracing.opentracing.span.OpenTracingErrorSpan;
-import org.apache.shardingsphere.infra.database.metadata.DataSourceMetaData;
-import
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit;
-
-import java.lang.reflect.Method;
-
-/**
- * OpenTracing JDBC executor callback advice executor.
- */
-public final class OpenTracingJDBCExecutorCallbackAdvice extends
TracingJDBCExecutorCallbackAdvice<Span> {
-
- @Override
- protected void recordExecuteInfo(final Span parentSpan, final
TargetAdviceObject target, final JDBCExecutionUnit executionUnit, final boolean
isTrunkThread, final DataSourceMetaData metaData,
- final String databaseType) {
- Tracer.SpanBuilder builder =
GlobalTracer.get().buildSpan(OPERATION_NAME);
- builder.asChildOf(parentSpan)
- .withTag(AttributeConstants.COMPONENT,
AttributeConstants.COMPONENT_NAME)
- .withTag(AttributeConstants.DB_TYPE, databaseType)
- .withTag(AttributeConstants.DB_INSTANCE,
executionUnit.getExecutionUnit().getDataSourceName())
- .withTag(AttributeConstants.DB_STATEMENT,
executionUnit.getExecutionUnit().getSqlUnit().getSql())
- .withTag(AttributeConstants.DB_BIND_VARIABLES,
executionUnit.getExecutionUnit().getSqlUnit().getParameters().toString())
- .withTag(AttributeConstants.SPAN_KIND,
AttributeConstants.SPAN_KIND_CLIENT);
- target.setAttachment(builder.startActive(true));
- }
-
- @Override
- public void afterMethod(final TargetAdviceObject target, final Method
method, final Object[] args, final Object result, final String pluginType) {
- ((Scope) target.getAttachment()).close();
- }
-
- @Override
- public void onThrowing(final TargetAdviceObject target, final Method
method, final Object[] args, final Throwable throwable, final String
pluginType) {
- Scope scope = (Scope) target.getAttachment();
- OpenTracingErrorSpan.setError(scope.span(), throwable);
- scope.close();
- }
-}
diff --git
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingRootSpanAdvice.java
b/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingRootSpanAdvice.java
deleted file mode 100644
index 8adf13b9f37..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingRootSpanAdvice.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice;
-
-import io.opentracing.Span;
-import io.opentracing.util.GlobalTracer;
-import org.apache.shardingsphere.agent.api.advice.TargetAdviceObject;
-import
org.apache.shardingsphere.agent.plugin.tracing.core.advice.TracingRootSpanAdvice;
-import
org.apache.shardingsphere.agent.plugin.tracing.core.constant.AttributeConstants;
-import
org.apache.shardingsphere.agent.plugin.tracing.opentracing.span.OpenTracingErrorSpan;
-
-import java.lang.reflect.Method;
-
-/**
- * OpenTracing root span advice.
- */
-public final class OpenTracingRootSpanAdvice extends
TracingRootSpanAdvice<Span> {
-
- @Override
- protected Span createRootSpan(final TargetAdviceObject target, final
Method method, final Object[] args) {
- return GlobalTracer.get().buildSpan(OPERATION_NAME)
- .withTag(AttributeConstants.COMPONENT,
AttributeConstants.COMPONENT_NAME)
- .withTag(AttributeConstants.SPAN_KIND,
AttributeConstants.SPAN_KIND_CLIENT)
- .startActive(true).span();
- }
-
- @Override
- protected void finishRootSpan(final Span rootSpan, final
TargetAdviceObject target) {
- rootSpan.finish();
- }
-
- @Override
- protected void recordException(final Span rootSpan, final
TargetAdviceObject target, final Throwable throwable) {
- OpenTracingErrorSpan.setError(rootSpan, throwable);
- finishRootSpan(rootSpan, target);
- }
-}
diff --git
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingSQLParserEngineAdvice.java
b/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingSQLParserEngineAdvice.java
deleted file mode 100644
index afe4da69459..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingSQLParserEngineAdvice.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice;
-
-import io.opentracing.Scope;
-import io.opentracing.Span;
-import io.opentracing.util.GlobalTracer;
-import org.apache.shardingsphere.agent.api.advice.TargetAdviceObject;
-import
org.apache.shardingsphere.agent.plugin.tracing.core.advice.TracingSQLParserEngineAdvice;
-import
org.apache.shardingsphere.agent.plugin.tracing.core.constant.AttributeConstants;
-import
org.apache.shardingsphere.agent.plugin.tracing.opentracing.span.OpenTracingErrorSpan;
-
-import java.lang.reflect.Method;
-
-/**
- * OpenTracing SQL parser engine advice executor.
- */
-public final class OpenTracingSQLParserEngineAdvice extends
TracingSQLParserEngineAdvice<Span> {
-
- @Override
- protected Object recordSQLParseInfo(final Span parentSpan, final
TargetAdviceObject target, final String sql) {
- Scope result =
GlobalTracer.get().buildSpan(OPERATION_NAME).asChildOf(parentSpan)
- .withTag(AttributeConstants.COMPONENT,
AttributeConstants.COMPONENT_NAME)
- .withTag(AttributeConstants.DB_STATEMENT, sql)
- .withTag(AttributeConstants.SPAN_KIND,
AttributeConstants.SPAN_KIND_INTERNAL)
- .startActive(true);
- target.setAttachment(result);
- return result;
- }
-
- @Override
- public void afterMethod(final TargetAdviceObject target, final Method
method, final Object[] args, final Object result, final String pluginType) {
- ((Scope) target.getAttachment()).close();
- }
-
- @Override
- public void onThrowing(final TargetAdviceObject target, final Method
method, final Object[] args, final Throwable throwable, final String
pluginType) {
- Scope scope = (Scope) target.getAttachment();
- OpenTracingErrorSpan.setError(scope.span(), throwable);
- scope.close();
- }
-}
diff --git
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/constant/ErrorLogTagKeys.java
b/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/constant/ErrorLogTagKeys.java
deleted file mode 100644
index 6b7cdc3e50a..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/constant/ErrorLogTagKeys.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing.constant;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-/**
- * Error log tag keys.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ErrorLogTagKeys {
-
- public static final String EVENT = "event";
-
- public static final String EVENT_ERROR_TYPE = "error";
-
- public static final String ERROR_KIND = "error.kind";
-
- public static final String MESSAGE = "message";
-}
diff --git
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/span/OpenTracingErrorSpan.java
b/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/span/OpenTracingErrorSpan.java
deleted file mode 100644
index 5b18394ac65..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/span/OpenTracingErrorSpan.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing.span;
-
-import io.opentracing.Span;
-import io.opentracing.tag.Tags;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import
org.apache.shardingsphere.agent.plugin.tracing.opentracing.constant.ErrorLogTagKeys;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Open tracing error span.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class OpenTracingErrorSpan {
-
- /**
- * Set error.
- *
- * @param span span to be set
- * @param cause failure cause of span
- */
- public static void setError(final Span span, final Throwable cause) {
- span.setTag(Tags.ERROR.getKey(), true).log(System.currentTimeMillis(),
getReason(cause));
- }
-
- private static Map<String, ?> getReason(final Throwable cause) {
- Map<String, String> result = new HashMap<>(3, 1);
- result.put(ErrorLogTagKeys.EVENT, ErrorLogTagKeys.EVENT_ERROR_TYPE);
- result.put(ErrorLogTagKeys.ERROR_KIND, cause.getClass().getName());
- result.put(ErrorLogTagKeys.MESSAGE, cause.getMessage());
- return result;
- }
-}
diff --git
a/agent/plugins/tracing/type/opentracing/src/main/resources/META-INF/conf/opentracing-advisors.yaml
b/agent/plugins/tracing/type/opentracing/src/main/resources/META-INF/conf/opentracing-advisors.yaml
deleted file mode 100644
index d28b70f26cc..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/main/resources/META-INF/conf/opentracing-advisors.yaml
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-advisors:
- - target:
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask
- advice:
org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice.OpenTracingRootSpanAdvice
- pointcuts:
- - name: run
- type: method
- - target:
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSphereStatement
- advice:
org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice.OpenTracingRootSpanAdvice
- pointcuts:
- - name: executeQuery
- type: method
- - name: execute
- type: method
- - name: executeUpdate
- type: method
- params:
- - index: 0
- type: java.lang.String
- - target:
org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement
- advice:
org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice.OpenTracingRootSpanAdvice
- pointcuts:
- - name: executeQuery
- type: method
- - name: execute
- type: method
- - name: executeUpdate
- type: method
- - target:
org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine
- advice:
org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice.OpenTracingSQLParserEngineAdvice
- pointcuts:
- - name: parse
- type: method
- - target:
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback
- advice:
org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice.OpenTracingJDBCExecutorCallbackAdvice
- pointcuts:
- - name: execute
- type: method
- params:
- - index: 0
- type:
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit
diff --git
a/agent/plugins/tracing/type/opentracing/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.PluginLifecycleService
b/agent/plugins/tracing/type/opentracing/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.PluginLifecycleService
deleted file mode 100644
index ad23bc65f4a..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/main/resources/META-INF/services/org.apache.shardingsphere.agent.spi.PluginLifecycleService
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-org.apache.shardingsphere.agent.plugin.tracing.opentracing.OpenTracingPluginLifecycleService
diff --git
a/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/OpenTracingPluginLifecycleServiceTest.java
b/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/OpenTracingPluginLifecycleServiceTest.java
deleted file mode 100644
index a649e583212..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/OpenTracingPluginLifecycleServiceTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing;
-
-import io.opentracing.util.GlobalTracer;
-import org.apache.shardingsphere.agent.api.PluginConfiguration;
-import org.apache.shardingsphere.test.util.PropertiesBuilder;
-import org.apache.shardingsphere.test.util.PropertiesBuilder.Property;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public final class OpenTracingPluginLifecycleServiceTest {
-
- private final OpenTracingPluginLifecycleService pluginLifecycleService =
new OpenTracingPluginLifecycleService();
-
- @AfterEach
- public void close() {
- pluginLifecycleService.close();
- }
-
- @Test
- public void assertStart() {
- pluginLifecycleService.start(new PluginConfiguration("localhost",
8090, "", PropertiesBuilder.build(new Property("opentracing-tracer-class-name",
"io.opentracing.mock.MockTracer"))), true);
- assertTrue(GlobalTracer.isRegistered());
- }
-}
diff --git
a/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingJDBCExecutorCallbackAdviceTest.java
b/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingJDBCExecutorCallbackAdviceTest.java
deleted file mode 100644
index 22f569ef1f4..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingJDBCExecutorCallbackAdviceTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice;
-
-import io.opentracing.mock.MockSpan;
-import io.opentracing.mock.MockTracer;
-import io.opentracing.util.GlobalTracer;
-import
org.apache.shardingsphere.agent.plugin.tracing.advice.AbstractJDBCExecutorCallbackAdviceTest;
-import
org.apache.shardingsphere.agent.plugin.tracing.core.constant.AttributeConstants;
-import
org.apache.shardingsphere.agent.plugin.tracing.opentracing.constant.ErrorLogTagKeys;
-import
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutionUnit;
-import
org.apache.shardingsphere.infra.executor.sql.execute.engine.driver.jdbc.JDBCExecutorCallback;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.mockito.internal.configuration.plugins.Plugins;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public final class OpenTracingJDBCExecutorCallbackAdviceTest extends
AbstractJDBCExecutorCallbackAdviceTest {
-
- private static MockTracer tracer;
-
- private static Method executeMethod;
-
- @BeforeAll
- public static void setup() throws ReflectiveOperationException {
- if (!GlobalTracer.isRegistered()) {
- GlobalTracer.register(new MockTracer());
- }
- tracer = (MockTracer)
Plugins.getMemberAccessor().get(GlobalTracer.class.getDeclaredField("tracer"),
GlobalTracer.get());
- executeMethod =
JDBCExecutorCallback.class.getDeclaredMethod("execute",
JDBCExecutionUnit.class, boolean.class);
- }
-
- @BeforeEach
- public void reset() {
- tracer.reset();
- }
-
- @Test
- public void assertMethod() {
- OpenTracingJDBCExecutorCallbackAdvice advice = new
OpenTracingJDBCExecutorCallbackAdvice();
- advice.beforeMethod(getTargetObject(), executeMethod, new
Object[]{getExecutionUnit(), false, Collections.emptyList()}, "OpenTracing");
- advice.afterMethod(getTargetObject(), executeMethod, new
Object[]{getExecutionUnit(), false, Collections.emptyList()}, null,
"OpenTracing");
- List<MockSpan> spans = tracer.finishedSpans();
- assertThat(spans.size(), is(1));
- MockSpan span = spans.get(0);
- Map<String, Object> tags = span.tags();
- assertTrue(spans.get(0).logEntries().isEmpty());
- assertThat(span.operationName(), is("/ShardingSphere/executeSQL/"));
- assertThat(tags.get(AttributeConstants.COMPONENT),
is(AttributeConstants.COMPONENT_NAME));
- assertThat(tags.get(AttributeConstants.DB_INSTANCE),
is(DATA_SOURCE_NAME));
- assertThat(tags.get(AttributeConstants.DB_TYPE),
is(getDatabaseType(DATA_SOURCE_NAME)));
- assertThat(tags.get(AttributeConstants.DB_STATEMENT), is(SQL));
- assertThat(tags.get(AttributeConstants.SPAN_KIND),
is(AttributeConstants.SPAN_KIND_CLIENT));
- }
-
- @Test
- public void assertExceptionHandle() {
- Map<String, Object> extraMap = Collections.singletonMap("_root_span_",
null);
- OpenTracingJDBCExecutorCallbackAdvice advice = new
OpenTracingJDBCExecutorCallbackAdvice();
- advice.beforeMethod(getTargetObject(), executeMethod, new
Object[]{getExecutionUnit(), false, extraMap}, "OpenTracing");
- advice.onThrowing(getTargetObject(), executeMethod, new
Object[]{getExecutionUnit(), false, extraMap}, new IOException(),
"OpenTracing");
- List<MockSpan> spans = tracer.finishedSpans();
- assertThat(spans.size(), is(1));
- MockSpan span = spans.get(0);
- List<MockSpan.LogEntry> entries = span.logEntries();
- Map<String, ?> fields = entries.get(0).fields();
- assertThat(fields.get(ErrorLogTagKeys.EVENT), is("error"));
- assertThat(fields.get(ErrorLogTagKeys.ERROR_KIND),
is("java.io.IOException"));
- Map<String, Object> tags = span.tags();
- assertThat(span.operationName(), is("/ShardingSphere/executeSQL/"));
- assertThat(tags.get(AttributeConstants.COMPONENT),
is(AttributeConstants.COMPONENT_NAME));
- assertThat(tags.get(AttributeConstants.DB_INSTANCE),
is(DATA_SOURCE_NAME));
- assertThat(tags.get(AttributeConstants.DB_TYPE),
is(getDatabaseType(DATA_SOURCE_NAME)));
- assertThat(tags.get(AttributeConstants.DB_STATEMENT), is(SQL));
- assertThat(tags.get(AttributeConstants.SPAN_KIND),
is(AttributeConstants.SPAN_KIND_CLIENT));
- }
-}
diff --git
a/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingRootSpanAdviceTest.java
b/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingRootSpanAdviceTest.java
deleted file mode 100644
index da946277792..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingRootSpanAdviceTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice;
-
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.util.DefaultAttributeMap;
-import io.opentracing.mock.MockSpan;
-import io.opentracing.mock.MockSpan.LogEntry;
-import io.opentracing.mock.MockTracer;
-import io.opentracing.util.GlobalTracer;
-import org.apache.shardingsphere.agent.api.advice.TargetAdviceObject;
-import org.apache.shardingsphere.agent.plugin.tracing.TracingAgentExtension;
-import
org.apache.shardingsphere.agent.plugin.tracing.core.constant.AttributeConstants;
-import org.apache.shardingsphere.db.protocol.payload.PacketPayload;
-import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
-import org.apache.shardingsphere.mode.manager.ContextManager;
-import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
-import org.apache.shardingsphere.proxy.backend.session.ConnectionSession;
-import org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask;
-import org.apache.shardingsphere.test.mock.AutoMockExtension;
-import org.apache.shardingsphere.test.mock.StaticMockSettings;
-import org.apache.shardingsphere.transaction.api.TransactionType;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
-import org.mockito.internal.configuration.plugins.Plugins;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-@ExtendWith({TracingAgentExtension.class, AutoMockExtension.class})
-@StaticMockSettings(ProxyContext.class)
-public final class OpenTracingRootSpanAdviceTest {
-
- private static final OpenTracingRootSpanAdvice ADVICE = new
OpenTracingRootSpanAdvice();
-
- private static MockTracer tracer;
-
- private static Method executeCommandMethod;
-
- private TargetAdviceObject targetObject;
-
- @BeforeAll
- public static void setup() throws ReflectiveOperationException {
- if (!GlobalTracer.isRegistered()) {
- GlobalTracer.register(new MockTracer());
- }
- tracer = (MockTracer)
Plugins.getMemberAccessor().get(GlobalTracer.class.getDeclaredField("tracer"),
GlobalTracer.get());
- executeCommandMethod =
CommandExecutorTask.class.getDeclaredMethod("executeCommand",
ChannelHandlerContext.class, PacketPayload.class);
- }
-
- @BeforeEach
- public void reset() {
- tracer.reset();
-
when(ProxyContext.getInstance().getContextManager()).thenReturn(mock(ContextManager.class,
RETURNS_DEEP_STUBS));
- ConnectionSession connectionSession = new
ConnectionSession(mock(MySQLDatabaseType.class), TransactionType.BASE, new
DefaultAttributeMap());
- Object executorTask = new CommandExecutorTask(null, connectionSession,
null, null);
- targetObject = (TargetAdviceObject) executorTask;
- }
-
- @Test
- public void assertMethod() {
- ADVICE.beforeMethod(targetObject, executeCommandMethod, new
Object[]{}, "OpenTracing");
- ADVICE.afterMethod(targetObject, executeCommandMethod, new Object[]{},
null, "OpenTracing");
- List<MockSpan> spans = tracer.finishedSpans();
- assertThat(spans.size(), is(1));
- assertTrue(spans.get(0).logEntries().isEmpty());
- assertThat(spans.get(0).operationName(),
is("/ShardingSphere/rootInvoke/"));
- assertThat(spans.get(0).tags().get(AttributeConstants.COMPONENT),
is(AttributeConstants.COMPONENT_NAME));
- assertThat(spans.get(0).tags().get(AttributeConstants.SPAN_KIND),
is(AttributeConstants.SPAN_KIND_CLIENT));
- }
-
- @Test
- public void assertExceptionHandle() {
- ADVICE.beforeMethod(targetObject, executeCommandMethod, new
Object[]{}, "OpenTracing");
- ADVICE.onThrowing(targetObject, executeCommandMethod, new Object[]{},
new IOException(), "OpenTracing");
- List<MockSpan> spans = tracer.finishedSpans();
- assertThat(spans.size(), is(1));
- MockSpan span = spans.get(0);
- assertTrue((boolean) span.tags().get("error"));
- List<LogEntry> entries = span.logEntries();
- assertThat(entries.size(), is(1));
- Map<String, ?> fields = entries.get(0).fields();
- assertThat(fields.get("event"), is("error"));
- assertNull(fields.get("message"));
- assertThat(fields.get("error.kind"), is("java.io.IOException"));
- assertThat(span.operationName(), is("/ShardingSphere/rootInvoke/"));
- }
-}
diff --git
a/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingSQLParserEngineAdviceTest.java
b/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingSQLParserEngineAdviceTest.java
deleted file mode 100644
index 3b788e51acd..00000000000
---
a/agent/plugins/tracing/type/opentracing/src/test/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/advice/OpenTracingSQLParserEngineAdviceTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.agent.plugin.tracing.opentracing.advice;
-
-import io.opentracing.mock.MockSpan;
-import io.opentracing.mock.MockTracer;
-import io.opentracing.util.GlobalTracer;
-import
org.apache.shardingsphere.agent.plugin.tracing.advice.AbstractJDBCExecutorCallbackAdviceTest;
-import
org.apache.shardingsphere.agent.plugin.tracing.core.constant.AttributeConstants;
-import
org.apache.shardingsphere.agent.plugin.tracing.opentracing.constant.ErrorLogTagKeys;
-import org.apache.shardingsphere.infra.parser.ShardingSphereSQLParserEngine;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.mockito.internal.configuration.plugins.Plugins;
-
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.Map;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-public final class OpenTracingSQLParserEngineAdviceTest extends
AbstractJDBCExecutorCallbackAdviceTest {
-
- private static final OpenTracingSQLParserEngineAdvice ADVICE = new
OpenTracingSQLParserEngineAdvice();
-
- private static MockTracer tracer;
-
- private static Method parserMethod;
-
- @BeforeAll
- public static void setup() throws ReflectiveOperationException {
- if (!GlobalTracer.isRegistered()) {
- GlobalTracer.register(new MockTracer());
- }
- tracer = (MockTracer)
Plugins.getMemberAccessor().get(GlobalTracer.class.getDeclaredField("tracer"),
GlobalTracer.get());
- parserMethod =
ShardingSphereSQLParserEngine.class.getDeclaredMethod("parse", String.class,
boolean.class);
- }
-
- @BeforeEach
- public void reset() {
- tracer.reset();
- }
-
- @Test
- public void assertMethod() {
- ADVICE.beforeMethod(getTargetObject(), parserMethod, new
Object[]{"select 1"}, "OpenTracing");
- ADVICE.afterMethod(getTargetObject(), parserMethod, new Object[]{},
null, "OpenTracing");
- List<MockSpan> spans = tracer.finishedSpans();
- assertThat(spans.size(), is(1));
- assertTrue(spans.get(0).logEntries().isEmpty());
- assertThat(spans.get(0).operationName(),
is("/ShardingSphere/parseSQL/"));
- assertThat(spans.get(0).tags().get(AttributeConstants.COMPONENT),
is(AttributeConstants.COMPONENT_NAME));
- assertThat(spans.get(0).tags().get(AttributeConstants.DB_STATEMENT),
is("select 1"));
- assertThat(spans.get(0).tags().get(AttributeConstants.SPAN_KIND),
is(AttributeConstants.SPAN_KIND_INTERNAL));
- }
-
- @Test
- public void assertExceptionHandle() {
- ADVICE.beforeMethod(getTargetObject(), parserMethod, new
Object[]{"select 1"}, "OpenTracing");
- ADVICE.onThrowing(getTargetObject(), parserMethod, new Object[]{}, new
IOException(), "OpenTracing");
- List<MockSpan> spans = tracer.finishedSpans();
- assertThat(spans.size(), is(1));
- MockSpan span = spans.get(0);
- assertTrue((boolean) span.tags().get("error"));
- List<MockSpan.LogEntry> entries = span.logEntries();
- assertThat(entries.size(), is(1));
- Map<String, ?> fields = entries.get(0).fields();
- assertThat(fields.get(ErrorLogTagKeys.EVENT), is("error"));
- assertThat(fields.get(ErrorLogTagKeys.ERROR_KIND),
is("java.io.IOException"));
- assertThat(span.operationName(), is("/ShardingSphere/parseSQL/"));
- }
-}
diff --git a/agent/plugins/tracing/type/pom.xml
b/agent/plugins/tracing/type/pom.xml
index 0c9a5a4ce23..828af42196d 100644
--- a/agent/plugins/tracing/type/pom.xml
+++ b/agent/plugins/tracing/type/pom.xml
@@ -29,7 +29,6 @@
<name>${project.artifactId}</name>
<modules>
- <module>opentracing</module>
<module>opentelemetry</module>
</modules>
diff --git a/distribution/agent/pom.xml b/distribution/agent/pom.xml
index 60894c4a6f4..b1cfca8febb 100644
--- a/distribution/agent/pom.xml
+++ b/distribution/agent/pom.xml
@@ -44,11 +44,6 @@
<artifactId>shardingsphere-agent-logging-file</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-agent-tracing-opentracing</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-agent-tracing-opentelemetry</artifactId>
diff --git a/distribution/agent/src/main/resources/conf/agent.yaml
b/distribution/agent/src/main/resources/conf/agent.yaml
index 8391790a527..6c71cf58852 100644
--- a/distribution/agent/src/main/resources/conf/agent.yaml
+++ b/distribution/agent/src/main/resources/conf/agent.yaml
@@ -31,8 +31,5 @@ plugins:
# props:
# otel.service.name: "shardingsphere"
# otel.traces.exporter: "jaeger"
-# otel.exporter.otlp.traces.endpoint: "http://localhost:14250"
# otel.traces.sampler: "always_on"
-# OpenTracing:
-# props:
-# opentracing-tracer-class-name:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
\ No newline at end of file
+# otel.exporter.otlp.traces.endpoint: "http://localhost:14250"
diff --git a/docs/document/content/dev-manual/agent.cn.md
b/docs/document/content/dev-manual/agent.cn.md
index 012e6bdc515..fce8bf5d4f3 100644
--- a/docs/document/content/dev-manual/agent.cn.md
+++ b/docs/document/content/dev-manual/agent.cn.md
@@ -22,4 +22,3 @@ chapter = true
| File | File 插件生命周期管理类 |
[`org.apache.shardingsphere.agent.plugin.logging.file.FileLoggingPluginLifecycleService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/FileLoggingPluginLifecycleService.java)
|
| Prometheus | Prometheus 插件生命周期管理类 |
[`org.apache.shardingsphere.agent.plugin.metrics.prometheus.PrometheusPluginLifecycleService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/metrics/type/prometheus/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/prometheus/PrometheusPluginLifecycleService.java)
|
| OpenTelemetry | OpenTelemetry 插件生命周期管理类 |
[`org.apache.shardingsphere.agent.plugin.tracing.opentelemetry.OpenTelemetryTracingPluginLifecycleService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/type/opentelemetry/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/OpenTelemetryTracingPluginLifecycleService.java)
|
-| OpenTracing | OpenTracing 插件生命周期管理类 |
[`org.apache.shardingsphere.agent.plugin.tracing.opentracing.OpenTracingPluginLifecycleService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/OpenTracingPluginLifecycleService.java)
|
diff --git a/docs/document/content/dev-manual/agent.en.md
b/docs/document/content/dev-manual/agent.en.md
index d72088839a5..aa19be00a45 100644
--- a/docs/document/content/dev-manual/agent.en.md
+++ b/docs/document/content/dev-manual/agent.en.md
@@ -22,4 +22,3 @@ Plug lifecycle management interface
| File | Logging plug lifecycle management class
|
[`org.apache.shardingsphere.agent.plugin.logging.file.FileLoggingPluginLifecycleService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/logging/type/file/src/main/java/org/apache/shardingsphere/agent/plugin/logging/file/FileLoggingPluginLifecycleService.java)
|
| Prometheus | Prometheus plug lifecycle management class
|
[`org.apache.shardingsphere.agent.plugin.metrics.prometheus.PrometheusPluginLifecycleService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/metrics/type/prometheus/src/main/java/org/apache/shardingsphere/agent/plugin/metrics/prometheus/PrometheusPluginLifecycleService.java)
|
| OpenTelemetry | OpenTelemetryTracing plug lifecycle management class
|
[`org.apache.shardingsphere.agent.plugin.tracing.opentelemetry.OpenTelemetryTracingPluginLifecycleService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/type/opentelemetry/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentelemetry/OpenTelemetryTracingPluginLifecycleService.java)
|
-| OpenTracing | OpenTracing plug lifecycle management class
|
[`org.apache.shardingsphere.agent.plugin.tracing.opentracing.OpenTracingPluginLifecycleService`](https://github.com/apache/shardingsphere/blob/master/agent/plugins/tracing/type/opentracing/src/main/java/org/apache/shardingsphere/agent/plugin/tracing/opentracing/OpenTracingPluginLifecycleService.java)
|
diff --git a/docs/document/content/reference/observability/_index.cn.md
b/docs/document/content/reference/observability/_index.cn.md
index b9f60427738..7a8bceabdd4 100644
--- a/docs/document/content/reference/observability/_index.cn.md
+++ b/docs/document/content/reference/observability/_index.cn.md
@@ -13,5 +13,5 @@ Metrics、Tracing 和 Logging 等功能均通过插件的方式集成在 Agent

- Metrics 插件用于收集和展示整个集群的统计指标。Apache ShardingSphere 默认提供了对 Prometheus 的支持。
-- Tracing 插件用于获取 SQL 解析与 SQL 执行的链路跟踪信息。Apache ShardingSphere 默认提供了对
Jaeger、OpenTelemetry、OpenTracing(SkyWalking)和 Zipkin 的支持,也支持用户通过插件化的方式开发自定义的
Tracing 组件。
+- Tracing 插件用于获取 SQL 解析与 SQL 执行的链路跟踪信息。Apache ShardingSphere 默认提供了导出 tracing
数据到 Jaeger、和 Zipkin 的支持,也支持用户通过插件化的方式开发自定义的 Tracing 组件。
- 默认的 Logging 插件展示了如何在 ShardingSphere 中记录额外的日志,实际应用中需要用户根据自己的需求进行探索。
diff --git a/docs/document/content/reference/observability/_index.en.md
b/docs/document/content/reference/observability/_index.en.md
index 50d5b5d108b..c23408ebed7 100644
--- a/docs/document/content/reference/observability/_index.en.md
+++ b/docs/document/content/reference/observability/_index.en.md
@@ -12,6 +12,6 @@ Metrics, tracing and logging functions are integrated into
the agent through plu

-- The Metrics plugin is used to collect and display statistical indicators for
the entire cluster. Apache ShardingSphere supports Prometheus by default.
-- The tracing plugin is used to obtain the link trace information of SQL
parsing and SQL execution. Apache ShardingSphere provides support for Jaeger,
OpenTelemetry, OpenTracing(SkyWalking) and Zipkin by default. It also supports
users developing customized tracing components through plugin.
+- The metrics plugin is used to collect and display statistical indicators for
the entire cluster. Apache ShardingSphere supports Prometheus by default.
+- The tracing plugin is used to obtain the link trace information of SQL
parsing and SQL execution. Apache ShardingSphere provides support for exporting
tracing data to Jaeger and Zipkin by default. It also supports users developing
customized tracing components through plugin.
- The default logging plugin shows how to record additional logs in
ShardingSphere. In practical applications, users need to explore according to
their own needs.
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/observability/_index.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/observability/_index.cn.md
index 0b415b93a48..d196b8e4683 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/observability/_index.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/observability/_index.cn.md
@@ -39,14 +39,13 @@ tree
│ │ └──
shardingsphere-agent-metrics-prometheus-${latest.release.version}.jar
│ └── tracing
│ ├──
shardingsphere-agent-tracing-opentelemetry-${latest.release.version}.jar
-│ └──
shardingsphere-agent-tracing-opentracing-${latest.release.version}.jar
└── shardingsphere-agent-${latest.release.version}.jar
```
Agent 日志输出位置在 `agent/logs/stdout.log`。
### 配置说明
-`conf/agent.yaml` 用于管理 agent 配置。内置插件包括
File、Prometheus、OpenTelemetry、OpenTracing。
+`conf/agent.yaml` 用于管理 agent 配置。内置插件包括 File、Prometheus、OpenTelemetry。
```yaml
plugins:
@@ -67,9 +66,6 @@ plugins:
# otel.traces.exporter: "jaeger"
# otel.exporter.otlp.traces.endpoint: "http://localhost:14250"
# otel.traces.sampler: "always_on"
-# OpenTracing:
-# props:
-# opentracing-tracer-class-name:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
```
### 插件说明
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/observability/_index.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/observability/_index.en.md
index f2c096a5a68..b8490de1b06 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/observability/_index.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/observability/_index.en.md
@@ -40,7 +40,6 @@ tree
│ │ └──
shardingsphere-agent-metrics-prometheus-${latest.release.version}.jar
│ └── tracing
│ ├──
shardingsphere-agent-tracing-opentelemetry-${latest.release.version}.jar
-│ └──
shardingsphere-agent-tracing-opentracing-${latest.release.version}.jar
└── shardingsphere-agent-${latest.release.version}.jar
```
Agent log output location is `agent/logs/stdout.log`.
@@ -48,7 +47,7 @@ Agent log output location is `agent/logs/stdout.log`.
### Configuration
`conf/agent.yaml` is used to manage agent configuration.
-Built-in plugins include File, Prometheus, OpenTelemetry, OpenTracing.
+Built-in plugins include File, Prometheus, OpenTelemetry.
```yaml
plugins:
@@ -69,9 +68,6 @@ plugins:
# otel.traces.exporter: "jaeger"
# otel.exporter.otlp.traces.endpoint: "http://localhost:14250"
# otel.traces.sampler: "always_on"
-# OpenTracing:
-# props:
-# opentracing-tracer-class-name:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
```
### Plugin description
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 1f25a6a65c5..f19dba39a28 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
@@ -39,14 +39,13 @@ tree
│ │ └──
shardingsphere-agent-metrics-prometheus-${latest.release.version}.jar
│ └── tracing
│ ├──
shardingsphere-agent-tracing-opentelemetry-${latest.release.version}.jar
-│ └──
shardingsphere-agent-tracing-opentracing-${latest.release.version}.jar
└── shardingsphere-agent-${latest.release.version}.jar
```
Agent 日志输出位置在 `agent/logs/stdout.log`。
### 配置说明
-`conf/agent.yaml` 用于管理 agent 配置。内置插件包括
File、Prometheus、OpenTelemetry、OpenTracing。
+`conf/agent.yaml` 用于管理 agent 配置。内置插件包括 File、Prometheus、OpenTelemetry。
```yaml
plugins:
@@ -67,9 +66,6 @@ plugins:
# otel.traces.exporter: "jaeger"
# otel.exporter.otlp.traces.endpoint: "http://localhost:14250"
# otel.traces.sampler: "always_on"
-# OpenTracing:
-# props:
-# opentracing-tracer-class-name:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
```
### 插件说明
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 d4ca137bb4f..c176ecc15cb 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
@@ -40,7 +40,6 @@ tree
│ │ └──
shardingsphere-agent-metrics-prometheus-${latest.release.version}.jar
│ └── tracing
│ ├──
shardingsphere-agent-tracing-opentelemetry-${latest.release.version}.jar
-│ └──
shardingsphere-agent-tracing-opentracing-${latest.release.version}.jar
└── shardingsphere-agent-${latest.release.version}.jar
```
Agent log output location is `agent/logs/stdout.log`.
@@ -48,7 +47,7 @@ Agent log output location is `agent/logs/stdout.log`.
### Configuration
`conf/agent.yaml` is used to manage agent configuration.
-Built-in plugins include File, Prometheus, OpenTelemetry, OpenTracing.
+Built-in plugins include File, Prometheus, OpenTelemetry.
```yaml
plugins:
@@ -69,9 +68,6 @@ plugins:
# otel.traces.exporter: "jaeger"
# otel.exporter.otlp.traces.endpoint: "http://localhost:14250"
# otel.traces.sampler: "always_on"
-# OpenTracing:
-# props:
-# opentracing-tracer-class-name:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
```
### Plugin description
diff --git
a/test/e2e/agent/plugins/metrics/prometheus/src/test/resources/docker/agent/conf/agent.yaml
b/test/e2e/agent/plugins/metrics/prometheus/src/test/resources/docker/agent/conf/agent.yaml
index db0a729ea0c..18b1e1dd90a 100644
---
a/test/e2e/agent/plugins/metrics/prometheus/src/test/resources/docker/agent/conf/agent.yaml
+++
b/test/e2e/agent/plugins/metrics/prometheus/src/test/resources/docker/agent/conf/agent.yaml
@@ -26,26 +26,3 @@ plugins:
port: 19099
props:
jvm-information-collector-enabled: "true"
- tracing:
-# Jaeger:
-# host: "localhost"
-# port: 5775
-# props:
-# service-name: "shardingsphere"
-# jaeger-sampler-type: "const"
-# jaeger-sampler-param: "1"
-# Zipkin:
-# host: "localhost"
-# port: 9411
-# props:
-# service-name: "shardingsphere"
-# url-version: "/api/v2/spans"
-# sampler-type: "const"
-# sampler-param: "1"
-# OpenTracing:
-# props:
-# opentracing-tracer-class-name:
"org.apache.skywalking.apm.toolkit.opentracing.SkywalkingTracer"
-# OpenTelemetry:
-# props:
-# otel-resource-attributes: "service.name=shardingsphere"
-# otel-traces-exporter: "zipkin"