You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by ty...@apache.org on 2021/08/11 09:45:25 UTC
[incubator-shenyu] branch master updated: init shenyu-agent (#1917)
This is an automated email from the ASF dual-hosted git repository.
tydhot pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 40f3db6 init shenyu-agent (#1917)
40f3db6 is described below
commit 40f3db6ac2187f7336485207c8a27fcd41e4cd2e
Author: xiaoyu <xi...@apache.org>
AuthorDate: Wed Aug 11 17:45:17 2021 +0800
init shenyu-agent (#1917)
---
pom.xml | 9 ++
shenyu-agent/pom.xml | 69 ++++++++++++
.../shenyu-agent-api}/pom.xml | 18 ++-
.../shenyu/agent/config/AgentPluginConfig.java | 122 +++++++++++++++++++++
.../shenyu/agent/exception/AgentException.java | 28 +++++
.../shenyu/agent/spi/AgentPluginBootService.java | 33 ++++++
shenyu-agent/shenyu-agent-bootstrap/pom.xml | 97 ++++++++++++++++
.../agent/bootstrap/ShenyuAgentBootstrap.java | 35 ++++++
shenyu-agent/shenyu-agent-core/pom.xml | 78 +++++++++++++
.../shenyu-agent-plugins}/pom.xml | 17 +--
.../shenyu-agent-plugin-tracing}/pom.xml | 15 +--
.../shenyu-agent-plugin-tracing-jaeger}/pom.xml | 16 +--
shenyu-dist/pom.xml | 1 +
shenyu-dist/shenyu-agent-dist/pom.xml | 54 +++++++++
.../shenyu-agent-dist/src/main/assembly/binary.xml | 71 ++++++++++++
.../src/main/resources/logback.xml | 97 ++++++++++++++++
16 files changed, 724 insertions(+), 36 deletions(-)
diff --git a/pom.xml b/pom.xml
index da52b79..f10cf44 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,6 +43,7 @@
<module>shenyu-disruptor</module>
<module>shenyu-protocol</module>
<module>shenyu-dist</module>
+ <module>shenyu-agent</module>
</modules>
<licenses>
@@ -139,6 +140,7 @@
<maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version>
<frontend-maven-plugin.version>1.6</frontend-maven-plugin.version>
<frontend-maven-plugin.node.version>v12.14.1</frontend-maven-plugin.node.version>
+ <bytebuddy.version>1.10.16</bytebuddy.version>
</properties>
<dependencyManagement>
@@ -151,6 +153,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
+
+ <dependency>
+ <groupId>net.bytebuddy</groupId>
+ <artifactId>byte-buddy</artifactId>
+ <version>${bytebuddy.version}</version>
+ </dependency>
+
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
diff --git a/shenyu-agent/pom.xml b/shenyu-agent/pom.xml
new file mode 100644
index 0000000..467cc0f
--- /dev/null
+++ b/shenyu-agent/pom.xml
@@ -0,0 +1,69 @@
+<?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">
+ <parent>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu</artifactId>
+ <version>2.4.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>shenyu-agent</artifactId>
+ <name>${project.artifactId}</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>shenyu-agent-api</module>
+ <module>shenyu-agent-bootstrap</module>
+ <module>shenyu-agent-core</module>
+ <module>shenyu-agent-plugins</module>
+ </modules>
+
+ <properties>
+ <maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
+ <shade.package>org.apache.shenyu.dependencies</shade.package>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>net.bytebuddy</groupId>
+ <artifactId>byte-buddy</artifactId>
+ <version>${bytebuddy.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>net.bytebuddy</groupId>
+ <artifactId>byte-buddy-agent</artifactId>
+ <version>${bytebuddy.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>${maven-shade-plugin.version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/shenyu-dist/pom.xml b/shenyu-agent/shenyu-agent-api/pom.xml
similarity index 67%
copy from shenyu-dist/pom.xml
copy to shenyu-agent/shenyu-agent-api/pom.xml
index 8bbe155..fbff340 100644
--- a/shenyu-dist/pom.xml
+++ b/shenyu-agent/shenyu-agent-api/pom.xml
@@ -16,19 +16,15 @@
~ 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">
+<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">
<parent>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu</artifactId>
+ <artifactId>shenyu-agent</artifactId>
<version>2.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-dist</artifactId>
- <packaging>pom</packaging>
-
- <modules>
- <module>shenyu-src-dist</module>
- <module>shenyu-admin-dist</module>
- <module>shenyu-bootstrap-dist</module>
- </modules>
-</project>
+ <artifactId>shenyu-agent-api</artifactId>
+
+</project>
\ No newline at end of file
diff --git a/shenyu-agent/shenyu-agent-api/src/main/java/org/apache/shenyu/agent/config/AgentPluginConfig.java b/shenyu-agent/shenyu-agent-api/src/main/java/org/apache/shenyu/agent/config/AgentPluginConfig.java
new file mode 100644
index 0000000..dacda8a
--- /dev/null
+++ b/shenyu-agent/shenyu-agent-api/src/main/java/org/apache/shenyu/agent/config/AgentPluginConfig.java
@@ -0,0 +1,122 @@
+/*
+ * 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.shenyu.agent.config;
+
+import java.util.Properties;
+
+
+/**
+ * The type Agent plugin config.
+ */
+public final class AgentPluginConfig {
+
+ private String host;
+
+ private int port;
+
+ private String password;
+
+ private Properties props;
+
+ /**
+ * Instantiates a new Agent plugin config.
+ *
+ * @param host the host
+ * @param port the port
+ * @param password the password
+ * @param props the props
+ */
+ public AgentPluginConfig(final String host, final int port, final String password, final Properties props) {
+ this.host = host;
+ this.port = port;
+ this.password = password;
+ this.props = props;
+ }
+
+ /**
+ * Gets host.
+ *
+ * @return the host
+ */
+ public String getHost() {
+ return host;
+ }
+
+ /**
+ * Sets host.
+ *
+ * @param host the host
+ */
+ public void setHost(final String host) {
+ this.host = host;
+ }
+
+ /**
+ * Gets port.
+ *
+ * @return the port
+ */
+ public int getPort() {
+ return port;
+ }
+
+ /**
+ * Sets port.
+ *
+ * @param port the port
+ */
+ public void setPort(final int port) {
+ this.port = port;
+ }
+
+ /**
+ * Gets password.
+ *
+ * @return the password
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * Sets password.
+ *
+ * @param password the password
+ */
+ public void setPassword(final String password) {
+ this.password = password;
+ }
+
+ /**
+ * Gets props.
+ *
+ * @return the props
+ */
+ public Properties getProps() {
+ return props;
+ }
+
+ /**
+ * Sets props.
+ *
+ * @param props the props
+ */
+ public void setProps(final Properties props) {
+ this.props = props;
+ }
+}
diff --git a/shenyu-agent/shenyu-agent-api/src/main/java/org/apache/shenyu/agent/exception/AgentException.java b/shenyu-agent/shenyu-agent-api/src/main/java/org/apache/shenyu/agent/exception/AgentException.java
new file mode 100644
index 0000000..c8f30b5
--- /dev/null
+++ b/shenyu-agent/shenyu-agent-api/src/main/java/org/apache/shenyu/agent/exception/AgentException.java
@@ -0,0 +1,28 @@
+/*
+ * 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.shenyu.agent.exception;
+
+/**
+ * Agent exception.
+ */
+public final class AgentException extends RuntimeException {
+
+ public AgentException(final String errorMessage, final Object... args) {
+ super(String.format(errorMessage, args));
+ }
+}
diff --git a/shenyu-agent/shenyu-agent-api/src/main/java/org/apache/shenyu/agent/spi/AgentPluginBootService.java b/shenyu-agent/shenyu-agent-api/src/main/java/org/apache/shenyu/agent/spi/AgentPluginBootService.java
new file mode 100644
index 0000000..620b7a7
--- /dev/null
+++ b/shenyu-agent/shenyu-agent-api/src/main/java/org/apache/shenyu/agent/spi/AgentPluginBootService.java
@@ -0,0 +1,33 @@
+/*
+ * 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.shenyu.agent.spi;
+
+import org.apache.shenyu.agent.config.AgentPluginConfig;
+
+/**
+ * Agent Plugin boot service that the lifecycle is from the agent start to shutdown.
+ */
+public interface AgentPluginBootService extends AutoCloseable {
+
+ /**
+ * Start.
+ *
+ * @param agentPluginConfig the agent plugin config
+ */
+ void start(AgentPluginConfig agentPluginConfig);
+}
diff --git a/shenyu-agent/shenyu-agent-bootstrap/pom.xml b/shenyu-agent/shenyu-agent-bootstrap/pom.xml
new file mode 100644
index 0000000..f52823f
--- /dev/null
+++ b/shenyu-agent/shenyu-agent-bootstrap/pom.xml
@@ -0,0 +1,97 @@
+<?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">
+ <parent>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-agent</artifactId>
+ <version>2.4.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>shenyu-agent-bootstrap</artifactId>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <premain.class>org.apache.shenyu.agent.bootstrap.ShenyuAgentBootstrap</premain.class>
+ <can.redefine.classes>true</can.redefine.classes>
+ <can.retransform.classes>true</can.retransform.classes>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-agent-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-agent-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <finalName>shenyu-agent</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <shadedArtifactAttached>false</shadedArtifactAttached>
+ <createDependencyReducedPom>true</createDependencyReducedPom>
+ <createSourcesJar>true</createSourcesJar>
+ <shadeSourcesContent>true</shadeSourcesContent>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+ <manifestEntries>
+ <Premain-Class>${premain.class}</Premain-Class>
+ <Can-Redefine-Classes>${can.redefine.classes}</Can-Redefine-Classes>
+ <Can-Retransform-Classes>${can.retransform.classes}</Can-Retransform-Classes>
+ </manifestEntries>
+ </transformer>
+ </transformers>
+ <artifactSet>
+ <excludes>
+ <exclude>com.google.*:*</exclude>
+ <exclude>com.google.guava:guava:*</exclude>
+ <exclude>org.checkerframework:checker-qual:*</exclude>
+ <exclude>org.slf4j:*</exclude>
+ <exclude>org.yaml:snakeyaml:*</exclude>
+ <exclude>org.apache.commons:logging:*</exclude>
+ </excludes>
+ </artifactSet>
+ <relocations>
+ <relocation>
+ <pattern>net.bytebuddy</pattern>
+ <shadedPattern>${shade.package}.net.bytebuddy</shadedPattern>
+ </relocation>
+ </relocations>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/shenyu-agent/shenyu-agent-bootstrap/src/main/java/org/apache/shenyu/agent/bootstrap/ShenyuAgentBootstrap.java b/shenyu-agent/shenyu-agent-bootstrap/src/main/java/org/apache/shenyu/agent/bootstrap/ShenyuAgentBootstrap.java
new file mode 100644
index 0000000..2dbc721
--- /dev/null
+++ b/shenyu-agent/shenyu-agent-bootstrap/src/main/java/org/apache/shenyu/agent/bootstrap/ShenyuAgentBootstrap.java
@@ -0,0 +1,35 @@
+/*
+ * 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.shenyu.agent.bootstrap;
+
+import java.lang.instrument.Instrumentation;
+
+/**
+ * The type Shenyu agent bootstrap.
+ */
+public class ShenyuAgentBootstrap {
+
+ /**
+ * Premain for instrumentation.
+ *
+ * @param arguments arguments
+ * @param instrumentation instrumentation
+ */
+ public static void premain(final String arguments, final Instrumentation instrumentation) {
+ }
+}
diff --git a/shenyu-agent/shenyu-agent-core/pom.xml b/shenyu-agent/shenyu-agent-core/pom.xml
new file mode 100644
index 0000000..507267b
--- /dev/null
+++ b/shenyu-agent/shenyu-agent-core/pom.xml
@@ -0,0 +1,78 @@
+<?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">
+ <parent>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-agent</artifactId>
+ <version>2.4.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>shenyu-agent-core</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-agent-api</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-shade-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <artifactSet>
+ <excludes>
+ <exclude>org.slf4j:*</exclude>
+ <exclude>net.bytebuddy:*</exclude>
+ <exclude>com.google.errorprone:error_prone_annotations:jar:</exclude>
+ <exclude>com.google.code.findbugs:jsr305:jar:</exclude>
+ <exclude>org.checkerframework:checker-qual:jar:</exclude>
+ <exclude>com.google.guava:listenablefuture:jar:*</exclude>
+ <exclude>com.google.j2objc:j2objc-annotations:jar:*</exclude>
+ </excludes>
+ </artifactSet>
+ <relocations>
+ <relocation>
+ <pattern>com.google</pattern>
+ <shadedPattern>${shade.package}.com.google</shadedPattern>
+ </relocation>
+ <relocation>
+ <pattern>org.apache.commons</pattern>
+ <shadedPattern>${shade.package}.org.apache.commons</shadedPattern>
+ </relocation>
+ </relocations>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
diff --git a/shenyu-dist/pom.xml b/shenyu-agent/shenyu-agent-plugins/pom.xml
similarity index 71%
copy from shenyu-dist/pom.xml
copy to shenyu-agent/shenyu-agent-plugins/pom.xml
index 8bbe155..b862600 100644
--- a/shenyu-dist/pom.xml
+++ b/shenyu-agent/shenyu-agent-plugins/pom.xml
@@ -16,19 +16,20 @@
~ 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">
+<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">
<parent>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu</artifactId>
+ <artifactId>shenyu-agent</artifactId>
<version>2.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-dist</artifactId>
+ <artifactId>shenyu-agent-plugins</artifactId>
<packaging>pom</packaging>
-
+
<modules>
- <module>shenyu-src-dist</module>
- <module>shenyu-admin-dist</module>
- <module>shenyu-bootstrap-dist</module>
+ <module>shenyu-agent-plugin-tracing</module>
</modules>
-</project>
+
+</project>
\ No newline at end of file
diff --git a/shenyu-dist/pom.xml b/shenyu-agent/shenyu-agent-plugins/shenyu-agent-plugin-tracing/pom.xml
similarity index 71%
copy from shenyu-dist/pom.xml
copy to shenyu-agent/shenyu-agent-plugins/shenyu-agent-plugin-tracing/pom.xml
index 8bbe155..11d8560 100644
--- a/shenyu-dist/pom.xml
+++ b/shenyu-agent/shenyu-agent-plugins/shenyu-agent-plugin-tracing/pom.xml
@@ -16,19 +16,20 @@
~ 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">
+<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">
<parent>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu</artifactId>
+ <artifactId>shenyu-agent-plugins</artifactId>
<version>2.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-dist</artifactId>
+ <artifactId>shenyu-agent-plugin-tracing</artifactId>
<packaging>pom</packaging>
<modules>
- <module>shenyu-src-dist</module>
- <module>shenyu-admin-dist</module>
- <module>shenyu-bootstrap-dist</module>
+ <module>shenyu-agent-plugin-tracing-jaeger</module>
</modules>
-</project>
+
+</project>
\ No newline at end of file
diff --git a/shenyu-dist/pom.xml b/shenyu-agent/shenyu-agent-plugins/shenyu-agent-plugin-tracing/shenyu-agent-plugin-tracing-jaeger/pom.xml
similarity index 67%
copy from shenyu-dist/pom.xml
copy to shenyu-agent/shenyu-agent-plugins/shenyu-agent-plugin-tracing/shenyu-agent-plugin-tracing-jaeger/pom.xml
index 8bbe155..92e40d3 100644
--- a/shenyu-dist/pom.xml
+++ b/shenyu-agent/shenyu-agent-plugins/shenyu-agent-plugin-tracing/shenyu-agent-plugin-tracing-jaeger/pom.xml
@@ -16,19 +16,15 @@
~ 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">
+<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">
<parent>
<groupId>org.apache.shenyu</groupId>
- <artifactId>shenyu</artifactId>
+ <artifactId>shenyu-agent-plugin-tracing</artifactId>
<version>2.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>shenyu-dist</artifactId>
- <packaging>pom</packaging>
+ <artifactId>shenyu-agent-plugin-tracing-jaeger</artifactId>
- <modules>
- <module>shenyu-src-dist</module>
- <module>shenyu-admin-dist</module>
- <module>shenyu-bootstrap-dist</module>
- </modules>
-</project>
+</project>
\ No newline at end of file
diff --git a/shenyu-dist/pom.xml b/shenyu-dist/pom.xml
index 8bbe155..eb3d2f9 100644
--- a/shenyu-dist/pom.xml
+++ b/shenyu-dist/pom.xml
@@ -30,5 +30,6 @@
<module>shenyu-src-dist</module>
<module>shenyu-admin-dist</module>
<module>shenyu-bootstrap-dist</module>
+ <module>shenyu-agent-dist</module>
</modules>
</project>
diff --git a/shenyu-dist/shenyu-agent-dist/pom.xml b/shenyu-dist/shenyu-agent-dist/pom.xml
new file mode 100644
index 0000000..c75166a
--- /dev/null
+++ b/shenyu-dist/shenyu-agent-dist/pom.xml
@@ -0,0 +1,54 @@
+<?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">
+ <parent>
+ <groupId>org.apache.shenyu</groupId>
+ <artifactId>shenyu-dist</artifactId>
+ <version>2.4.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>shenyu-agent-dist</artifactId>
+ <packaging>pom</packaging>
+
+ <build>
+ <finalName>shenyu-agent</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/main/assembly/binary.xml</descriptor>
+ </descriptors>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ <executions>
+ <execution>
+ <id>bin</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
diff --git a/shenyu-dist/shenyu-agent-dist/src/main/assembly/binary.xml b/shenyu-dist/shenyu-agent-dist/src/main/assembly/binary.xml
new file mode 100644
index 0000000..035d53f
--- /dev/null
+++ b/shenyu-dist/shenyu-agent-dist/src/main/assembly/binary.xml
@@ -0,0 +1,71 @@
+<!--
+ ~ 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.
+ -->
+
+<assembly
+ xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+ <id>admin-bin</id>
+ <formats>
+ <format>tar.gz</format>
+ </formats>
+ <includeBaseDirectory>true</includeBaseDirectory>
+ <baseDirectory>${project.build.finalName}-agent-bin</baseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>src/main/resources</directory>
+ <lineEnding>unix</lineEnding>
+ <includes>
+ <include>*.yml</include>
+ <include>*.xml</include>
+ </includes>
+ <outputDirectory>conf</outputDirectory>
+ </fileSet>
+ <fileSet>
+ <directory>src/main/resources/bin</directory>
+ <lineEnding>unix</lineEnding>
+ <includes>
+ <include>*.sh</include>
+ </includes>
+ <outputDirectory>bin</outputDirectory>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ <fileSet>
+ <directory>src/main/resources/bin</directory>
+ <lineEnding>windows</lineEnding>
+ <includes>
+ <include>*.bat</include>
+ </includes>
+ <outputDirectory>bin</outputDirectory>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ <fileSet>
+ <directory>src/main/release-docs</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ </fileSets>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>lib</outputDirectory>
+ <fileMode>0644</fileMode>
+ </dependencySet>
+ </dependencySets>
+</assembly>
diff --git a/shenyu-dist/shenyu-agent-dist/src/main/resources/logback.xml b/shenyu-dist/shenyu-agent-dist/src/main/resources/logback.xml
new file mode 100644
index 0000000..fe1ab7a
--- /dev/null
+++ b/shenyu-dist/shenyu-agent-dist/src/main/resources/logback.xml
@@ -0,0 +1,97 @@
+<?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.
+ -->
+
+<configuration>
+
+ <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
+ <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener"/>
+ <property name="LOG_HOME" value="${log.home:-./logs}"/>
+ <property name="LOG_APP_NAME" value="${log.app-name:-shenyu-admin}"/>
+ <property name="MAX_SINGLE_LOG_FILE_SIZE" value="${log.max-single-log-file-size:-100MB}"/>
+ <property name="MAX_LOG_FILE_HISTORY" value="${log.max-log-file-history:-7}"/>
+ <property name="LOG_FILE_TOTAL_CAPACITY" value="${log.log-file-total-capacity:-10GB}"/>
+ <property name="ASYNC_DISCARDING_THRESHOLD" value="${log.async.discarding-threshold:-0}"/>
+ <property name="ASYNC_LOG_QUEUE_SIZE" value="${log.async.queue-size:-256}"/>
+
+ <property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger - %msg%n"/>
+
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder>
+ <pattern>${LOG_PATTERN}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="ASYNC_STDOUT" class="ch.qos.logback.classic.AsyncAppender">
+ <discardingThreshold>${ASYNC_DISCARDING_THRESHOLD}</discardingThreshold>
+ <queueSize>${ASYNC_LOG_QUEUE_SIZE}</queueSize>
+ <includeCallerData>true</includeCallerData>
+ <appender-ref ref="STDOUT"/>
+ </appender>
+
+ <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <file>${LOG_HOME}/${LOG_APP_NAME}.log</file>
+ <append>true</append>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${LOG_HOME}/logs/${LOG_APP_NAME}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
+ <maxFileSize>${MAX_SINGLE_LOG_FILE_SIZE}</maxFileSize>
+ <maxHistory>${MAX_LOG_FILE_HISTORY}</maxHistory>
+ <totalSizeCap>${LOG_FILE_TOTAL_CAPACITY}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${LOG_PATTERN}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="ASYNC_FILE" class="ch.qos.logback.classic.AsyncAppender">
+ <discardingThreshold>${ASYNC_DISCARDING_THRESHOLD}</discardingThreshold>
+ <queueSize>${ASYNC_LOG_QUEUE_SIZE}</queueSize>
+ <includeCallerData>true</includeCallerData>
+ <appender-ref ref="FILE"/>
+ </appender>
+
+ <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+ <filter class="ch.qos.logback.classic.filter.LevelFilter">
+ <level>ERROR</level>
+ <onMatch>ACCEPT</onMatch>
+ <onMismatch>DENY</onMismatch>
+ </filter>
+ <file>${LOG_HOME}/${LOG_APP_NAME}-error.log</file>
+ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
+ <fileNamePattern>${LOG_HOME}/logs/${LOG_APP_NAME}.%d{yyyy-MM-dd}-error.%i.log.zip</fileNamePattern>
+ <maxFileSize>${MAX_SINGLE_LOG_FILE_SIZE}</maxFileSize>
+ <maxHistory>${MAX_LOG_FILE_HISTORY}</maxHistory>
+ <totalSizeCap>${LOG_FILE_TOTAL_CAPACITY}</totalSizeCap>
+ </rollingPolicy>
+ <encoder>
+ <pattern>${LOG_PATTERN}</pattern>
+ </encoder>
+ </appender>
+
+ <appender name="ASYNC_ERROR_FILE" class="ch.qos.logback.classic.AsyncAppender">
+ <discardingThreshold>${ASYNC_DISCARDING_THRESHOLD}</discardingThreshold>
+ <queueSize>${ASYNC_LOG_QUEUE_SIZE}</queueSize>
+ <includeCallerData>true</includeCallerData>
+ <appender-ref ref="ERROR_FILE"/>
+ </appender>
+
+ <root level="INFO">
+ <appender-ref ref="ASYNC_STDOUT"/>
+ <appender-ref ref="ASYNC_FILE"/>
+ <appender-ref ref="ASYNC_ERROR_FILE"/>
+ </root>
+</configuration>
\ No newline at end of file