diff --git a/.gitignore b/.gitignore index 8d6d2d3fdf13..3ddaa8a9463c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ packages/ **/dependency-reduced-pom.xml /skywalking-agent/ /dist/ +.mvn/wrapper/*.jar diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java new file mode 100755 index 000000000000..fa4f7b499fdd --- /dev/null +++ b/.mvn/wrapper/MavenWrapperDownloader.java @@ -0,0 +1,110 @@ +/* +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. +*/ + +import java.net.*; +import java.io.*; +import java.nio.channels.*; +import java.util.Properties; + +public class MavenWrapperDownloader { + + /** + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. + */ + private static final String DEFAULT_DOWNLOAD_URL = + "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; + + /** + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to + * use instead of the default one. + */ + private static final String MAVEN_WRAPPER_PROPERTIES_PATH = + ".mvn/wrapper/maven-wrapper.properties"; + + /** + * Path where the maven-wrapper.jar will be saved to. + */ + private static final String MAVEN_WRAPPER_JAR_PATH = + ".mvn/wrapper/maven-wrapper.jar"; + + /** + * Name of the property which should be used to override the default download url for the wrapper. + */ + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; + + public static void main(String args[]) { + System.out.println("- Downloader started"); + File baseDirectory = new File(args[0]); + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); + + // If the maven-wrapper.properties exists, read it and check if it contains a custom + // wrapperUrl parameter. + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); + String url = DEFAULT_DOWNLOAD_URL; + if(mavenWrapperPropertyFile.exists()) { + FileInputStream mavenWrapperPropertyFileInputStream = null; + try { + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); + Properties mavenWrapperProperties = new Properties(); + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); + } catch (IOException e) { + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); + } finally { + try { + if(mavenWrapperPropertyFileInputStream != null) { + mavenWrapperPropertyFileInputStream.close(); + } + } catch (IOException e) { + // Ignore ... + } + } + } + System.out.println("- Downloading from: : " + url); + + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); + if(!outputFile.getParentFile().exists()) { + if(!outputFile.getParentFile().mkdirs()) { + System.out.println( + "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); + } + } + System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); + try { + downloadFileFromURL(url, outputFile); + System.out.println("Done"); + System.exit(0); + } catch (Throwable e) { + System.out.println("- Error downloading"); + e.printStackTrace(); + System.exit(1); + } + } + + private static void downloadFileFromURL(String urlString, File destination) throws Exception { + URL website = new URL(urlString); + ReadableByteChannel rbc; + rbc = Channels.newChannel(website.openStream()); + FileOutputStream fos = new FileOutputStream(destination); + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); + fos.close(); + rbc.close(); + } + +} diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100755 index 000000000000..00d32aab1d44 --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 217dc70c2ebc..f8d4a737c6f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,6 @@ before_install: install: - jdk_switcher use oraclejdk8 - - mvn clean install -Ptravis-ci-submodule --quiet jacoco:report coveralls:report - - mvn clean javadoc:javadoc -Dmaven.test.skip=true --quiet + - ./mvnw clean install -Ptravis-ci-submodule --quiet jacoco:report coveralls:report + - ./mvnw clean javadoc:javadoc -Dmaven.test.skip=true --quiet diff --git a/CHANGES.md b/CHANGES.md index 0cc2f145314e..147900361e83 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,44 @@ Changes by Version ================== Release Notes. +5.0.0-RC +------------------ + +#### Agent Changes + - Support ActiveMQ 5.x + - Support RuntimeContext used out of TracingContext. + - Support Oracle ojdbc8 Plugin. + - Support ElasticSearch client transport 5.2-5.6 Plugin + - Support using agent.config with given path through system properties. + - Add a new way to transmit the Request and Response, to avoid bugs in Hytrix scenarios. + - Fix HTTPComponent client v4 operation name is empty. + - Fix 2 possible NPEs in Spring plugin. + - Fix a possible span leak in SpringMVC plugin. + - Fix NPE in Spring callback plugin. + +#### Collector Changes + - Add GZip support for Zipkin receiver. + - Add new component IDs for nodejs. + - Fix Zipkin span receiver may miss data in request. + - Optimize codes in heatmap calculation. Reduce unnecessary divide. + - Fix NPE in Alarm content generation. + - Fix the precision lost in `ServiceNameService#startTimeMillis`. + - Fix GC count is 0. + - Fix topology breaks when RPC client uses the async thread call. + +#### UI Changes + - Fix UI port can't be set by startup script in Windows. + - Fix Topology self link error. + - Fix stack color mismatch label color in gc time chart. + +#### Documents + - Add users list. + - Fix several document typo. + - Sync the Chinese documents. + - Add OpenAPM badge. + - Add icon/font documents to NOTICE files. + + 5.0.0-beta2 ------------------ diff --git a/README.md b/README.md index 996584115302..00d9df9c355c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Apache SkyWalking Sky Walking logo -**SkyWalking**: APM (application performance monitor) tool for distributed systems, especially designed for +**SkyWalking**: APM (application performance monitor) tool for distributed systems, especially designed for microservices, cloud native and container-based (Docker, Kubernetes, Mesos) architectures. [![GitHub stars](https://img.shields.io/github/stars/apache/incubator-skywalking.svg?style=for-the-badge&label=Stars&logo=github)](https://github.com/apache/incubator-skywalking) @@ -16,7 +16,7 @@ microservices, cloud native and container-based (Docker, Kubernetes, Mesos) arch [![OpenTracing-1.x Badge](https://img.shields.io/badge/OpenTracing--1.x-enabled-blue.svg)](http://opentracing.io) # Abstract -**SkyWalking** started as a distributed tracing system in 2015. From 5.x, it evolved to the fully functional [Application Performance Management](https://en.wikipedia.org/wiki/Application_performance_management) +**SkyWalking** started as a distributed tracing system in 2015. From 5.x, it evolved to the fully functional [Application Performance Management](https://en.wikipedia.org/wiki/Application_performance_management) system. It is used for tracing, monitoring, diagnose distributed systems, especially based on microservices, cloud native and container, including: - Distributed tracing and context propagation @@ -28,10 +28,10 @@ including: - Performance optimization # Core features -- Multiple languages instrumentation agent or libraries +- Multiple languages instrumentation agent or libraries - Native Java auto instrumentation agent. Trace and monitor your cluster without changing any source codes - Community instrumentation agent or libraries - * [.NET Core](https://github.com/OpenSkywalking/skywalking-netcore) + * [.NET Core](https://github.com/OpenSkywalking/skywalking-netcore) * [Node.js](https://github.com/OpenSkywalking/skywalking-nodejs) - Multiple storage backends: ElasticSearch, H2 - [OpenTracing](http://opentracing.io/) compatible @@ -39,11 +39,11 @@ including: - Lightweight and powerful backend aggregation and analysis capabilities - Modern and cool Web UI - Log integration -- Alarm for slow or unstable(low SLA) application, instance and service +- Alarm for slow or unstable(low SLA) application, instance and service - [**Incubating**] Support accepting other tracer data formats. - Zipkin JSON, Thrift, Protobuf v1 and v2 formats, powered by [OpenZipkin](https://github.com/openzipkin/zipkin) libs - Jaeger in [Zipkin Thrift or JSON v1/v2 formats](https://github.com/jaegertracing/jaeger#backwards-compatibility-with-zipkin) - + # Announcement After SkyWalking 5.0.0-beta2 released, all core features have been provided. For 5 series, we are trying to make them stable from now. At the same time, we have already begun our works for 6 series, in branch `6.0`. It will be a long way to have the first alpha release for it. So if you want to take part in the challengeable works, welcome, but don't consider to use that. Please read the [6.0 documents](https://github.com/apache/incubator-skywalking/blob/6.0/docs/README.md) first. @@ -78,9 +78,15 @@ Follow this [document](https://github.com/apache/incubator-skywalking/blob/maste * QQ Group: 392443393 # Users - + + +- [Users list](docs/users.md) +- [Submit new user to us.](https://github.com/apache/incubator-skywalking/issues/443) -[Submit new user case to us.](https://github.com/apache/incubator-skywalking/issues/443) +

+ +
Our project enriches the OpenAPM Landscape! +

# License [Apache 2.0 License.](/LICENSE) diff --git a/README_ZH.md b/README_ZH.md index e64ff73564ec..5f265ce0947f 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -29,7 +29,7 @@ Apache SkyWalking | [English](README.md) - 多语言探针或类库 - Java自动探针,追踪和监控程序时,不需要修改源码。 - 社区提供的其他多语言探针 - * [.NET Core](https://github.com/OpenSkywalking/skywalking-netcore) + * [.NET Core](https://github.com/OpenSkywalking/skywalking-netcore) * [Node.js](https://github.com/OpenSkywalking/skywalking-nodejs) - 多种后端存储: ElasticSearch, H2 - 支持[OpenTracing](http://opentracing.io/) @@ -39,7 +39,7 @@ Apache SkyWalking | [English](README.md) - 日志集成 - 应用、实例和服务的告警 - [**Incubating**]支持接口其他探针的数据 - - 接受Zipkin v1 v2格式数据,采用JSON, Thrift, Protobuf序列化方式。Powered by [OpenZipkin](https://github.com/openzipkin/zipkin) libs + - 接受Zipkin v1 v2格式数据,采用JSON, Thrift, Protobuf序列化方式。Powered by [OpenZipkin](https://github.com/openzipkin/zipkin) libs - 接受Jaeger 使用 [Zipkin Thrift 或 JSON v1/v2 格式](https://github.com/jaegertracing/jaeger#backwards-compatibility-with-zipkin) # Document @@ -74,9 +74,10 @@ This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDU * QQ群: 392443393 # Users - + -[报告新的用户案例](https://github.com/apache/incubator-skywalking/issues/443) +- [用户案例](docs/users.md) +- [报告新的用户案例](https://github.com/apache/incubator-skywalking/issues/443) # License diff --git a/apm-application-toolkit/apm-toolkit-log4j-1.x/pom.xml b/apm-application-toolkit/apm-toolkit-log4j-1.x/pom.xml index bedd53ae86f4..ee016d6311f7 100644 --- a/apm-application-toolkit/apm-toolkit-log4j-1.x/pom.xml +++ b/apm-application-toolkit/apm-toolkit-log4j-1.x/pom.xml @@ -21,40 +21,22 @@ apm-application-toolkit org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-toolkit-log4j-1.x + + 1.2.17 + + log4j log4j - 1.2.17 + ${log4j.version} provided - - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - 2.4 - - - diff --git a/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml b/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml index d2ae4a7219f1..d3aa9e68a9a2 100644 --- a/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml +++ b/apm-application-toolkit/apm-toolkit-log4j-2.x/pom.xml @@ -21,41 +21,22 @@ apm-application-toolkit org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-toolkit-log4j-2.x + + 2.7 + + org.apache.logging.log4j log4j-core - 2.7 + ${log4j-core.version} provided - - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - 2.4 - - - - diff --git a/apm-application-toolkit/apm-toolkit-logback-1.x/pom.xml b/apm-application-toolkit/apm-toolkit-logback-1.x/pom.xml index ab623fe11bbe..78544833ad69 100644 --- a/apm-application-toolkit/apm-toolkit-logback-1.x/pom.xml +++ b/apm-application-toolkit/apm-toolkit-logback-1.x/pom.xml @@ -21,40 +21,22 @@ apm-application-toolkit org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-toolkit-logback-1.x + + 1.2.3 + + ch.qos.logback logback-classic - 1.2.3 + ${logback-classic.version} provided - - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - 2.4 - - - diff --git a/apm-application-toolkit/apm-toolkit-opentracing/pom.xml b/apm-application-toolkit/apm-toolkit-opentracing/pom.xml index 7e59a691dc5d..4f197ff84f40 100644 --- a/apm-application-toolkit/apm-toolkit-opentracing/pom.xml +++ b/apm-application-toolkit/apm-toolkit-opentracing/pom.xml @@ -21,22 +21,26 @@ apm-application-toolkit org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-toolkit-opentracing + + 0.30.0 + + io.opentracing opentracing-api - 0.30.0 + ${opentracing.version} io.opentracing opentracing-noop - 0.30.0 + ${opentracing.version} diff --git a/apm-application-toolkit/apm-toolkit-trace/pom.xml b/apm-application-toolkit/apm-toolkit-trace/pom.xml index e109cadbe555..391b9efeed67 100644 --- a/apm-application-toolkit/apm-toolkit-trace/pom.xml +++ b/apm-application-toolkit/apm-toolkit-trace/pom.xml @@ -20,7 +20,7 @@ apm-application-toolkit org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -28,26 +28,4 @@ jar http://maven.apache.org - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - 2.4 - - - - diff --git a/apm-application-toolkit/pom.xml b/apm-application-toolkit/pom.xml index 602622ffffb7..2e9c0a1709f8 100644 --- a/apm-application-toolkit/pom.xml +++ b/apm-application-toolkit/pom.xml @@ -20,7 +20,7 @@ apm org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-application-toolkit diff --git a/apm-checkstyle/pom.xml b/apm-checkstyle/pom.xml index c6ee3475ba42..08afc70aa11b 100644 --- a/apm-checkstyle/pom.xml +++ b/apm-checkstyle/pom.xml @@ -27,16 +27,21 @@ org.apache.skywalking apm-checkstyle - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT Module to hold Checkstyle for SkyWalking. + + 0.7.9 + 4.1.0 + + org.jacoco jacoco-maven-plugin - 0.7.9 + ${jacoco-maven-plugin.version} prepare-agent @@ -49,7 +54,7 @@ org.eluder.coveralls coveralls-maven-plugin - 4.1.0 + ${coveralls-maven-plugin.version} xFwR2GqmxcMxV7tGEpW2NfwIrbCD4cQCS diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml index da8a55cfe9cd..d89ee89cce0a 100644 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml +++ b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-define/pom.xml @@ -21,7 +21,7 @@ agent-grpc org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml index 8ec04729c44a..ae050b99e7dc 100644 --- a/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml +++ b/apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/pom.xml @@ -21,7 +21,7 @@ agent-grpc org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-agent/agent-grpc/pom.xml b/apm-collector/apm-collector-agent/agent-grpc/pom.xml index 4e1490e3fc69..0f2939f69a7f 100644 --- a/apm-collector/apm-collector-agent/agent-grpc/pom.xml +++ b/apm-collector/apm-collector-agent/agent-grpc/pom.xml @@ -21,7 +21,7 @@ apm-collector-agent org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml index 106bb02c2c3e..c5e4f2fe2e73 100644 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml +++ b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-define/pom.xml @@ -21,7 +21,7 @@ agent-jetty org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml index fbaa77c35e38..6cf21066d191 100644 --- a/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml +++ b/apm-collector/apm-collector-agent/agent-jetty/agent-jetty-provider/pom.xml @@ -21,7 +21,7 @@ agent-jetty org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-agent/agent-jetty/pom.xml b/apm-collector/apm-collector-agent/agent-jetty/pom.xml index 72b3963c2dcc..f7d03feecf62 100644 --- a/apm-collector/apm-collector-agent/agent-jetty/pom.xml +++ b/apm-collector/apm-collector-agent/agent-jetty/pom.xml @@ -21,7 +21,7 @@ apm-collector-agent org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-agent/pom.xml b/apm-collector/apm-collector-agent/pom.xml index 89ca6227e8ad..87a0cd84dbe8 100644 --- a/apm-collector/apm-collector-agent/pom.xml +++ b/apm-collector/apm-collector-agent/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml index f403a2165ad8..1a9cf843fea1 100644 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/pom.xml @@ -21,7 +21,7 @@ analysis-alarm org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml index 9bf1a1e2dcc9..479a6727ae23 100644 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/pom.xml @@ -21,7 +21,7 @@ analysis-alarm org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java index 997c93ee82eb..9f5ffc389c7e 100644 --- a/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java +++ b/apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceReferenceMetricAlarmAssertWorker.java @@ -68,7 +68,7 @@ public InstanceReferenceMetricAlarmAssertWorker(ModuleManager moduleManager) { Instance instance = instanceDAO.getInstance(alarm.getBehindInstanceId()); JsonObject osInfo = gson.fromJson(instance.getOsInfo(), JsonObject.class); String serverName = Const.UNKNOWN; - if (osInfo.has("hostName")) { + if (osInfo != null && osInfo.has("hostName")) { serverName = osInfo.get("hostName").getAsString(); } diff --git a/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml b/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml index f34432bbba1b..aac275b84c3d 100644 --- a/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-alarm/pom.xml @@ -21,7 +21,7 @@ apm-collector-analysis org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml index 7469dfb45648..4684d5f9b0b5 100644 --- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-define/pom.xml @@ -21,7 +21,7 @@ analysis-baseline org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml index c7761ac35b23..9dd954eb2420 100644 --- a/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-baseline/baseline-computing-provider/pom.xml @@ -21,7 +21,7 @@ analysis-baseline org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml b/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml index b560e3d535d6..6159fee67019 100644 --- a/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-baseline/pom.xml @@ -21,7 +21,7 @@ apm-collector-analysis org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml index 5e5a141426ca..cb6bcaaf17a4 100644 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-define/pom.xml @@ -21,7 +21,7 @@ analysis-jvm org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml index 847daf4e7f2c..8a26952efc71 100644 --- a/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/pom.xml @@ -21,7 +21,7 @@ analysis-jvm org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml b/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml index 2165fef36db1..2fea026528b5 100644 --- a/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-jvm/pom.xml @@ -21,7 +21,7 @@ apm-collector-analysis org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml index e40380a3006b..2dabbd106454 100644 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-define/pom.xml @@ -21,7 +21,7 @@ analysis-metric org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml index c10265d3cea6..22bd984481b3 100644 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/pom.xml @@ -21,7 +21,7 @@ analysis-metric org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java index ea14849fba8f..e467d524469c 100644 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java +++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListener.java @@ -73,15 +73,16 @@ public void parseFirst(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreI } int getStep(int duration) { - int countOfResponseTimeSteps = configService.getResponseTimeStep() * configService.getCountOfResponseTimeSteps(); int responseTimeStep = configService.getResponseTimeStep(); + int countOfResponseTimeSteps = configService.getCountOfResponseTimeSteps(); + int totalTimeOfResponseTimeSteps = configService.getTotalTimeOfResponseTimeSteps(); - if (duration > countOfResponseTimeSteps) { - return countOfResponseTimeSteps / responseTimeStep; + if (duration > totalTimeOfResponseTimeSteps) { + return countOfResponseTimeSteps; } else if (duration <= responseTimeStep) { return 0; } else { - return (int)Math.ceil((double)duration / (double)responseTimeStep) - 1; + return (int) Math.ceil((double) duration / (double) responseTimeStep) - 1; } } diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java index fe0395445cd6..15b655287062 100644 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java +++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/service/refmetric/ServiceReferenceMetricSpanListener.java @@ -103,6 +103,10 @@ public void parseEntry(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreI } @Override public void parseExit(SpanDecorator spanDecorator, SegmentCoreInfo segmentCoreInfo) { + if (this.minuteTimeBucket == 0) { + this.minuteTimeBucket = segmentCoreInfo.getMinuteTimeBucket(); + } + ServiceReferenceMetric serviceReferenceMetric = new ServiceReferenceMetric(); int peerId = spanDecorator.getPeerId(); diff --git a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java index 3a16c575314d..8a8ddbff688b 100644 --- a/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java +++ b/apm-collector/apm-collector-analysis/analysis-metric/metric-provider/src/test/java/org/apache/skywalking/apm/collector/analysis/metric/provider/worker/global/std/ResponseTimeDistributionSpanListenerTestCase.java @@ -42,6 +42,7 @@ public void testStep() { IResponseTimeDistributionConfigService service = Mockito.mock(IResponseTimeDistributionConfigService.class); Mockito.when(service.getResponseTimeStep()).thenReturn(50); Mockito.when(service.getCountOfResponseTimeSteps()).thenReturn(40); + Mockito.when(service.getTotalTimeOfResponseTimeSteps()).thenReturn(2050); ModuleDefine module = Mockito.mock(ModuleDefine.class); Whitebox.setInternalState(module, "loadedProviders", loadedProviders); diff --git a/apm-collector/apm-collector-analysis/analysis-metric/pom.xml b/apm-collector/apm-collector-analysis/analysis-metric/pom.xml index cf947b25e6a3..57b39ef45427 100644 --- a/apm-collector/apm-collector-analysis/analysis-metric/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-metric/pom.xml @@ -21,7 +21,7 @@ apm-collector-analysis org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-register/pom.xml b/apm-collector/apm-collector-analysis/analysis-register/pom.xml index bcf9081be8fb..d9363c1e4b52 100644 --- a/apm-collector/apm-collector-analysis/analysis-register/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-register/pom.xml @@ -21,7 +21,7 @@ apm-collector-analysis org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-register/register-define/pom.xml index 05bdfb34a95e..a48485c60170 100644 --- a/apm-collector/apm-collector-analysis/analysis-register/register-define/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-register/register-define/pom.xml @@ -21,7 +21,7 @@ analysis-register org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-register/register-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-register/register-provider/pom.xml index 6cc2fb047e7e..6334cf491497 100644 --- a/apm-collector/apm-collector-analysis/analysis-register/register-provider/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-register/register-provider/pom.xml @@ -21,7 +21,7 @@ analysis-register org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/pom.xml b/apm-collector/apm-collector-analysis/analysis-segment-parser/pom.xml index e6efc9d9e41d..4dc1d7293981 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-segment-parser/pom.xml @@ -21,7 +21,7 @@ apm-collector-analysis org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/pom.xml b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/pom.xml index 3b334a1f2045..b6a4ae49e06b 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-define/pom.xml @@ -21,7 +21,7 @@ analysis-segment-parser org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/pom.xml b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/pom.xml index 02ba6898cb01..13e54cc45ae1 100644 --- a/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-segment-parser/segment-parser-provider/pom.xml @@ -21,7 +21,7 @@ analysis-segment-parser org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/analysis-worker-model/pom.xml b/apm-collector/apm-collector-analysis/analysis-worker-model/pom.xml index 390f784418ac..79f8ddaf0a80 100644 --- a/apm-collector/apm-collector-analysis/analysis-worker-model/pom.xml +++ b/apm-collector/apm-collector-analysis/analysis-worker-model/pom.xml @@ -21,7 +21,7 @@ apm-collector-analysis org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-analysis/pom.xml b/apm-collector/apm-collector-analysis/pom.xml index 614b17390075..9892c77b596a 100644 --- a/apm-collector/apm-collector-analysis/pom.xml +++ b/apm-collector/apm-collector-analysis/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-boot/pom.xml b/apm-collector/apm-collector-boot/pom.xml index 29d27671ffd8..d02415c07de8 100644 --- a/apm-collector/apm-collector-boot/pom.xml +++ b/apm-collector/apm-collector-boot/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -212,17 +212,7 @@ - org.apache.maven.plugins - maven-resources-plugin - 2.4.3 - - ${project.build.sourceEncoding} - - - - org.apache.maven.plugins maven-jar-plugin - 2.3.2 application.yml @@ -232,7 +222,6 @@ - org.apache.maven.plugins maven-assembly-plugin diff --git a/apm-collector/apm-collector-boot/src/main/resources/application.yml b/apm-collector/apm-collector-boot/src/main/resources/application.yml index 7732967fc73d..047cf9301ea1 100644 --- a/apm-collector/apm-collector-boot/src/main/resources/application.yml +++ b/apm-collector/apm-collector-boot/src/main/resources/application.yml @@ -111,4 +111,4 @@ configuration: # default: # host: localhost # port: 9411 -# contextPath: / \ No newline at end of file +# contextPath: / diff --git a/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml b/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml index 63ca198701de..7291c7f7e238 100644 --- a/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml +++ b/apm-collector/apm-collector-boot/src/main/resources/component-libraries.yml @@ -156,6 +156,21 @@ mongodb-driver: SOFARPC: id: 43 languages: Java +ActiveMQ: + id: 44 + languages: Java +activemq-producer: + id: 45 + languages: Java +activemq-consumer: + id: 46 + languages: Java +Elasticsearch: + id: 47 + languages: Java +transport-client: + id: 48 + languages: Java # .NET/.NET Core components # [3000, 4000) for C#/.NET only @@ -213,6 +228,12 @@ HttpServer: express: id: 4002 languages: Node.js +Egg: + id: 4003 + languages: Node.js +Koa: + id: 4004 + languages: Node.js # Component Server mapping defines the server display names of some components # e.g. @@ -223,6 +244,8 @@ Component-Server-Mappings: rocketMQ-consumer: RocketMQ kafka-producer: Kafka kafka-consumer: Kafka + activemq-producer: ActiveMQ + activemq-consumer: ActiveMQ postgresql-jdbc-driver: PostgreSQL Xmemcached: Memcached Spymemcached: Memcached @@ -238,4 +261,4 @@ Component-Server-Mappings: EntityFrameworkCore.Sqlite: SQLite Pomelo.EntityFrameworkCore.MySql: Mysql Npgsql.EntityFrameworkCore.PostgreSQL: PostgreSQL - + transport-client: Elasticsearch diff --git a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/pom.xml b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/pom.xml index ee07fc8ffbf2..1687ebc6ceca 100644 --- a/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/pom.xml +++ b/apm-collector/apm-collector-cache/collector-cache-caffeine-provider/pom.xml @@ -21,7 +21,7 @@ apm-collector-cache org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-cache/collector-cache-define/pom.xml b/apm-collector/apm-collector-cache/collector-cache-define/pom.xml index 6283bf7d55f8..767a76548f04 100644 --- a/apm-collector/apm-collector-cache/collector-cache-define/pom.xml +++ b/apm-collector/apm-collector-cache/collector-cache-define/pom.xml @@ -21,7 +21,7 @@ apm-collector-cache org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-cache/collector-cache-guava-provider/pom.xml b/apm-collector/apm-collector-cache/collector-cache-guava-provider/pom.xml index d962bb6ba02b..bb0e66596847 100644 --- a/apm-collector/apm-collector-cache/collector-cache-guava-provider/pom.xml +++ b/apm-collector/apm-collector-cache/collector-cache-guava-provider/pom.xml @@ -21,7 +21,7 @@ apm-collector-cache org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-cache/pom.xml b/apm-collector/apm-collector-cache/pom.xml index 4bbcdf2b3d8b..d75c3c057ede 100644 --- a/apm-collector/apm-collector-cache/pom.xml +++ b/apm-collector/apm-collector-cache/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-cluster/collector-cluster-define/pom.xml b/apm-collector/apm-collector-cluster/collector-cluster-define/pom.xml index e6ff34f050d3..f143970a91bc 100644 --- a/apm-collector/apm-collector-cluster/collector-cluster-define/pom.xml +++ b/apm-collector/apm-collector-cluster/collector-cluster-define/pom.xml @@ -21,7 +21,7 @@ apm-collector-cluster org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/pom.xml b/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/pom.xml index 3f5fee2f31ec..82b52631d37d 100644 --- a/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/pom.xml +++ b/apm-collector/apm-collector-cluster/collector-cluster-redis-provider/pom.xml @@ -21,7 +21,7 @@ apm-collector-cluster org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/pom.xml b/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/pom.xml index f9ea86907145..98e4eefaff4a 100644 --- a/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/pom.xml +++ b/apm-collector/apm-collector-cluster/collector-cluster-standalone-provider/pom.xml @@ -21,7 +21,7 @@ apm-collector-cluster org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/pom.xml b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/pom.xml index 00601d6bda62..9490d1958822 100644 --- a/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/pom.xml +++ b/apm-collector/apm-collector-cluster/collector-cluster-zookeeper-provider/pom.xml @@ -21,7 +21,7 @@ apm-collector-cluster org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-cluster/pom.xml b/apm-collector/apm-collector-cluster/pom.xml index 756e3ac07278..ea42557d1f5f 100644 --- a/apm-collector/apm-collector-cluster/pom.xml +++ b/apm-collector/apm-collector-cluster/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-component/client-component/pom.xml b/apm-collector/apm-collector-component/client-component/pom.xml index 2f5a1b99c3b2..3a4da6aa960c 100644 --- a/apm-collector/apm-collector-component/client-component/pom.xml +++ b/apm-collector/apm-collector-component/client-component/pom.xml @@ -21,7 +21,7 @@ apm-collector-component org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-component/pom.xml b/apm-collector/apm-collector-component/pom.xml index ad69a5c3bc25..d74d470b806a 100644 --- a/apm-collector/apm-collector-component/pom.xml +++ b/apm-collector/apm-collector-component/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-component/server-component/pom.xml b/apm-collector/apm-collector-component/server-component/pom.xml index e59a097a2456..4e0179c0104a 100644 --- a/apm-collector/apm-collector-component/server-component/pom.xml +++ b/apm-collector/apm-collector-component/server-component/pom.xml @@ -21,7 +21,7 @@ apm-collector-component org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml b/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml index 376ca7f49746..668a4bd7b9ae 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml +++ b/apm-collector/apm-collector-configuration/collector-configuration-define/pom.xml @@ -21,7 +21,7 @@ apm-collector-configuration org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java index 7cec4c441287..5a6d25e8c6dc 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java +++ b/apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IResponseTimeDistributionConfigService.java @@ -28,4 +28,12 @@ public interface IResponseTimeDistributionConfigService extends Service { int getResponseTimeStep(); int getCountOfResponseTimeSteps(); + + /** + * Equals to getResponseTimeStep() * getCountOfResponseTimeSteps() ,just for economizes computing resources + * + * @return + */ + int getTotalTimeOfResponseTimeSteps(); + } diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml b/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml index 3057dc235bb2..11ed289bf21f 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/pom.xml @@ -21,7 +21,7 @@ apm-collector-configuration org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java index cc50be2d85fe..87ed2a2c3bb2 100644 --- a/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java +++ b/apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ResponseTimeDistributionConfigService.java @@ -25,10 +25,12 @@ public class ResponseTimeDistributionConfigService implements IResponseTimeDistr private final int responseTimeStep; private final int countOfResponseTimeSteps; + private final int totalTimeOfResponseTimeSteps; public ResponseTimeDistributionConfigService(int responseTimeStep, int countOfResponseTimeSteps) { this.responseTimeStep = responseTimeStep; this.countOfResponseTimeSteps = countOfResponseTimeSteps + 1; + this.totalTimeOfResponseTimeSteps = this.responseTimeStep * this.countOfResponseTimeSteps; } @Override public int getResponseTimeStep() { @@ -38,4 +40,9 @@ public ResponseTimeDistributionConfigService(int responseTimeStep, int countOfRe @Override public int getCountOfResponseTimeSteps() { return countOfResponseTimeSteps; } + + @Override + public int getTotalTimeOfResponseTimeSteps() { + return totalTimeOfResponseTimeSteps; + } } diff --git a/apm-collector/apm-collector-configuration/pom.xml b/apm-collector/apm-collector-configuration/pom.xml index ac116b8c7d1a..5ef3c34a639e 100644 --- a/apm-collector/apm-collector-configuration/pom.xml +++ b/apm-collector/apm-collector-configuration/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-core/pom.xml b/apm-collector/apm-collector-core/pom.xml index 3cd685f1ac01..ccde65251cd7 100644 --- a/apm-collector/apm-collector-core/pom.xml +++ b/apm-collector/apm-collector-core/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/pom.xml b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/pom.xml index 7fd1e41d3ea2..1e3d4cd3f391 100644 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/pom.xml +++ b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-define/pom.xml @@ -21,7 +21,7 @@ apm-collector-grpc-manager org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/pom.xml b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/pom.xml index f4946c8990b2..84f51f307e74 100644 --- a/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/pom.xml +++ b/apm-collector/apm-collector-grpc-manager/collector-grpc-manager-provider/pom.xml @@ -21,7 +21,7 @@ apm-collector-grpc-manager org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-grpc-manager/pom.xml b/apm-collector/apm-collector-grpc-manager/pom.xml index 63e1ddb46c3e..833f93e8cf93 100644 --- a/apm-collector/apm-collector-grpc-manager/pom.xml +++ b/apm-collector/apm-collector-grpc-manager/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-instrument/pom.xml b/apm-collector/apm-collector-instrument/pom.xml index a868e3a2b2d8..3b788036f82b 100644 --- a/apm-collector/apm-collector-instrument/pom.xml +++ b/apm-collector/apm-collector-instrument/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -44,9 +44,7 @@ collector-instrument-agent - org.apache.maven.plugins maven-shade-plugin - 2.4.1 package diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/pom.xml b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/pom.xml index 6c7da7a00e9d..bbe78679b53f 100644 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/pom.xml +++ b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-define/pom.xml @@ -21,7 +21,7 @@ apm-collector-jetty-manager org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/pom.xml b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/pom.xml index 10141204b127..84a6a03d79f9 100644 --- a/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/pom.xml +++ b/apm-collector/apm-collector-jetty-manager/collector-jetty-manager-provider/pom.xml @@ -21,7 +21,7 @@ apm-collector-jetty-manager org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-jetty-manager/pom.xml b/apm-collector/apm-collector-jetty-manager/pom.xml index 8a9b5b21214e..c836ed92c727 100644 --- a/apm-collector/apm-collector-jetty-manager/pom.xml +++ b/apm-collector/apm-collector-jetty-manager/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-naming/collector-naming-define/pom.xml b/apm-collector/apm-collector-naming/collector-naming-define/pom.xml index a6277657c9ad..41dea7f62de7 100644 --- a/apm-collector/apm-collector-naming/collector-naming-define/pom.xml +++ b/apm-collector/apm-collector-naming/collector-naming-define/pom.xml @@ -21,7 +21,7 @@ apm-collector-naming org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml index 3fa0b1dd8529..3446d49673be 100644 --- a/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml +++ b/apm-collector/apm-collector-naming/collector-naming-jetty-provider/pom.xml @@ -21,7 +21,7 @@ apm-collector-naming org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-naming/pom.xml b/apm-collector/apm-collector-naming/pom.xml index bc7e38771f44..960719becfb4 100644 --- a/apm-collector/apm-collector-naming/pom.xml +++ b/apm-collector/apm-collector-naming/pom.xml @@ -21,7 +21,7 @@ apm-collector org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-remote/collector-remote-define/pom.xml b/apm-collector/apm-collector-remote/collector-remote-define/pom.xml index 42edfa518ce8..eb8302348c95 100644 --- a/apm-collector/apm-collector-remote/collector-remote-define/pom.xml +++ b/apm-collector/apm-collector-remote/collector-remote-define/pom.xml @@ -21,7 +21,7 @@ apm-collector-remote org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/pom.xml b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/pom.xml index 51830a7988b7..46348f773fdd 100644 --- a/apm-collector/apm-collector-remote/collector-remote-grpc-provider/pom.xml +++ b/apm-collector/apm-collector-remote/collector-remote-grpc-provider/pom.xml @@ -21,13 +21,18 @@ apm-collector-remote org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 collector-remote-grpc-provider jar + + 1.4.1.Final + 0.5.0 + + org.apache.skywalking @@ -51,22 +56,14 @@ kr.motd.maven os-maven-plugin - 1.4.1.Final + ${os-maven-plugin.version} - - org.apache.maven.plugins - maven-resources-plugin - 2.4.3 - - ${project.build.sourceEncoding} - - org.xolstice.maven.plugins protobuf-maven-plugin - 0.5.0 + ${protobuf-maven-plugin.version} + + + + apm-sdk-plugin + org.apache.skywalking + 5.0.0-GA-SNAPSHOT + + 4.0.0 + + apm-activemq-5.x-plugin + activemq-5.x-plugin + jar + + + UTF-8 + 5.14.5 + + + + + org.apache.activemq + activemq-client + ${activemq-client.version} + provided + + + diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerConstructorInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerConstructorInterceptor.java new file mode 100644 index 000000000000..638bc03ff362 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerConstructorInterceptor.java @@ -0,0 +1,34 @@ +/* + * 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.skywalking.apm.plugin.activemq; + +import org.apache.activemq.ActiveMQSession; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; + +/** + * @author withlin + */ +public class ActiveMQConsumerConstructorInterceptor implements InstanceConstructorInterceptor { + @Override + public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { + ActiveMQSession session = (ActiveMQSession)allArguments[0]; + objInst.setSkyWalkingDynamicField(session.getConnection().getTransport().getRemoteAddress().split("//")[1]); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java new file mode 100644 index 000000000000..be81bf58f151 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptor.java @@ -0,0 +1,85 @@ +/* + * 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.skywalking.apm.plugin.activemq; + +import org.apache.activemq.command.MessageDispatch; +import org.apache.skywalking.apm.agent.core.context.CarrierItem; +import org.apache.skywalking.apm.agent.core.context.ContextCarrier; +import org.apache.skywalking.apm.agent.core.context.ContextManager; +import org.apache.skywalking.apm.agent.core.context.tag.Tags; +import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan; +import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; +import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; + +import java.lang.reflect.Method; + +/** + * @author withlin + */ +public class ActiveMQConsumerInterceptor implements InstanceMethodsAroundInterceptor { + + public static final String OPERATE_NAME_PREFIX = "ActiveMQ/"; + public static final String CONSUMER_OPERATE_NAME_SUFFIX = "/Consumer"; + public static final byte QUEUE_TYPE = 1; + public static final byte TOPIC_TYPE = 2; + public static final byte TEMP_TOPIC_TYPE = 6; + public static final byte TEMP_QUEUE_TYPE = 5; + @Override + public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { + ContextCarrier contextCarrier = new ContextCarrier(); + String url = (String) objInst.getSkyWalkingDynamicField(); + MessageDispatch messageDispatch = (MessageDispatch) allArguments[0]; + AbstractSpan activeSpan = null; + if (messageDispatch.getDestination().getDestinationType() == QUEUE_TYPE || messageDispatch.getDestination().getDestinationType() == TEMP_QUEUE_TYPE) { + activeSpan = ContextManager.createEntrySpan(OPERATE_NAME_PREFIX + "Queue/" + messageDispatch.getDestination().getPhysicalName() + CONSUMER_OPERATE_NAME_SUFFIX, null).start(System.currentTimeMillis()); + Tags.MQ_BROKER.set(activeSpan, url); + Tags.MQ_QUEUE.set(activeSpan, messageDispatch.getDestination().getPhysicalName()); + } else if (messageDispatch.getDestination().getDestinationType() == TOPIC_TYPE || messageDispatch.getDestination().getDestinationType() == TEMP_TOPIC_TYPE) { + activeSpan = ContextManager.createEntrySpan(OPERATE_NAME_PREFIX + "Topic/" + messageDispatch.getDestination().getPhysicalName() + CONSUMER_OPERATE_NAME_SUFFIX, null).start(System.currentTimeMillis()); + Tags.MQ_BROKER.set(activeSpan, url); + Tags.MQ_TOPIC.set(activeSpan, messageDispatch.getDestination().getPhysicalName()); + } + activeSpan.setComponent(ComponentsDefine.ACTIVEMQ_CONSUMER); + SpanLayer.asMQ(activeSpan); + CarrierItem next = contextCarrier.items(); + while (next.hasNext()) { + next = next.next(); + next.setHeadValue(messageDispatch.getMessage().getProperty(next.getHeadKey()).toString()); + } + ContextManager.extract(contextCarrier); + + + } + + + @Override + public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Object ret) throws Throwable { + ContextManager.stopSpan(); + return ret; + + } + + @Override + public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { + ContextManager.activeSpan().errorOccurred().log(t); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerConstructorInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerConstructorInterceptor.java new file mode 100644 index 000000000000..30b9e4cfb723 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerConstructorInterceptor.java @@ -0,0 +1,34 @@ +/* + * 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.skywalking.apm.plugin.activemq; + +import org.apache.activemq.ActiveMQSession; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; + +/** + * @author withlin + */ +public class ActiveMQProducerConstructorInterceptor implements InstanceConstructorInterceptor { + @Override + public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { + ActiveMQSession session = (ActiveMQSession)allArguments[0]; + objInst.setSkyWalkingDynamicField(session.getConnection().getTransport().getRemoteAddress().split("//")[1]); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptor.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptor.java new file mode 100644 index 000000000000..37d1d00804d5 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptor.java @@ -0,0 +1,85 @@ +/* + * 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.skywalking.apm.plugin.activemq; + +import org.apache.activemq.command.ActiveMQDestination; +import org.apache.skywalking.apm.agent.core.context.CarrierItem; +import org.apache.skywalking.apm.agent.core.context.ContextCarrier; +import org.apache.skywalking.apm.agent.core.context.ContextManager; +import org.apache.skywalking.apm.agent.core.context.tag.Tags; +import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan; +import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; +import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; + +import javax.jms.Message; +import java.lang.reflect.Method; + +/** + * @author withlin + */ +public class ActiveMQProducerInterceptor implements InstanceMethodsAroundInterceptor { + public static final String OPERATE_NAME_PREFIX = "ActiveMQ/"; + public static final String PRODUCER_OPERATE_NAME_SUFFIX = "/Producer"; + public static final byte QUEUE_TYPE = 1; + public static final byte TOPIC_TYPE = 2; + public static final byte TEMP_TOPIC_TYPE = 6; + public static final byte TEMP_QUEUE_TYPE = 5; + @Override + public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { + + ContextCarrier contextCarrier = new ContextCarrier(); + ActiveMQDestination activeMQDestination = (ActiveMQDestination) allArguments[0]; + Message message = (Message) allArguments[1]; + String url = (String) objInst.getSkyWalkingDynamicField(); + AbstractSpan activeSpan = null; + if (activeMQDestination.getDestinationType() == QUEUE_TYPE || activeMQDestination.getDestinationType() == TEMP_QUEUE_TYPE) { + activeSpan = ContextManager.createExitSpan(OPERATE_NAME_PREFIX + "Queue/" + activeMQDestination.getPhysicalName() + PRODUCER_OPERATE_NAME_SUFFIX, contextCarrier, url); + Tags.MQ_BROKER.set(activeSpan,url); + Tags.MQ_QUEUE.set(activeSpan,activeMQDestination.getPhysicalName()); + + } else if (activeMQDestination.getDestinationType() == TOPIC_TYPE || activeMQDestination.getDestinationType() == TEMP_TOPIC_TYPE) { + activeSpan = ContextManager.createExitSpan(OPERATE_NAME_PREFIX + "Topic/" + activeMQDestination.getPhysicalName() + PRODUCER_OPERATE_NAME_SUFFIX, contextCarrier, url); + Tags.MQ_BROKER.set(activeSpan, url); + Tags.MQ_TOPIC.set(activeSpan,activeMQDestination.getPhysicalName()); + } + SpanLayer.asMQ(activeSpan); + activeSpan.setComponent(ComponentsDefine.ACTIVEMQ_PRODUCER); + CarrierItem next = contextCarrier.items(); + + while (next.hasNext()) { + next = next.next(); + message.setStringProperty(next.getHeadKey(),next.getHeadValue()); + } + + } + + @Override + public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Object ret) throws Throwable { + ContextManager.stopSpan(); + return ret; + } + + @Override + public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { + ContextManager.activeSpan().errorOccurred().log(t); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQConsumerInstrumentation.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQConsumerInstrumentation.java new file mode 100644 index 000000000000..6357fa2ac3c7 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQConsumerInstrumentation.java @@ -0,0 +1,83 @@ +/* + * 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.skywalking.apm.plugin.activemq.define; + +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; +import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; +import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch; + + +import static net.bytebuddy.matcher.ElementMatchers.named; +import static org.apache.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch.takesArgumentWithType; + +/** + * {@link ActiveMQConsumerInstrumentation} presents that skywalking intercepts {@link org.apache.activemq.ActiveMQMessageConsumer}. + * + * @author withlin + */ +public class ActiveMQConsumerInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { + public static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQConsumerInterceptor"; + public static final String ENHANCE_CLASS_CONSUMER = "org.apache.activemq.ActiveMQMessageConsumer"; + public static final String CONSTRUCTOR_INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQConsumerConstructorInterceptor"; + public static final String ENHANCE_METHOD_DISPATCH = "dispatch"; + public static final String CONSTRUCTOR_INTERCEPT_TYPE = "org.apache.activemq.ActiveMQSession"; + @Override + protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { + return new ConstructorInterceptPoint[] { + new ConstructorInterceptPoint() { + @Override public ElementMatcher getConstructorMatcher() { + return takesArgumentWithType(0,CONSTRUCTOR_INTERCEPT_TYPE); + } + + @Override public String getConstructorInterceptor() { + return CONSTRUCTOR_INTERCEPTOR_CLASS; + } + } + }; + } + + @Override + protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { + return new InstanceMethodsInterceptPoint[] { + new InstanceMethodsInterceptPoint() { + @Override public ElementMatcher getMethodsMatcher() { + return named(ENHANCE_METHOD_DISPATCH); + } + + + @Override public String getMethodsInterceptor() { + return INTERCEPTOR_CLASS; + } + + @Override public boolean isOverrideArgs() { + return false; + } + } + }; + } + + @Override + protected ClassMatch enhanceClass() { + return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS_CONSUMER); + } +} \ No newline at end of file diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQProducerInstrumentation.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQProducerInstrumentation.java new file mode 100644 index 000000000000..56b280ddb798 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/activemq/define/ActiveMQProducerInstrumentation.java @@ -0,0 +1,83 @@ +/* + * 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.skywalking.apm.plugin.activemq.define; + +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; +import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; +import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch; + + +import static net.bytebuddy.matcher.ElementMatchers.named; +import static org.apache.skywalking.apm.agent.core.plugin.bytebuddy.ArgumentTypeNameMatch.takesArgumentWithType; + +/** + * {@link ActiveMQProducerInstrumentation} presents that skywalking intercepts {@link org.apache.activemq.ActiveMQMessageProducer}. + * + * @author withlin + */ +public class ActiveMQProducerInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { + public static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQProducerInterceptor"; + public static final String ENHANCE_CLASS_PRODUCER = "org.apache.activemq.ActiveMQMessageProducer"; + public static final String CONSTRUCTOR_INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.activemq.ActiveMQProducerConstructorInterceptor"; + public static final String ENHANCE_METHOD = "send"; + public static final String CONSTRUCTOR_INTERCEPT_TYPE = "org.apache.activemq.ActiveMQSession"; + @Override + protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { + return new ConstructorInterceptPoint[] { + new ConstructorInterceptPoint() { + @Override public ElementMatcher getConstructorMatcher() { + return takesArgumentWithType(0,CONSTRUCTOR_INTERCEPT_TYPE); + } + + @Override public String getConstructorInterceptor() { + return CONSTRUCTOR_INTERCEPTOR_CLASS; + } + } + }; + } + + @Override + protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { + return new InstanceMethodsInterceptPoint[] { + new InstanceMethodsInterceptPoint() { + @Override public ElementMatcher getMethodsMatcher() { + return named(ENHANCE_METHOD).and(takesArgumentWithType(0,"javax.jms.Destination")).and(takesArgumentWithType(1,"javax.jms.Message")); + } + + + @Override public String getMethodsInterceptor() { + return INTERCEPTOR_CLASS; + } + + @Override public boolean isOverrideArgs() { + return false; + } + } + }; + } + + @Override + protected ClassMatch enhanceClass() { + return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS_PRODUCER); + } +} \ No newline at end of file diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/resources/skywalking-plugin.def b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/resources/skywalking-plugin.def new file mode 100644 index 000000000000..d9528a6bd519 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/main/resources/skywalking-plugin.def @@ -0,0 +1,18 @@ +# 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. + +activemq-5.x=org.apache.skywalking.apm.plugin.activemq.define.ActiveMQProducerInstrumentation +activemq-5.x=org.apache.skywalking.apm.plugin.activemq.define.ActiveMQConsumerInstrumentation diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerAndProducerConstructorInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerAndProducerConstructorInterceptorTest.java new file mode 100644 index 000000000000..a0eba2b6c1ad --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerAndProducerConstructorInterceptorTest.java @@ -0,0 +1,219 @@ +/* + * 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.skywalking.apm.plugin.activemq; + +import org.apache.activemq.ActiveMQConnection; +import org.apache.activemq.ActiveMQSession; +import org.apache.activemq.command.SessionId; +import org.apache.activemq.management.JMSStatsImpl; +import org.apache.activemq.transport.FutureResponse; +import org.apache.activemq.transport.ResponseCallback; +import org.apache.activemq.transport.Transport; +import org.apache.activemq.transport.TransportListener; +import org.apache.activemq.util.IdGenerator; +import org.apache.activemq.wireformat.WireFormat; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; + +import javax.jms.JMSException; +import java.io.IOException; +import java.net.URI; +import java.security.cert.X509Certificate; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; + + +public class ActiveMQConsumerAndProducerConstructorInterceptorTest { + + @Mock + private ActiveMQConnection activeMQConnection; + + private IdGenerator idGenerator; + + private JMSStatsImpl jmsStats; + + + @Mock + private ActiveMQSession activeMQSession; + + private SessionId sessionId; + + + public class TransportTest implements Transport { + + private String remoteAddress; + @Override + public void oneway(Object o) throws IOException { + + } + + @Override + public FutureResponse asyncRequest(Object o, ResponseCallback responseCallback) throws IOException { + return null; + } + + @Override + public Object request(Object o) throws IOException { + return null; + } + + @Override + public Object request(Object o, int i) throws IOException { + return null; + } + + @Override + public TransportListener getTransportListener() { + return null; + } + + @Override + public void setTransportListener(TransportListener transportListener) { + + } + + @Override + public T narrow(Class aClass) { + return null; + } + + @Override + public String getRemoteAddress() { + return this.remoteAddress; + } + + public String setRemoteAddress(String remoteAddress) { + return this.remoteAddress = remoteAddress; + } + + @Override + public boolean isFaultTolerant() { + return false; + } + + @Override + public boolean isDisposed() { + return false; + } + + @Override + public boolean isConnected() { + return false; + } + + @Override + public boolean isReconnectSupported() { + return false; + } + + @Override + public boolean isUpdateURIsSupported() { + return false; + } + + @Override + public void reconnect(URI uri) throws IOException { + + } + + @Override + public void updateURIs(boolean b, URI[] uris) throws IOException { + + } + + @Override + public int getReceiveCounter() { + return 0; + } + + @Override + public X509Certificate[] getPeerCertificates() { + return new X509Certificate[0]; + } + + @Override + public void setPeerCertificates(X509Certificate[] x509Certificates) { + + } + + @Override + public WireFormat getWireFormat() { + return null; + } + + @Override + public void start() throws Exception { + + } + + @Override + public void stop() throws Exception { + + } + } + + public class TestConnection extends ActiveMQConnection { + + public TestConnection(Transport transport, IdGenerator clientIdGenerator, IdGenerator connectionIdGenerator, JMSStatsImpl factoryStats) throws Exception { + super(transport, clientIdGenerator, connectionIdGenerator, factoryStats); + } + } + + private class TestActiveMQSession extends ActiveMQSession { + + public TestActiveMQSession(ActiveMQConnection connection, SessionId sessionId, int acknowledgeMode, boolean asyncDispatch, boolean sessionAsyncDispatch) throws JMSException { + super(connection, sessionId, acknowledgeMode, asyncDispatch, sessionAsyncDispatch); + } + } + + private ActiveMQConsumerConstructorInterceptor activeMQConsumerAndProducerConstructorInterceptor; + + private EnhancedInstance enhancedInstance = new EnhancedInstance() { + private String test; + @Override + public Object getSkyWalkingDynamicField() { + return test; + } + + @Override + public void setSkyWalkingDynamicField(Object value) { + test = (String)value; + } + }; + @Before + public void setUp() throws Exception { + TransportTest transport = new TransportTest(); + transport.setRemoteAddress("tcp://127.0.0.1:61616"); + idGenerator = new IdGenerator("aaa"); + jmsStats = new JMSStatsImpl(); + activeMQConnection = new TestConnection(transport,idGenerator,idGenerator,jmsStats); + sessionId = new SessionId(); + activeMQSession = new TestActiveMQSession(activeMQConnection,sessionId,1,true,true); + } + + @Test + public void TestActiveMQConsumerAndProducerConstructorInterceptor() { + activeMQConsumerAndProducerConstructorInterceptor = new ActiveMQConsumerConstructorInterceptor(); + activeMQConsumerAndProducerConstructorInterceptor.onConstruct(enhancedInstance,new Object[] {activeMQSession}); + assertThat((String) enhancedInstance.getSkyWalkingDynamicField(), is("127.0.0.1:61616")); + } +} \ No newline at end of file diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptorTest.java new file mode 100644 index 000000000000..ea77903b6170 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQConsumerInterceptorTest.java @@ -0,0 +1,151 @@ +/* + * 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.skywalking.apm.plugin.activemq; + +import org.apache.activemq.command.ActiveMQDestination; +import org.apache.activemq.command.Message; +import org.apache.activemq.command.MessageDispatch; +import org.apache.activemq.command.Response; +import org.apache.activemq.state.CommandVisitor; +import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.test.tools.AgentServiceRule; +import org.apache.skywalking.apm.agent.test.tools.SegmentStorage; +import org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint; +import org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner; +import org.junit.*; +import org.junit.runner.RunWith; +import org.powermock.modules.junit4.PowerMockRunner; +import org.powermock.modules.junit4.PowerMockRunnerDelegate; +import javax.jms.JMSException; +import java.io.IOException; + +import java.util.List; + +import static org.hamcrest.CoreMatchers.is; + +import org.junit.Before; +import org.junit.Test; + +@RunWith(PowerMockRunner.class) +@PowerMockRunnerDelegate(TracingSegmentRunner.class) +public class ActiveMQConsumerInterceptorTest { + + @SegmentStoragePoint + private SegmentStorage segmentStorage; + + @Rule + public AgentServiceRule serviceRule = new AgentServiceRule(); + + private ActiveMQConsumerInterceptor activeMQConsumerInterceptor; + + private Object[] arguments; + + private Class[] argumentType; + + private MessageDispatch messageDispatch; + + public class Des extends ActiveMQDestination { + + @Override + protected String getQualifiedPrefix() { + return null; + } + + @Override + public byte getDestinationType() { + return 1; + } + + @Override + public byte getDataStructureType() { + return 0; + } + } + + public class Msg extends Message { + + @Override + public Message copy() { + return null; + } + + @Override + public void clearBody() throws JMSException { + + } + + @Override + public void storeContent() { + + } + + @Override + public void storeContentAndClear() { + + } + + @Override + public Response visit(CommandVisitor commandVisitor) throws Exception { + return null; + } + + @Override + public byte getDataStructureType() { + return 0; + } + } + + private EnhancedInstance enhancedInstance = new EnhancedInstance() { + @Override + public Object getSkyWalkingDynamicField() { + return "localhost:60601"; + } + + @Override + public void setSkyWalkingDynamicField(Object value) { + } + }; + + @Before + public void setUp() throws IOException { + activeMQConsumerInterceptor = new ActiveMQConsumerInterceptor(); + messageDispatch = new MessageDispatch(); + + Des des = new Des(); + des.setPhysicalName("test"); + messageDispatch.setDestination(des); + Message msg = new Msg(); + msg.setProperty("sw3",""); + messageDispatch.setMessage(msg); + arguments = new Object[] {messageDispatch}; + argumentType = null; + } + + @Test + public void testConsumerWithoutMessage() throws Throwable { + activeMQConsumerInterceptor.beforeMethod(enhancedInstance,null,arguments,null,null); + activeMQConsumerInterceptor.afterMethod(enhancedInstance, null, arguments, null, null); + + List traceSegments = segmentStorage.getTraceSegments(); + Assert.assertThat(traceSegments.size(), is(1)); + } + +} \ No newline at end of file diff --git a/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptorTest.java b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptorTest.java new file mode 100644 index 000000000000..46387d650e1b --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/activemq-5.x-plugin/src/test/java/org/apache/skywalking/apm/plugin/activemq/ActiveMQProducerInterceptorTest.java @@ -0,0 +1,365 @@ +/* + * 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.skywalking.apm.plugin.activemq; + +import java.util.List; + +import org.apache.activemq.ActiveMQMessageProducer; +import org.apache.activemq.command.ActiveMQDestination; +import org.apache.skywalking.apm.agent.core.context.trace.AbstractTracingSpan; +import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer; +import org.apache.skywalking.apm.agent.core.context.trace.TraceSegment; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.test.helper.SegmentHelper; +import org.apache.skywalking.apm.agent.test.tools.AgentServiceRule; +import org.apache.skywalking.apm.agent.test.tools.SegmentStorage; +import org.apache.skywalking.apm.agent.test.tools.SegmentStoragePoint; +import org.apache.skywalking.apm.agent.test.tools.SpanAssert; +import org.apache.skywalking.apm.agent.test.tools.TracingSegmentRunner; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.modules.junit4.PowerMockRunner; +import org.powermock.modules.junit4.PowerMockRunnerDelegate; + +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.Message; +import java.util.Enumeration; + +import static org.apache.skywalking.apm.network.trace.component.ComponentsDefine.ACTIVEMQ_PRODUCER; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +@RunWith(PowerMockRunner.class) +@PowerMockRunnerDelegate(TracingSegmentRunner.class) +public class ActiveMQProducerInterceptorTest { + + @SegmentStoragePoint + private SegmentStorage segmentStorage; + + @Rule + public AgentServiceRule serviceRule = new AgentServiceRule(); + + private ActiveMQProducerInterceptor producerInterceptor; + + private Object[] arguments; + + private Class[] argumentType; + + + private MQDestination mqDestination; + + + private Message message; + + + + private class MQDestination extends ActiveMQDestination { + + @Override + protected String getQualifiedPrefix() { + return null; + } + + @Override + public byte getDestinationType() { + return 1; + } + + @Override + public byte getDataStructureType() { + return 1; + } + } + + public class Msg implements Message { + + @Override + public String getJMSMessageID() throws JMSException { + return null; + } + + @Override + public void setJMSMessageID(String s) throws JMSException { + + } + + @Override + public long getJMSTimestamp() throws JMSException { + return 0; + } + + @Override + public void setJMSTimestamp(long l) throws JMSException { + + } + + @Override + public byte[] getJMSCorrelationIDAsBytes() throws JMSException { + return new byte[0]; + } + + @Override + public void setJMSCorrelationIDAsBytes(byte[] bytes) throws JMSException { + + } + + @Override + public void setJMSCorrelationID(String s) throws JMSException { + + } + + @Override + public String getJMSCorrelationID() throws JMSException { + return null; + } + + @Override + public Destination getJMSReplyTo() throws JMSException { + return null; + } + + @Override + public void setJMSReplyTo(Destination destination) throws JMSException { + + } + + @Override + public Destination getJMSDestination() throws JMSException { + return null; + } + + @Override + public void setJMSDestination(Destination destination) throws JMSException { + + } + + @Override + public int getJMSDeliveryMode() throws JMSException { + return 0; + } + + @Override + public void setJMSDeliveryMode(int i) throws JMSException { + + } + + @Override + public boolean getJMSRedelivered() throws JMSException { + return false; + } + + @Override + public void setJMSRedelivered(boolean b) throws JMSException { + + } + + @Override + public String getJMSType() throws JMSException { + return null; + } + + @Override + public void setJMSType(String s) throws JMSException { + + } + + @Override + public long getJMSExpiration() throws JMSException { + return 0; + } + + @Override + public void setJMSExpiration(long l) throws JMSException { + + } + + @Override + public int getJMSPriority() throws JMSException { + return 0; + } + + @Override + public void setJMSPriority(int i) throws JMSException { + + } + + @Override + public void clearProperties() throws JMSException { + + } + + @Override + public boolean propertyExists(String s) throws JMSException { + return false; + } + + @Override + public boolean getBooleanProperty(String s) throws JMSException { + return false; + } + + @Override + public byte getByteProperty(String s) throws JMSException { + return 0; + } + + @Override + public short getShortProperty(String s) throws JMSException { + return 0; + } + + @Override + public int getIntProperty(String s) throws JMSException { + return 0; + } + + @Override + public long getLongProperty(String s) throws JMSException { + return 0; + } + + @Override + public float getFloatProperty(String s) throws JMSException { + return 0; + } + + @Override + public double getDoubleProperty(String s) throws JMSException { + return 0; + } + + @Override + public String getStringProperty(String s) throws JMSException { + return null; + } + + @Override + public Object getObjectProperty(String s) throws JMSException { + return null; + } + + @Override + public Enumeration getPropertyNames() throws JMSException { + return null; + } + + @Override + public void setBooleanProperty(String s, boolean b) throws JMSException { + + } + + @Override + public void setByteProperty(String s, byte b) throws JMSException { + + } + + @Override + public void setShortProperty(String s, short i) throws JMSException { + + } + + @Override + public void setIntProperty(String s, int i) throws JMSException { + + } + + @Override + public void setLongProperty(String s, long l) throws JMSException { + + } + + @Override + public void setFloatProperty(String s, float v) throws JMSException { + + } + + @Override + public void setDoubleProperty(String s, double v) throws JMSException { + + } + + @Override + public void setStringProperty(String s, String s1) throws JMSException { + + } + + @Override + public void setObjectProperty(String s, Object o) throws JMSException { + + } + + @Override + public void acknowledge() throws JMSException { + + } + + @Override + public void clearBody() throws JMSException { + + } + } + + private EnhancedInstance enhancedInstance = new EnhancedInstance() { + @Override + public Object getSkyWalkingDynamicField() { + return "localhost:60601"; + } + + @Override + public void setSkyWalkingDynamicField(Object value) { + } + }; + + + @Before + public void setUp() { + producerInterceptor = new ActiveMQProducerInterceptor(); + mqDestination = new MQDestination(); + mqDestination.setPhysicalName("test"); + message = new Msg(); + arguments = new Object[] {mqDestination, message}; + argumentType = new Class[] {ActiveMQMessageProducer.class}; + + } + + @Test + public void testSendMessage() throws Throwable { + producerInterceptor.beforeMethod(enhancedInstance, null, arguments, null, null); + producerInterceptor.afterMethod(enhancedInstance, null, arguments, null, null); + + List traceSegmentList = segmentStorage.getTraceSegments(); + assertThat(traceSegmentList.size(), is(1)); + + TraceSegment segment = traceSegmentList.get(0); + List spans = SegmentHelper.getSpans(segment); + assertThat(spans.size(), is(1)); + assertMessageSpan(spans.get(0)); + } + + private void assertMessageSpan(AbstractTracingSpan span) { + SpanAssert.assertTag(span, 0, "localhost:60601"); + SpanAssert.assertTag(span, 1, "test"); + SpanAssert.assertComponent(span, ACTIVEMQ_PRODUCER); + SpanAssert.assertLayer(span, SpanLayer.MQ); + assertThat(span.getOperationName(), is("ActiveMQ/Queue/test/Producer")); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/dubbo-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/dubbo-plugin/pom.xml index 16300f6938f2..04953d966c9f 100644 --- a/apm-sniffer/apm-sdk-plugin/dubbo-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/dubbo-plugin/pom.xml @@ -20,7 +20,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -32,33 +32,15 @@ UTF-8 + 2.5.10 com.alibaba dubbo - 2.5.10 + ${dubbo.version} provided - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - diff --git a/apm-sniffer/apm-sdk-plugin/elastic-job-2.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/elastic-job-2.x-plugin/pom.xml index 26b29fbaf183..01b2560f303c 100644 --- a/apm-sniffer/apm-sdk-plugin/elastic-job-2.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/elastic-job-2.x-plugin/pom.xml @@ -21,7 +21,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -47,23 +47,8 @@ - org.apache.maven.plugins maven-deploy-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - - jar - - - - diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/pom.xml new file mode 100644 index 000000000000..60cfa04f832b --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/pom.xml @@ -0,0 +1,50 @@ + + + + + apm-sdk-plugin + org.apache.skywalking + 5.0.0-GA-SNAPSHOT + + 4.0.0 + + apm-elasticsearch-5.x-plugin + jar + + elasticsearch-5.x-plugin + http://maven.apache.org + + + UTF-8 + 1.8 + ${java.version} + ${java.version} + 5.6.6 + + + + + org.elasticsearch.client + transport + ${elasticsearch-client-transport.version} + provided + + + + \ No newline at end of file diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/ActionRequestBuilderInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/ActionRequestBuilderInterceptor.java new file mode 100644 index 000000000000..880b3644207a --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/ActionRequestBuilderInterceptor.java @@ -0,0 +1,65 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5; + +import org.apache.skywalking.apm.agent.core.context.ContextManager; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; +import org.elasticsearch.client.transport.TransportClient; + +import static org.apache.skywalking.apm.plugin.elasticsearch.v5.Constants.ES_ENHANCE_INFO; + +/** + * @author oatiz. + */ +public class ActionRequestBuilderInterceptor implements InstanceConstructorInterceptor { + + @Override + public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { + ElasticSearchEnhanceInfo enhanceInfo = new ElasticSearchEnhanceInfo(); + + parseClientInfo(allArguments[0], enhanceInfo); + + ContextManager.getRuntimeContext().put(ES_ENHANCE_INFO, enhanceInfo); + } + + private void parseClientInfo(Object client, ElasticSearchEnhanceInfo enhanceInfo) { + + if (client instanceof TransportClient) { + TransportClient transportClient = (TransportClient) client; + + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < transportClient.transportAddresses().size(); i++) { + if (i != transportClient.transportAddresses().size() - 1) { + builder.append(transportClient.transportAddresses().get(i).toString()).append(","); + } else { + builder.append(transportClient.transportAddresses().get(i).toString()); + } + } + + enhanceInfo.setTransportAddress(builder.toString()); + } else { + // avoid NPE + enhanceInfo.setTransportAddress(""); + } + + + } + +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/Constants.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/Constants.java new file mode 100644 index 000000000000..45aed756d223 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/Constants.java @@ -0,0 +1,46 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5; + +/** + * @author oatiz. + */ +class Constants { + + static final String DB_TYPE = "Elasticsearch"; + + static final String ELASTICSEARCH_DB_OP_PREFIX = "Elasticsearch/"; + + static final String ES_ENHANCE_INFO = "es_enhance_info"; + + static final String BASE_FUTURE_METHOD = "actionGet"; + + static final String ES_NODE = "node.address"; + + static final String ES_INDEX = "es.indices"; + + static final String ES_TYPE = "es.types"; + + static final String ES_TOOK_MILLIS = "es.took_millis"; + + static final String ES_TOTAL_HITS = "es.total_hits"; + + static final String ES_INGEST_TOOK_MILLIS = "es.ingest_took_millis"; + +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/ElasticSearchEnhanceInfo.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/ElasticSearchEnhanceInfo.java new file mode 100644 index 000000000000..1edcd7b2901b --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/ElasticSearchEnhanceInfo.java @@ -0,0 +1,98 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5; + +/** + * @author oatiz. + */ +public class ElasticSearchEnhanceInfo { + /** + * elasticsearch host and port + */ + private String transportAddress; + /** + * elasticsearch cluster name + */ + private String clusterName; + /** + * elasticsearch indices + */ + private String indices; + /** + * elasticsearch types + */ + private String types; + /** + * operation type: INDEX, CREATE, UPDATE, DELETE, BULK-bulkNum, defaultActionName + */ + private String opType; + /** + * source dsl + */ + private String source; + + public String getTransportAddress() { + return transportAddress; + } + + public void setTransportAddress(String transportAddress) { + this.transportAddress = transportAddress; + } + + public String getClusterName() { + return clusterName; + } + + public void setClusterName(String clusterName) { + this.clusterName = clusterName; + } + + public String getIndices() { + return indices; + } + + public void setIndices(String indices) { + this.indices = indices; + } + + public String getTypes() { + return types; + } + + public void setTypes(String types) { + this.types = types; + } + + public String getOpType() { + return opType; + } + + public void setOpType(String opType) { + this.opType = opType; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/PlainListenableActionFutureInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/PlainListenableActionFutureInterceptor.java new file mode 100644 index 000000000000..016a2aba0b9d --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/PlainListenableActionFutureInterceptor.java @@ -0,0 +1,70 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5; + +import org.apache.skywalking.apm.agent.core.context.ContextManager; +import org.apache.skywalking.apm.agent.core.context.tag.Tags; +import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; +import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; +import org.elasticsearch.action.bulk.BulkResponse; +import org.elasticsearch.action.search.SearchResponse; + +import java.lang.reflect.Method; + +import static org.apache.skywalking.apm.plugin.elasticsearch.v5.Constants.*; + +/** + * @author oatiz. + */ +public class PlainListenableActionFutureInterceptor implements InstanceMethodsAroundInterceptor { + + @Override + public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { + AbstractSpan span = ContextManager.createLocalSpan(ELASTICSEARCH_DB_OP_PREFIX + BASE_FUTURE_METHOD); + span.setComponent(ComponentsDefine.TRANSPORT_CLIENT); + Tags.DB_TYPE.set(span, DB_TYPE); + } + + @Override + public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, Object ret) throws Throwable { + AbstractSpan span = ContextManager.activeSpan(); + if (ret instanceof SearchResponse) { + SearchResponse response = (SearchResponse) ret; + span.tag(ES_TOOK_MILLIS, Long.toString(response.getTookInMillis())); + span.tag(ES_TOTAL_HITS, Long.toString(response.getHits().getTotalHits())); + } else if (ret instanceof BulkResponse) { + BulkResponse response = (BulkResponse) ret; + span.tag(ES_TOOK_MILLIS, Long.toString(response.getTookInMillis())); + span.tag(ES_INGEST_TOOK_MILLIS, Long.toString(response.getIngestTookInMillis())); + } + ContextManager.stopSpan(); + return ret; + } + + @Override + public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, Throwable t) { + ContextManager.activeSpan().errorOccurred().log(t); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportActionNodeProxyInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportActionNodeProxyInterceptor.java new file mode 100644 index 000000000000..9f3a866d3ac3 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportActionNodeProxyInterceptor.java @@ -0,0 +1,77 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5; + +import org.apache.skywalking.apm.agent.core.context.ContextManager; +import org.apache.skywalking.apm.agent.core.context.tag.Tags; +import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan; +import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; +import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; +import org.elasticsearch.cluster.node.DiscoveryNode; + +import java.lang.reflect.Method; + +import static org.apache.skywalking.apm.agent.core.conf.Config.Plugin.Elasticsearch.TRACE_DSL; +import static org.apache.skywalking.apm.plugin.elasticsearch.v5.Constants.*; +import static org.apache.skywalking.apm.plugin.elasticsearch.v5.Util.wrapperNullStringValue; + +/** + * @author oatiz. + */ +public class TransportActionNodeProxyInterceptor implements InstanceMethodsAroundInterceptor { + + @Override + public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { + + ElasticSearchEnhanceInfo enhanceInfo = (ElasticSearchEnhanceInfo) ContextManager.getRuntimeContext().get(ES_ENHANCE_INFO); + + String opType = allArguments[1].getClass().getSimpleName(); + String operationName = ELASTICSEARCH_DB_OP_PREFIX + opType; + AbstractSpan span = ContextManager.createExitSpan(operationName, enhanceInfo.getTransportAddress()); + span.setComponent(ComponentsDefine.TRANSPORT_CLIENT); + Tags.DB_TYPE.set(span, DB_TYPE); + Tags.DB_INSTANCE.set(span, enhanceInfo.getClusterName()); + if (TRACE_DSL) { + Tags.DB_STATEMENT.set(span, enhanceInfo.getSource()); + } + span.tag(ES_NODE, ((DiscoveryNode) allArguments[0]).getAddress().toString()); + span.tag(ES_INDEX, wrapperNullStringValue(enhanceInfo.getIndices())); + span.tag(ES_TYPE, wrapperNullStringValue(enhanceInfo.getTypes())); + SpanLayer.asDB(span); + ContextManager.getRuntimeContext().remove(ES_ENHANCE_INFO); + } + + @Override + public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, Object ret) throws Throwable { + ContextManager.stopSpan(); + return ret; + } + + @Override + public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, Throwable t) { + ContextManager.activeSpan().errorOccurred().log(t); + } + +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportProxyClientInterceptor.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportProxyClientInterceptor.java new file mode 100644 index 000000000000..76b713a96b5c --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/TransportProxyClientInterceptor.java @@ -0,0 +1,156 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5; + +import org.apache.skywalking.apm.agent.core.context.ContextManager; +import org.apache.skywalking.apm.agent.core.logging.api.ILog; +import org.apache.skywalking.apm.agent.core.logging.api.LogManager; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; +import org.apache.skywalking.apm.util.StringUtil; +import org.elasticsearch.action.delete.DeleteRequest; +import org.elasticsearch.action.get.GetRequest; +import org.elasticsearch.action.index.IndexRequest; +import org.elasticsearch.action.search.SearchRequest; +import org.elasticsearch.action.update.UpdateRequest; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentFactory; + +import java.io.IOException; +import java.lang.reflect.Method; + +import static org.apache.skywalking.apm.agent.core.conf.Config.Plugin.Elasticsearch.TRACE_DSL; +import static org.apache.skywalking.apm.plugin.elasticsearch.v5.Constants.ES_ENHANCE_INFO; +import static org.apache.skywalking.apm.plugin.elasticsearch.v5.Util.wrapperNullStringValue; + +/** + * @author oatiz. + */ +public class TransportProxyClientInterceptor implements InstanceConstructorInterceptor, InstanceMethodsAroundInterceptor { + + private static final ILog logger = LogManager.getLogger(TransportProxyClientInterceptor.class); + + @Override + public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { + Settings settings = (Settings) allArguments[0]; + String clusterName = settings.get("cluster.name"); + objInst.setSkyWalkingDynamicField(wrapperNullStringValue(clusterName)); + } + + @Override + public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { + ElasticSearchEnhanceInfo enhanceInfo = (ElasticSearchEnhanceInfo) ContextManager.getRuntimeContext().get(ES_ENHANCE_INFO); + enhanceInfo.setClusterName((String) objInst.getSkyWalkingDynamicField()); + parseRequestInfo(allArguments[1], enhanceInfo); + } + + @Override + public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, Object ret) throws Throwable { + return ret; + } + + @Override + public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, + Class[] argumentsTypes, Throwable t) { + ContextManager.activeSpan().errorOccurred().log(t); + } + + private void parseRequestInfo(Object request, ElasticSearchEnhanceInfo enhanceInfo) { + // search request + if (request instanceof SearchRequest) { + parseSearchRequest(request, enhanceInfo); + return; + } + // get request + if (request instanceof GetRequest) { + parseGetRequest(request, enhanceInfo); + return; + } + // index request + if (request instanceof IndexRequest) { + parseIndexRequest(request, enhanceInfo); + return; + } + // update request + if (request instanceof UpdateRequest) { + parseUpdateRequest(request, enhanceInfo); + return; + } + // delete request + if (request instanceof DeleteRequest) { + parseDeleteRequest(request, enhanceInfo); + } + } + + private void parseSearchRequest(Object request, ElasticSearchEnhanceInfo enhanceInfo) { + SearchRequest searchRequest = (SearchRequest) request; + enhanceInfo.setIndices(StringUtil.join(',', searchRequest.indices())); + enhanceInfo.setTypes(StringUtil.join(',', searchRequest.types())); + if (TRACE_DSL) { + enhanceInfo.setSource(null == searchRequest.source() ? "" : searchRequest.source().toString()); + } + } + + private void parseGetRequest(Object request, ElasticSearchEnhanceInfo enhanceInfo) { + GetRequest getRequest = (GetRequest) request; + enhanceInfo.setIndices(StringUtil.join(',', getRequest.indices())); + enhanceInfo.setTypes(getRequest.type()); + if (TRACE_DSL) { + enhanceInfo.setSource(getRequest.toString()); + } + } + + private void parseIndexRequest(Object request, ElasticSearchEnhanceInfo enhanceInfo) { + IndexRequest indexRequest = (IndexRequest) request; + enhanceInfo.setIndices(StringUtil.join(',', indexRequest.indices())); + enhanceInfo.setTypes(indexRequest.type()); + if (TRACE_DSL) { + enhanceInfo.setSource(indexRequest.toString()); + } + } + + private void parseUpdateRequest(Object request, ElasticSearchEnhanceInfo enhanceInfo) { + UpdateRequest updateRequest = (UpdateRequest) request; + enhanceInfo.setIndices(StringUtil.join(',', updateRequest.indices())); + enhanceInfo.setTypes(updateRequest.type()); + if (TRACE_DSL) { + String updateDsl = ""; + try { + updateDsl = updateRequest.toXContent(XContentFactory.jsonBuilder(), null).string(); + } catch (IOException e) { + logger.warn("trace update request dsl error: ", e); + } + enhanceInfo.setSource(updateDsl); + } + } + + private void parseDeleteRequest(Object request, ElasticSearchEnhanceInfo enhanceInfo) { + DeleteRequest deleteRequest = (DeleteRequest) request; + enhanceInfo.setIndices(StringUtil.join(',', deleteRequest.indices())); + enhanceInfo.setTypes(deleteRequest.type()); + if (TRACE_DSL) { + enhanceInfo.setSource(deleteRequest.toString()); + } + } + +} diff --git a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/ReaderAccountTest.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/Util.java similarity index 59% rename from apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/ReaderAccountTest.java rename to apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/Util.java index 3cfe631a346c..293ed1a36f84 100644 --- a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/ReaderAccountTest.java +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/Util.java @@ -16,22 +16,20 @@ * */ -package org.apache.skywalking.apm.webapp.security; +package org.apache.skywalking.apm.plugin.elasticsearch.v5; -import java.io.BufferedReader; -import java.io.StringReader; -import org.junit.Test; +import static org.apache.skywalking.apm.util.StringUtil.isEmpty; -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; - -public class ReaderAccountTest { +/** + * @author oatiz. + */ +class Util { - @Test - public void assertNewReaderAccount() { - Account account = ReaderAccount.newReaderAccount(new BufferedReader(new StringReader("{\"userName\": \"admin\", \"password\":\"888888\"}"))); - assertThat(account.userName(), is("admin")); - assertThat(account.password(), is("888888")); + static String wrapperNullStringValue(String value) { + if (isEmpty(value)) { + return ""; + } + return value; } - -} \ No newline at end of file + +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/ActionRequestBuilderInstrumentation.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/ActionRequestBuilderInstrumentation.java new file mode 100644 index 000000000000..b10c0f2bc3bf --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/ActionRequestBuilderInstrumentation.java @@ -0,0 +1,64 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5.define; + +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; +import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; + +import static net.bytebuddy.matcher.ElementMatchers.any; +import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; + +/** + * @author oatiz. + */ +public class ActionRequestBuilderInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { + + private static final String ENHANCE_CLASS = "org.apache.skywalking.apm.plugin.elasticsearch.v5.ActionRequestBuilderInterceptor"; + + @Override + protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { + return new ConstructorInterceptPoint[]{ + new ConstructorInterceptPoint() { + @Override + public ElementMatcher getConstructorMatcher() { + return any(); + } + + @Override + public String getConstructorInterceptor() { + return ENHANCE_CLASS; + } + } + }; + } + + @Override + protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { + return new InstanceMethodsInterceptPoint[0]; + } + + @Override + protected ClassMatch enhanceClass() { + return byName("org.elasticsearch.action.ActionRequestBuilder"); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/PlainListenableActionFutureInstrumentation.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/PlainListenableActionFutureInstrumentation.java new file mode 100644 index 000000000000..a77b590a3451 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/PlainListenableActionFutureInstrumentation.java @@ -0,0 +1,73 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5.define; + +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.StaticMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassEnhancePluginDefine; +import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; + +import static net.bytebuddy.matcher.ElementMatchers.named; +import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; + +/** + * @author oatiz. + */ +public class PlainListenableActionFutureInstrumentation extends ClassEnhancePluginDefine { + + @Override + protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { + return new ConstructorInterceptPoint[0]; + } + + @Override + protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { + return new InstanceMethodsInterceptPoint[]{ + new InstanceMethodsInterceptPoint() { + @Override + public ElementMatcher getMethodsMatcher() { + return named("actionGet"); + } + + @Override + public String getMethodsInterceptor() { + return "org.apache.skywalking.apm.plugin.elasticsearch.v5.PlainListenableActionFutureInterceptor"; + } + + @Override + public boolean isOverrideArgs() { + return false; + } + } + }; + } + + @Override + protected StaticMethodsInterceptPoint[] getStaticMethodsInterceptPoints() { + return new StaticMethodsInterceptPoint[0]; + } + + @Override + protected ClassMatch enhanceClass() { + return byName("org.elasticsearch.action.support.PlainListenableActionFuture"); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/TransportActionNodeProxyInstrumentation.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/TransportActionNodeProxyInstrumentation.java new file mode 100644 index 000000000000..9eb69512c749 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/TransportActionNodeProxyInstrumentation.java @@ -0,0 +1,73 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5.define; + +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.StaticMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassEnhancePluginDefine; +import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; + +import static net.bytebuddy.matcher.ElementMatchers.named; +import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; + +/** + * @author oatiz. + */ +public class TransportActionNodeProxyInstrumentation extends ClassEnhancePluginDefine { + + @Override + protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { + return new ConstructorInterceptPoint[0]; + } + + @Override + protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { + return new InstanceMethodsInterceptPoint[]{ + new InstanceMethodsInterceptPoint() { + @Override + public ElementMatcher getMethodsMatcher() { + return named("execute"); + } + + @Override + public String getMethodsInterceptor() { + return "org.apache.skywalking.apm.plugin.elasticsearch.v5.TransportActionNodeProxyInterceptor"; + } + + @Override + public boolean isOverrideArgs() { + return false; + } + } + }; + } + + @Override + protected StaticMethodsInterceptPoint[] getStaticMethodsInterceptPoints() { + return new StaticMethodsInterceptPoint[0]; + } + + @Override + protected ClassMatch enhanceClass() { + return byName("org.elasticsearch.action.TransportActionNodeProxy"); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/TransportProxyClientInstrumentation.java b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/TransportProxyClientInstrumentation.java new file mode 100644 index 000000000000..b3fa40ebefe4 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/elasticsearch/v5/define/TransportProxyClientInstrumentation.java @@ -0,0 +1,88 @@ +/* + * 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.skywalking.apm.plugin.elasticsearch.v5.define; + +import net.bytebuddy.description.method.MethodDescription; +import net.bytebuddy.matcher.ElementMatcher; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.StaticMethodsInterceptPoint; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassEnhancePluginDefine; +import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; + +import static net.bytebuddy.matcher.ElementMatchers.any; +import static net.bytebuddy.matcher.ElementMatchers.named; +import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; + +/** + * @author oatiz. + */ +public class TransportProxyClientInstrumentation extends ClassEnhancePluginDefine { + + private static final String ENHANCE_CLASS = "org.apache.skywalking.apm.plugin.elasticsearch.v5.TransportProxyClientInterceptor"; + + @Override + protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { + return new ConstructorInterceptPoint[]{ + new ConstructorInterceptPoint() { + @Override + public ElementMatcher getConstructorMatcher() { + return any(); + } + + @Override + public String getConstructorInterceptor() { + return ENHANCE_CLASS; + } + } + }; + } + + @Override + protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() { + return new InstanceMethodsInterceptPoint[]{ + new InstanceMethodsInterceptPoint() { + @Override + public ElementMatcher getMethodsMatcher() { + return named("execute"); + } + + @Override + public String getMethodsInterceptor() { + return ENHANCE_CLASS; + } + + @Override + public boolean isOverrideArgs() { + return false; + } + } + }; + } + + @Override + protected StaticMethodsInterceptPoint[] getStaticMethodsInterceptPoints() { + return new StaticMethodsInterceptPoint[0]; + } + + @Override + protected ClassMatch enhanceClass() { + return byName("org.elasticsearch.client.transport.TransportProxyClient"); + } +} diff --git a/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/resources/skywalking-plugin.def b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/resources/skywalking-plugin.def new file mode 100644 index 000000000000..7cb6d6c80b45 --- /dev/null +++ b/apm-sniffer/apm-sdk-plugin/elasticsearch-5.x-plugin/src/main/resources/skywalking-plugin.def @@ -0,0 +1,20 @@ +# 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. + +elasticsearch-5.x=org.apache.skywalking.apm.plugin.elasticsearch.v5.define.ActionRequestBuilderInstrumentation +elasticsearch-5.x=org.apache.skywalking.apm.plugin.elasticsearch.v5.define.TransportProxyClientInstrumentation +elasticsearch-5.x=org.apache.skywalking.apm.plugin.elasticsearch.v5.define.TransportActionNodeProxyInstrumentation +elasticsearch-5.x=org.apache.skywalking.apm.plugin.elasticsearch.v5.define.PlainListenableActionFutureInstrumentation diff --git a/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/pom.xml index 5a28b7c46aba..e24d0c59fbb9 100644 --- a/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/feign-default-http-9.x-plugin/pom.xml @@ -21,7 +21,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/pom.xml index c2ccbba2da94..e0d9d3734354 100644 --- a/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/grpc-1.x-plugin/pom.xml @@ -22,7 +22,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-grpc-1.x-plugin @@ -31,27 +31,15 @@ UTF-8 + 1.6.0 io.grpc grpc-all - 1.6.0 + ${grpc-all.version} provided - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.4.3 - - ${project.build.sourceEncoding} - - - - diff --git a/apm-sniffer/apm-sdk-plugin/h2-1.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/h2-1.x-plugin/pom.xml index 4ca2db1d22e1..6d1eca655a66 100755 --- a/apm-sniffer/apm-sdk-plugin/h2-1.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/h2-1.x-plugin/pom.xml @@ -20,7 +20,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -32,13 +32,14 @@ UTF-8 + 1.4.192 com.h2database h2 - 1.4.192 + ${h2.version} provided @@ -52,24 +53,8 @@ - org.apache.maven.plugins maven-deploy-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - diff --git a/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/pom.xml index 8ab3a636e8fb..6f38b2a844bc 100644 --- a/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/pom.xml @@ -22,7 +22,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-httpClient-4.x-plugin @@ -33,39 +33,31 @@ UTF-8 + 4.3 + 2.4.1 + 4.12 org.apache.httpcomponents httpclient - 4.3 + ${apache-httpclient.version} provided + org.apache.logging.log4j log4j-core - 2.4.1 + ${log4j-core.version} test junit junit - 4.12 + ${junit.version} test - - - - org.apache.maven.plugins - maven-resources-plugin - 2.4.3 - - ${project.build.sourceEncoding} - - - - diff --git a/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpClient/v4/HttpClientExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpClient/v4/HttpClientExecuteInterceptor.java index 5d2cf2908385..af077b9dc3e1 100644 --- a/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpClient/v4/HttpClientExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/httpClient-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpClient/v4/HttpClientExecuteInterceptor.java @@ -19,12 +19,21 @@ package org.apache.skywalking.apm.plugin.httpClient.v4; import java.lang.reflect.Method; +import java.net.MalformedURLException; import java.net.URL; -import org.apache.http.*; -import org.apache.skywalking.apm.agent.core.context.*; +import org.apache.http.HttpHost; +import org.apache.http.HttpRequest; +import org.apache.http.HttpResponse; +import org.apache.http.StatusLine; +import org.apache.skywalking.apm.agent.core.context.CarrierItem; +import org.apache.skywalking.apm.agent.core.context.ContextCarrier; +import org.apache.skywalking.apm.agent.core.context.ContextManager; import org.apache.skywalking.apm.agent.core.context.tag.Tags; -import org.apache.skywalking.apm.agent.core.context.trace.*; -import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.*; +import org.apache.skywalking.apm.agent.core.context.trace.AbstractSpan; +import org.apache.skywalking.apm.agent.core.context.trace.SpanLayer; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.apache.skywalking.apm.network.trace.component.ComponentsDefine; public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterceptor { @@ -43,7 +52,8 @@ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterc "https".equals(httpHost.getSchemeName().toLowerCase()) ? 443 : 80); String uri = httpRequest.getRequestLine().getUri(); - String operationName = uri.startsWith("http") ? new URL(uri).getPath() : uri; + String requestURI = getRequestURI(uri); + String operationName = uri.startsWith("http") ? requestURI : uri; AbstractSpan span = ContextManager.createExitSpan(operationName, contextCarrier, remotePeer); span.setComponent(ComponentsDefine.HTTPCLIENT); @@ -76,7 +86,7 @@ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterc } } } - + ContextManager.stopSpan(); return ret; } @@ -87,4 +97,9 @@ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterc activeSpan.errorOccurred(); activeSpan.log(t); } + + private String getRequestURI(String uri) throws MalformedURLException { + String requestPath = new URL(uri).getPath(); + return requestPath != null && requestPath.length() > 0 ? requestPath : "/"; + } } diff --git a/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/pom.xml index 45345ec70c96..b62c61c79a07 100644 --- a/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/httpasyncclient-4.x-plugin/pom.xml @@ -22,7 +22,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-httpasyncclient-4.x-plugin @@ -32,32 +32,15 @@ UTF-8 + 4.1.1 org.apache.httpcomponents httpasyncclient - 4.1.1 + ${apache-httpasyncclient.version} provided - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - - jar - - - - - - diff --git a/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/pom.xml index 87367bc0ea24..08d6b2cb5607 100644 --- a/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/hystrix-1.x-plugin/pom.xml @@ -21,17 +21,21 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-hystrix-1.x-plugin + + 1.4.0 + + com.netflix.hystrix hystrix-core - 1.4.0 + ${hystrix-core.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/jdbc-commons/pom.xml b/apm-sniffer/apm-sdk-plugin/jdbc-commons/pom.xml index bf1597d8762d..1ab6624a81f3 100755 --- a/apm-sniffer/apm-sdk-plugin/jdbc-commons/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/jdbc-commons/pom.xml @@ -20,7 +20,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -46,24 +46,8 @@ - org.apache.maven.plugins maven-deploy-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - diff --git a/apm-sniffer/apm-sdk-plugin/jedis-2.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/jedis-2.x-plugin/pom.xml index 108f22d4e991..bc3fcde26cbd 100644 --- a/apm-sniffer/apm-sdk-plugin/jedis-2.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/jedis-2.x-plugin/pom.xml @@ -22,7 +22,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-jedis-2.x-plugin @@ -30,33 +30,24 @@ jedis-2.x-plugin http://maven.apache.org + + 2.9.0 + 2.4.1 + redis.clients jedis - 2.9.0 + ${jedis.version} provided org.apache.logging.log4j log4j-core - 2.4.1 + ${log4j-core.version} test - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.4.3 - - ${project.build.sourceEncoding} - - - - diff --git a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.0-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.0-plugin/pom.xml index 84daf12ecdca..3b97e7b3b0e5 100644 --- a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.0-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.0-plugin/pom.xml @@ -20,7 +20,7 @@ jetty-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,11 +30,15 @@ jetty-client-9.0-plugin http://maven.apache.org + + 9.0.0.v20130308 + + org.eclipse.jetty jetty-client - 9.0.0.v20130308 + ${jetty-client.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.x-plugin/pom.xml index 8814ff185c0c..8dc67303138f 100644 --- a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-client-9.x-plugin/pom.xml @@ -20,7 +20,7 @@ jetty-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,11 +30,15 @@ jetty-client-9.x-plugin http://maven.apache.org + + 9.1.0.v20131115 + + org.eclipse.jetty jetty-client - 9.1.0.v20131115 + ${jetty-client.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/pom.xml index ba02b52b57e2..9b05ef64dfae 100644 --- a/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/jetty-plugin/jetty-server-9.x-plugin/pom.xml @@ -20,7 +20,7 @@ jetty-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,11 +30,15 @@ jetty-server-9.x-plugin http://maven.apache.org + + 9.0.0.v20130308 + + org.eclipse.jetty jetty-server - 9.0.0.v20130308 + ${jetty-server.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/jetty-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/jetty-plugin/pom.xml index e17a30bdd949..86ab46c85a8f 100644 --- a/apm-sniffer/apm-sdk-plugin/jetty-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/jetty-plugin/pom.xml @@ -23,7 +23,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT jetty-plugins diff --git a/apm-sniffer/apm-sdk-plugin/kafka-v1-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/kafka-v1-plugin/pom.xml index 0af713b90688..3e6f64012fa7 100644 --- a/apm-sniffer/apm-sdk-plugin/kafka-v1-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/kafka-v1-plugin/pom.xml @@ -21,17 +21,21 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-kafka-v1-plugin + + 0.11.0.0 + + org.apache.kafka kafka-clients - 0.11.0.0 + ${kafka-clients.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/pom.xml index 62969d81d588..eb567b64aad3 100644 --- a/apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/mongodb-2.x-plugin/pom.xml @@ -21,7 +21,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,39 +30,21 @@ UTF-8 + 2.14.2 org.mongodb mongo-java-driver - 2.14.2 + ${mongodb-java-driver.version} provided org.mongodb bson - 2.14.2 + ${mongodb-java-driver.version} provided - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - diff --git a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/pom.xml index b4b9b66f53c4..f9880104b72f 100644 --- a/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/pom.xml @@ -21,7 +21,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-mongodb-3.x-plugin @@ -32,34 +32,15 @@ UTF-8 + 3.4.2 org.mongodb mongo-java-driver - 3.4.2 + ${mongo-java-driver.version} provided - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - diff --git a/apm-sniffer/apm-sdk-plugin/motan-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/motan-plugin/pom.xml index cf6a5e3142b8..9b9eff52a678 100644 --- a/apm-sniffer/apm-sdk-plugin/motan-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/motan-plugin/pom.xml @@ -20,7 +20,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,31 +30,36 @@ motan-plugin http://maven.apache.org + + 0.2.1 + 4.2.4.RELEASE + + com.weibo motan-core - 0.2.1 + ${motan.version} provided com.weibo motan-transport-netty - 0.2.1 + ${motan.version} provided com.weibo motan-springsupport - 0.2.1 + ${motan.version} provided org.springframework spring-context - 4.2.4.RELEASE + ${spring-context.version} test diff --git a/apm-sniffer/apm-sdk-plugin/mysql-5.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/mysql-5.x-plugin/pom.xml index 04b40b998dcf..4fbe978f1a67 100755 --- a/apm-sniffer/apm-sdk-plugin/mysql-5.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/mysql-5.x-plugin/pom.xml @@ -20,7 +20,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -32,13 +32,14 @@ UTF-8 + 5.1.36 mysql mysql-connector-java - 5.1.36 + ${mysql-connector-java.version} test @@ -58,24 +59,8 @@ - org.apache.maven.plugins maven-deploy-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - diff --git a/apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/pom.xml index 58a60f200b82..43df4cae6562 100644 --- a/apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/nutz-plugins/http-1.x-plugin/pom.xml @@ -20,7 +20,7 @@ nutz-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,11 +30,15 @@ http-1.x-plugin http://maven.apache.org + + 1.r.62 + + org.nutz nutz - 1.r.62 + ${nutz.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/nutz-plugins/mvc-annotation-1.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/nutz-plugins/mvc-annotation-1.x-plugin/pom.xml index 6becd07d88c9..56957395f893 100644 --- a/apm-sniffer/apm-sdk-plugin/nutz-plugins/mvc-annotation-1.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/nutz-plugins/mvc-annotation-1.x-plugin/pom.xml @@ -20,7 +20,7 @@ nutz-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,17 +30,22 @@ mvc-annotation-1.x-plugin http://maven.apache.org + + 1.r.62 + 3.1.0 + + org.nutz nutz - 1.r.62 + ${nutz.version} provided javax.servlet javax.servlet-api - 3.1.0 + ${javax-servlet-api.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/nutz-plugins/pom.xml b/apm-sniffer/apm-sdk-plugin/nutz-plugins/pom.xml index c8436616aef1..301eb2e02b3b 100644 --- a/apm-sniffer/apm-sdk-plugin/nutz-plugins/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/nutz-plugins/pom.xml @@ -23,7 +23,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT nutz-plugins diff --git a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/pom.xml index 841a855fd2d9..a35e9f1b95d0 100644 --- a/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/okhttp-3.x-plugin/pom.xml @@ -21,7 +21,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/pom.xml index 6400261cd6c6..3ff2b20e47fd 100755 --- a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/pom.xml @@ -33,13 +33,14 @@ UTF-8 + 10.2.0.4.0 com.oracle ojdbc14 - 10.2.0.4.0 + ${ojdbc14.version} provided @@ -53,24 +54,8 @@ - org.apache.maven.plugins maven-deploy-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/PreparedStatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/PreparedStatementExecuteMethodsInterceptor.java index 065333931903..c85f2bc999cd 100644 --- a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/PreparedStatementExecuteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/PreparedStatementExecuteMethodsInterceptor.java @@ -39,14 +39,16 @@ public final void beforeMethod(EnhancedInstance objInst, Method method, Object[] Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField(); - ConnectionInfo connectInfo = cacheObject.getConnectionInfo(); + if (cacheObject != null && cacheObject.getConnectionInfo() != null) { + ConnectionInfo connectInfo = cacheObject.getConnectionInfo(); - AbstractSpan span = ContextManager.createExitSpan(buildOperationName(connectInfo, method.getName(), cacheObject.getStatementName()), connectInfo.getDatabasePeer()); - Tags.DB_TYPE.set(span, "sql"); - Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName()); - Tags.DB_STATEMENT.set(span, cacheObject.getSql()); - span.setComponent(connectInfo.getComponent()); - SpanLayer.asDB(span); + AbstractSpan span = ContextManager.createExitSpan(buildOperationName(connectInfo, method.getName(), cacheObject.getStatementName()), connectInfo.getDatabasePeer()); + Tags.DB_TYPE.set(span, "sql"); + Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName()); + Tags.DB_STATEMENT.set(span, cacheObject.getSql()); + span.setComponent(connectInfo.getComponent()); + SpanLayer.asDB(span); + } } @Override @@ -54,9 +56,11 @@ public final Object afterMethod(EnhancedInstance objInst, Method method, Object[ Class[] argumentsTypes, Object ret) throws Throwable { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField(); - if (cacheObject.getConnectionInfo() != null) { + + if (cacheObject != null && cacheObject.getConnectionInfo() != null) { ContextManager.stopSpan(); } + return ret; } diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/StatementExecuteMethodsInterceptor.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/StatementExecuteMethodsInterceptor.java index df6668e39c73..b39fa3e48ab2 100644 --- a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/StatementExecuteMethodsInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/StatementExecuteMethodsInterceptor.java @@ -34,21 +34,23 @@ public class StatementExecuteMethodsInterceptor implements InstanceMethodsAround public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, MethodInterceptResult result) throws Throwable { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField(); - ConnectionInfo connectInfo = cacheObject.getConnectionInfo(); + if (cacheObject != null && cacheObject.getConnectionInfo() != null) { + ConnectionInfo connectInfo = cacheObject.getConnectionInfo(); - AbstractSpan span = ContextManager.createExitSpan(buildOperationName(connectInfo, method.getName(), cacheObject.getStatementName()), connectInfo.getDatabasePeer()); - Tags.DB_TYPE.set(span, "sql"); - Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName()); + AbstractSpan span = ContextManager.createExitSpan(buildOperationName(connectInfo, method.getName(), cacheObject.getStatementName()), connectInfo.getDatabasePeer()); + Tags.DB_TYPE.set(span, "sql"); + Tags.DB_INSTANCE.set(span, connectInfo.getDatabaseName()); - String sql = ""; - if (allArguments.length > 0) { - sql = (String)allArguments[0]; - } + String sql = ""; + if (allArguments.length > 0) { + sql = (String)allArguments[0]; + } - Tags.DB_STATEMENT.set(span, sql); - span.setComponent(connectInfo.getComponent()); + Tags.DB_STATEMENT.set(span, sql); + span.setComponent(connectInfo.getComponent()); - SpanLayer.asDB(span); + SpanLayer.asDB(span); + } } @Override @@ -56,7 +58,7 @@ public final Object afterMethod(EnhancedInstance objInst, Method method, Object[ Class[] argumentsTypes, Object ret) throws Throwable { StatementEnhanceInfos cacheObject = (StatementEnhanceInfos)objInst.getSkyWalkingDynamicField(); - if (cacheObject.getConnectionInfo() != null) { + if (cacheObject != null && cacheObject.getConnectionInfo() != null) { ContextManager.stopSpan(); } return ret; diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/ConnectionInstrumentation.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/ConnectionInstrumentation.java index 9702c25b31a7..f51b02d73194 100644 --- a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/ConnectionInstrumentation.java +++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/ConnectionInstrumentation.java @@ -24,7 +24,7 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; -import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch; +import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch; import org.apache.skywalking.apm.plugin.jdbc.define.Constants; import static net.bytebuddy.matcher.ElementMatchers.named; @@ -33,13 +33,12 @@ /** * {@link ConnectionInstrumentation} define that the oracle plugin intercept the following methods that the class which * extend oracle.jdbc.driver.PhysicalConnection - * + * * 1. Enhance prepareStatement by org.apache.skywalking.apm.plugin.jdbc.oracle.CreatePreparedStatementInterceptor * 2. Enhance prepareCall by org.apache.skywalking.apm.plugin.jdbc.oracle.CreateCallableInterceptor * 3. Enhance createStatement by org.apache.skywalking.apm.plugin.jdbc.oracle.CreateStatementInterceptor * 4. Enhance commit, rollback, close, releaseSavepoint by org.apache.skywalking.apm.plugin.jdbc.define.ConnectionServiceMethodInterceptor * - * * @author zhangxin */ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { @@ -48,6 +47,7 @@ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePlugin public static final String PREPARED_STATEMENT_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jdbc.oracle.CreatePreparedStatementInterceptor"; public static final String CALLABLE_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jdbc.oracle.CreateCallableInterceptor"; public static final String CREATE_STATEMENT_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jdbc.oracle.CreateStatementInterceptor"; + public static final String T4C_CONNECTION_CLASS = "oracle.jdbc.driver.T4CConnection"; @Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { return new ConstructorInterceptPoint[0]; @@ -111,6 +111,6 @@ public class ConnectionInstrumentation extends ClassInstanceMethodsEnhancePlugin } @Override protected ClassMatch enhanceClass() { - return NameMatch.byName(ENHANCE_CLASS); + return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS, T4C_CONNECTION_CLASS); } } diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OracleCallableInstrumentation.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OracleCallableInstrumentation.java index d4f4a0c3f8fe..1c2e50ddb0cd 100644 --- a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OracleCallableInstrumentation.java +++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OracleCallableInstrumentation.java @@ -24,14 +24,16 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; +import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch; import static net.bytebuddy.matcher.ElementMatchers.named; -import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; import static org.apache.skywalking.apm.plugin.jdbc.oracle.Constants.PREPARED_STATEMENT_INTERCEPT_CLASS; public class OracleCallableInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { public static final String ENHANCE_CLASS = "oracle.jdbc.driver.OracleCallableStatement"; + public static final String CALLABLE_STATEMENT_WRAPPER_CLASS = "oracle.jdbc.driver.OracleCallableStatementWrapper"; + public static final String T4C_CALLABLE_STATMENT_CLASS = "oracle.jdbc.driver.T4CCallableStatement"; @Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { return new ConstructorInterceptPoint[0]; @@ -58,6 +60,6 @@ public class OracleCallableInstrumentation extends ClassInstanceMethodsEnhancePl } @Override protected ClassMatch enhanceClass() { - return byName(ENHANCE_CLASS); + return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS, CALLABLE_STATEMENT_WRAPPER_CLASS, T4C_CALLABLE_STATMENT_CLASS); } } diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OraclePrepareStatementInstrumentation.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OraclePrepareStatementInstrumentation.java index fe69675ee91b..5aceca289e25 100644 --- a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OraclePrepareStatementInstrumentation.java +++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OraclePrepareStatementInstrumentation.java @@ -24,14 +24,16 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; +import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch; import static net.bytebuddy.matcher.ElementMatchers.named; -import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; import static org.apache.skywalking.apm.plugin.jdbc.oracle.Constants.PREPARED_STATEMENT_INTERCEPT_CLASS; public class OraclePrepareStatementInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { public static final String ENHANCE_CLASS = "oracle.jdbc.driver.OraclePreparedStatement"; + public static final String PREPARED_STATEMENT_WRAPPER_CLASS = "oracle.jdbc.driver.OraclePreparedStatementWrapper"; + public static final String T4C_PREPARED_STATEMENT_CLASS = "oracle.jdbc.driver.T4CPreparedStatement"; @Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { return new ConstructorInterceptPoint[0]; @@ -59,6 +61,6 @@ public class OraclePrepareStatementInstrumentation extends ClassInstanceMethodsE } @Override protected ClassMatch enhanceClass() { - return byName(ENHANCE_CLASS); + return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS, PREPARED_STATEMENT_WRAPPER_CLASS, T4C_PREPARED_STATEMENT_CLASS); } } diff --git a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OracleStatementInstrumentation.java b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OracleStatementInstrumentation.java index e55f82f341af..20784ac8c364 100644 --- a/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OracleStatementInstrumentation.java +++ b/apm-sniffer/apm-sdk-plugin/oracle-10.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/oracle/define/OracleStatementInstrumentation.java @@ -24,14 +24,16 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint; import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine; import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch; +import org.apache.skywalking.apm.agent.core.plugin.match.MultiClassNameMatch; import static net.bytebuddy.matcher.ElementMatchers.named; -import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName; import static org.apache.skywalking.apm.plugin.jdbc.oracle.Constants.STATEMENT_INTERCEPT_CLASS; public class OracleStatementInstrumentation extends ClassInstanceMethodsEnhancePluginDefine { public static final String ENHANCE_CLASS = "oracle.jdbc.driver.OracleStatement"; + public static final String STATEMENT_WRAPPER_CLASS = "oracle.jdbc.driver.OracleStatementWrapper"; + public static final String T4C_STATEMENT_CLASS = "oracle.jdbc.driver.T4CStatement"; @Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() { return new ConstructorInterceptPoint[0]; @@ -62,6 +64,6 @@ public class OracleStatementInstrumentation extends ClassInstanceMethodsEnhanceP } @Override protected ClassMatch enhanceClass() { - return byName(ENHANCE_CLASS); + return MultiClassNameMatch.byMultiClassMatch(ENHANCE_CLASS, STATEMENT_WRAPPER_CLASS, T4C_STATEMENT_CLASS); } } diff --git a/apm-sniffer/apm-sdk-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/pom.xml index 06a7b61a6ffb..4b45c800d509 100644 --- a/apm-sniffer/apm-sdk-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/pom.xml @@ -23,7 +23,7 @@ org.apache.skywalking apm-sniffer - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-sdk-plugin @@ -57,6 +57,8 @@ servicecomb-plugin hystrix-1.x-plugin sofarpc-plugin + elasticsearch-5.x-plugin + activemq-5.x-plugin pom @@ -71,6 +73,9 @@ ${project.build.directory}${sdk.plugin.related.dir}/../../../../skywalking-agent ${agent.package.dest.dir}/plugins + + 1.0b3 + 1.8.1 @@ -97,9 +102,7 @@ - org.apache.maven.plugins maven-shade-plugin - 2.4.1 package @@ -122,30 +125,6 @@ - org.apache.maven.plugins - maven-resources-plugin - 2.4.3 - - ${project.build.sourceEncoding} - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - org.apache.maven.plugins maven-antrun-plugin @@ -172,7 +151,7 @@ ant-contrib ant-contrib - 1.0b3 + ${ant-contrib.version} ant @@ -183,7 +162,7 @@ org.apache.ant ant-nodeps - 1.8.1 + ${ant-nodeps.version} diff --git a/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/pom.xml index 5d7990e2a062..49415efa9955 100755 --- a/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/pom.xml @@ -20,7 +20,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -32,13 +32,14 @@ UTF-8 + 42.0.0 org.postgresql postgresql - 42.0.0 + ${postgresql.version} provided @@ -52,24 +53,8 @@ - org.apache.maven.plugins maven-deploy-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - diff --git a/apm-sniffer/apm-sdk-plugin/resin-3.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/resin-3.x-plugin/pom.xml index 89660de28eb8..1bfcd1447578 100644 --- a/apm-sniffer/apm-sdk-plugin/resin-3.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/resin-3.x-plugin/pom.xml @@ -36,40 +36,22 @@ UTF-8 + 3.0.9 + 3.0.1 com.caucho resin - 3.0.9 + ${resin.version} provided javax.servlet javax.servlet-api - 3.0.1 + ${javax-servlet-api.version} provided - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - diff --git a/apm-sniffer/apm-sdk-plugin/resin-4.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/resin-4.x-plugin/pom.xml index b52fb1767b8e..616deb213395 100644 --- a/apm-sniffer/apm-sdk-plugin/resin-4.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/resin-4.x-plugin/pom.xml @@ -36,41 +36,22 @@ UTF-8 + 4.0.41 + 3.0.1 com.caucho resin - 4.0.41 + ${resin.version} provided javax.servlet javax.servlet-api - 3.0.1 + ${javax-servlet-api.version} provided - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - - diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/pom.xml index da0585973a53..b6b6680b3b9b 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-3.x-plugin/pom.xml @@ -21,7 +21,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,13 +30,14 @@ UTF-8 + 3.6.2.Final com.alibaba.rocketmq rocketmq-client - 3.6.2.Final + ${rocketmq-client.version} provided @@ -44,23 +45,8 @@ - org.apache.maven.plugins maven-deploy-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - - jar - - - - diff --git a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/pom.xml index 3d5028332818..4ee6af7ff1d7 100644 --- a/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/rocketMQ-4.x-plugin/pom.xml @@ -21,7 +21,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,13 +30,14 @@ UTF-8 + 4.1.0-incubating org.apache.rocketmq rocketmq-client - 4.1.0-incubating + ${rocketmq-client.version} provided @@ -44,23 +45,8 @@ - org.apache.maven.plugins maven-deploy-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - - jar - - - - diff --git a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/pom.xml index 82d5339057cc..5b7b941e1315 100644 --- a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/pom.xml @@ -21,7 +21,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/pom.xml index 01cc9acbe4ba..6ef89e77400d 100644 --- a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-0.x-plugin/pom.xml @@ -21,7 +21,7 @@ servicecomb-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,32 +30,17 @@ servicecomb-java-chassis-0.x-plugin http://maven.apache.org + + + 0.5.0 + io.servicecomb java-chassis-core - 0.5.0 + ${java-chassis-core.version} provided - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - \ No newline at end of file diff --git a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/pom.xml index 39ab9419f16e..c44da655363c 100644 --- a/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-1.x-plugin/pom.xml @@ -21,7 +21,7 @@ servicecomb-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -31,32 +31,16 @@ servicecomb-java-chassis-1.x-plugin http://maven.apache.org + + 1.0.0-m1 + org.apache.servicecomb java-chassis-core - 1.0.0-m1 + ${java-chassis-core.version} provided - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - diff --git a/apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/pom.xml index caeca2b5f61d..21a01f93b0ed 100644 --- a/apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/sharding-jdbc-1.5.x-plugin/pom.xml @@ -21,7 +21,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -53,24 +53,8 @@ - org.apache.maven.plugins maven-deploy-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - diff --git a/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/pom.xml index cd1f97dbcfc1..e6d11b92cb12 100644 --- a/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/sofarpc-plugin/pom.xml @@ -20,7 +20,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -32,34 +32,15 @@ UTF-8 + 5.4.0 com.alipay.sofa sofa-rpc-all - 5.4.0 + ${sofa-rpc-all.version} provided - - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/pom.xml index afa3bf43cb9f..49151f104038 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/pom.xml @@ -20,7 +20,7 @@ spring-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,11 +30,15 @@ concurrent-util-4.x-plugin http://maven.apache.org + + 4.3.10.RELEASE + + org.springframework spring-core - 4.3.10.RELEASE + ${spring-core.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/FailureCallbackInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/FailureCallbackInterceptor.java index a6879b418caf..234224ba3f67 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/FailureCallbackInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/FailureCallbackInterceptor.java @@ -51,12 +51,20 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr @Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Object ret) throws Throwable { + Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField(); + if (cacheValues == null) { + return ret; + } ContextManager.stopSpan(); return ret; } @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { + Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField(); + if (cacheValues == null) { + return; + } ContextManager.activeSpan().errorOccurred().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/SuccessCallbackInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/SuccessCallbackInterceptor.java index e0ff6c27e488..dcacaab7aeae 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/SuccessCallbackInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/concurrent-util-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/concurrent/SuccessCallbackInterceptor.java @@ -51,12 +51,20 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr @Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Object ret) throws Throwable { + Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField(); + if (cacheValues == null) { + return ret; + } ContextManager.stopSpan(); return ret; } @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Throwable t) { + Object[] cacheValues = (Object[])objInst.getSkyWalkingDynamicField(); + if (cacheValues == null) { + return; + } ContextManager.activeSpan().errorOccurred().log(t); } } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/core-patch/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/core-patch/pom.xml index 0fb2f92dcc16..085527079db8 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/core-patch/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/core-patch/pom.xml @@ -21,18 +21,22 @@ spring-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-spring-core-patch core-patch + + 3.2.9.RELEASE + + org.springframework spring-aop - 3.2.9.RELEASE + ${spring-aop.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/core-patch/src/main/java/org/apache/skywalking/apm/plugin/spring/patch/AopExpressionMatchInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/core-patch/src/main/java/org/apache/skywalking/apm/plugin/spring/patch/AopExpressionMatchInterceptor.java index 9f46731d00db..5c99a886904e 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/core-patch/src/main/java/org/apache/skywalking/apm/plugin/spring/patch/AopExpressionMatchInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/core-patch/src/main/java/org/apache/skywalking/apm/plugin/spring/patch/AopExpressionMatchInterceptor.java @@ -15,17 +15,15 @@ * limitations under the License. */ - package org.apache.skywalking.apm.plugin.spring.patch; -import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; -import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; -import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.StaticMethodsAroundInterceptor; - import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; +import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.StaticMethodsAroundInterceptor; /** * {@link AopExpressionMatchInterceptor} check if the method is match the enhanced method @@ -42,30 +40,33 @@ public AopExpressionMatchInterceptor() { } @Override - public void beforeMethod(Class clazz, Method method, Object[] allArguments, Class[] parameterTypes, MethodInterceptResult result) { + public void beforeMethod(Class clazz, Method method, Object[] allArguments, Class[] parameterTypes, + MethodInterceptResult result) { } @Override - public Object afterMethod(Class clazz, Method method, Object[] allArguments, Class[] parameterTypes, Object ret) { - Method targetAopMethod = (Method) allArguments[1]; - Class targetAopClass = (Class) allArguments[2]; - if (EnhancedInstance.class.isAssignableFrom(targetAopClass) && isEnhancedMethod(targetAopMethod)) { + public Object afterMethod(Class clazz, Method method, Object[] allArguments, Class[] parameterTypes, + Object ret) { + Method targetAopMethod = (Method)allArguments[1]; + Class targetAopClass = (Class)allArguments[2]; + if (targetAopClass != null && EnhancedInstance.class.isAssignableFrom(targetAopClass) && isEnhancedMethod(targetAopMethod)) { return false; } return ret; } @Override - public void handleMethodException(Class clazz, Method method, Object[] allArguments, Class[] parameterTypes, Throwable t) { + public void handleMethodException(Class clazz, Method method, Object[] allArguments, Class[] parameterTypes, + Throwable t) { } private boolean isEnhancedMethod(Method targetMethod) { for (Method method : methods) { if (method.getName().equals(targetMethod.getName()) - && method.getReturnType().equals(targetMethod.getReturnType()) - && equalParamTypes(method.getParameterTypes(), targetMethod.getParameterTypes())) { + && method.getReturnType().equals(targetMethod.getReturnType()) + && equalParamTypes(method.getParameterTypes(), targetMethod.getParameterTypes())) { return true; } } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/pom.xml index 246f7cf2500e..7cf730642c98 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/pom.xml @@ -20,7 +20,7 @@ spring-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,23 +30,29 @@ mvc-annotation-3.x-plugin http://maven.apache.org + + 3.2.18.RELEASE + 3.2.18.RELEASE + 3.0.1 + + org.springframework spring-core - 3.2.18.RELEASE + ${spring-core.version} provided org.springframework spring-webmvc - 3.2.18.RELEASE + ${spring-webmvc.version} provided javax.servlet javax.servlet-api - 3.0.1 + ${javax-servlet-api.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/pom.xml index 117b1bfc30e2..0351726e50fe 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/pom.xml @@ -20,7 +20,7 @@ spring-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,23 +30,29 @@ mvc-annotation-4.x-plugin http://maven.apache.org + + 4.3.10.RELEASE + 4.3.8.RELEASE + 3.0.1 + + org.springframework spring-core - 4.3.10.RELEASE + ${spring-core.version} provided org.springframework spring-webmvc - 4.3.8.RELEASE + ${spring-webmvc.version} provided javax.servlet javax.servlet-api - 3.0.1 + ${javax-servlet-api.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/pom.xml index 222f67e83e1d..34739e2f4fa5 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/pom.xml @@ -20,7 +20,7 @@ spring-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,23 +30,29 @@ mvc-annotation-commons http://maven.apache.org + + 4.3.10.RELEASE + 4.3.8.RELEASE + 3.0.1 + + org.springframework spring-core - 4.3.10.RELEASE + ${spring-core.version} provided org.springframework spring-webmvc - 4.3.8.RELEASE + ${spring-webmvc.version} provided javax.servlet javax.servlet-api - 3.0.1 + ${javax-servlet-api.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/InvokeForRequestInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/InvokeForRequestInterceptor.java index b02d98f08404..b21a62868c8c 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/InvokeForRequestInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/InvokeForRequestInterceptor.java @@ -25,7 +25,6 @@ import org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult; import org.springframework.web.context.request.NativeWebRequest; -import static org.apache.skywalking.apm.plugin.spring.mvc.commons.Constants.REQUEST_KEY_IN_RUNTIME_CONTEXT; import static org.apache.skywalking.apm.plugin.spring.mvc.commons.Constants.RESPONSE_KEY_IN_RUNTIME_CONTEXT; /** @@ -44,9 +43,6 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr @Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Object ret) throws Throwable { - ContextManager.getRuntimeContext().remove(RESPONSE_KEY_IN_RUNTIME_CONTEXT); - // clear request in this method - ContextManager.getRuntimeContext().remove(REQUEST_KEY_IN_RUNTIME_CONTEXT); return ret; } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/InvokeHandlerMethodInterceptor.java b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/InvokeHandlerMethodInterceptor.java index 858ee75e3f4e..33fbec273f0c 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/InvokeHandlerMethodInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/InvokeHandlerMethodInterceptor.java @@ -40,8 +40,6 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr @Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class[] argumentsTypes, Object ret) throws Throwable { - ContextManager.getRuntimeContext().remove(RESPONSE_KEY_IN_RUNTIME_CONTEXT); - ContextManager.getRuntimeContext().remove(REQUEST_KEY_IN_RUNTIME_CONTEXT); return ret; } diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/pom.xml index 4bb1fb85a22d..f666526f5a99 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/pom.xml @@ -23,7 +23,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT spring-plugins diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/pom.xml index 6c642c025afb..f47e3649e7e7 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/resttemplate-4.x-plugin/pom.xml @@ -20,7 +20,7 @@ spring-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -30,11 +30,15 @@ resttemplate-4.3.x-plugin http://maven.apache.org + + 4.3.10.RELEASE + + org.springframework spring-web - 4.3.10.RELEASE + ${spring-web.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/pom.xml index c1962da20a1e..fadfacce8f71 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/pom.xml @@ -23,7 +23,7 @@ org.apache.skywalking spring-cloud - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT netflix-plugins diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/pom.xml index 49d114fe382e..944a03cfea8d 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/netflix-plugins/spring-cloud-feign-1.x-plugin/pom.xml @@ -23,7 +23,7 @@ org.apache.skywalking netflix-plugins - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-spring-cloud-feign-1.x-plugin @@ -33,11 +33,15 @@ spring-cloud-feign-1.x-plugin http://maven.apache.org + + 1.1.0.RELEASE + + org.springframework.cloud spring-cloud-starter-feign - 1.1.0.RELEASE + ${spring-cloud-starter-feign.version} provided diff --git a/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/pom.xml b/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/pom.xml index 929e0e9d5976..4551c4264343 100644 --- a/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spring-plugins/spring-cloud/pom.xml @@ -23,7 +23,7 @@ org.apache.skywalking spring-plugins - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT spring-cloud diff --git a/apm-sniffer/apm-sdk-plugin/spymemcached-2.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/spymemcached-2.x-plugin/pom.xml index a3951b46dba7..df1dbbc04330 100644 --- a/apm-sniffer/apm-sdk-plugin/spymemcached-2.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/spymemcached-2.x-plugin/pom.xml @@ -22,7 +22,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-spymemcached-2.x-plugin @@ -32,6 +32,7 @@ UTF-8 2.11.1 + 2.4.1 @@ -44,7 +45,7 @@ org.apache.logging.log4j log4j-core - 2.4.1 + ${log4j-core.version} test diff --git a/apm-sniffer/apm-sdk-plugin/struts2-2.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/struts2-2.x-plugin/pom.xml index 5703b96379a4..8a0328e2336b 100644 --- a/apm-sniffer/apm-sdk-plugin/struts2-2.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/struts2-2.x-plugin/pom.xml @@ -20,7 +20,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -32,45 +32,29 @@ UTF-8 + 2.3.1 + 3.1.0 + 2.0 org.apache.struts struts2-core - 2.3.1 + ${struts2-core.version} provided javax.servlet javax.servlet-api - 3.1.0 + ${javax-servlet-api.version} provided javax.servlet jsp-api - 2.0 + ${jsp-api.version} test - - - - - org.apache.maven.plugins - maven-source-plugin - - - - attach-sources - none - - jar - - - - - - diff --git a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml index 8ab292ed51d5..f6f653a55814 100644 --- a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/pom.xml @@ -20,7 +20,7 @@ apm-sdk-plugin org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -32,13 +32,15 @@ 8.0.36 + 4.12 + 4.5.2 junit junit - 4.12 + ${junit.version} test @@ -62,7 +64,7 @@ org.apache.httpcomponents httpclient - 4.5.2 + ${apache-httpclient.version} test diff --git a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/ForwardInterceptor.java b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/ForwardInterceptor.java index f7b255acecfb..68416c7ed673 100644 --- a/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/ForwardInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/tomcat78x/ForwardInterceptor.java @@ -37,7 +37,7 @@ public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allAr if (ContextManager.isActive()) { AbstractSpan abstractTracingSpan = ContextManager.activeSpan(); Map eventMap = new HashMap(); - eventMap.put("forward-url", (String)objInst.getSkyWalkingDynamicField()); + eventMap.put("forward-url", objInst.getSkyWalkingDynamicField() == null ? "" : String.valueOf(objInst.getSkyWalkingDynamicField())); abstractTracingSpan.log(System.currentTimeMillis(), eventMap); ContextManager.getRuntimeContext().put(Constants.FORWARD_REQUEST_FLAG, true); } diff --git a/apm-sniffer/apm-sdk-plugin/xmemcached-2.x-plugin/pom.xml b/apm-sniffer/apm-sdk-plugin/xmemcached-2.x-plugin/pom.xml index ecf0d632b53f..a04250131a16 100644 --- a/apm-sniffer/apm-sdk-plugin/xmemcached-2.x-plugin/pom.xml +++ b/apm-sniffer/apm-sdk-plugin/xmemcached-2.x-plugin/pom.xml @@ -21,7 +21,7 @@ org.apache.skywalking apm-sdk-plugin - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-xmemcached-2.x-plugin @@ -30,7 +30,9 @@ UTF-8 + 2.0.0 + 2.4.1 @@ -43,7 +45,7 @@ org.apache.logging.log4j log4j-core - 2.4.1 + ${log4j-core.version} test diff --git a/apm-sniffer/apm-test-tools/pom.xml b/apm-sniffer/apm-test-tools/pom.xml index 75d647fca816..9996438f4f88 100644 --- a/apm-sniffer/apm-test-tools/pom.xml +++ b/apm-sniffer/apm-test-tools/pom.xml @@ -22,7 +22,7 @@ org.apache.skywalking apm-sniffer - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT apm-test-tools diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-log4j-1.x-activation/pom.xml b/apm-sniffer/apm-toolkit-activation/apm-toolkit-log4j-1.x-activation/pom.xml index 1b4dd3a20a61..51d7ec70b9a1 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-log4j-1.x-activation/pom.xml +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-log4j-1.x-activation/pom.xml @@ -21,17 +21,21 @@ apm-toolkit-activation org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-toolkit-log4j-1.x-activation + + 1.2.17 + + log4j log4j - 1.2.17 + ${log4j.version} test diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-log4j-2.x-activation/pom.xml b/apm-sniffer/apm-toolkit-activation/apm-toolkit-log4j-2.x-activation/pom.xml index c279e6e6e10c..4882900c4de2 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-log4j-2.x-activation/pom.xml +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-log4j-2.x-activation/pom.xml @@ -21,7 +21,7 @@ apm-toolkit-activation org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-logback-1.x-activation/pom.xml b/apm-sniffer/apm-toolkit-activation/apm-toolkit-logback-1.x-activation/pom.xml index f285ea072865..8622c7c14290 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-logback-1.x-activation/pom.xml +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-logback-1.x-activation/pom.xml @@ -21,7 +21,7 @@ apm-toolkit-activation org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/pom.xml b/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/pom.xml index 5e68778b1c91..9f37eda7bc54 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/pom.xml +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-opentracing-activation/pom.xml @@ -21,7 +21,7 @@ apm-toolkit-activation org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/pom.xml b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/pom.xml index 4ff12c35a2d2..392f6b642c3c 100644 --- a/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/pom.xml +++ b/apm-sniffer/apm-toolkit-activation/apm-toolkit-trace-activation/pom.xml @@ -21,7 +21,7 @@ apm-toolkit-activation org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-sniffer/apm-toolkit-activation/pom.xml b/apm-sniffer/apm-toolkit-activation/pom.xml index 346463816358..1bec1361861a 100644 --- a/apm-sniffer/apm-toolkit-activation/pom.xml +++ b/apm-sniffer/apm-toolkit-activation/pom.xml @@ -21,7 +21,7 @@ apm-sniffer org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 pom @@ -39,6 +39,9 @@ UTF-8 net.bytebuddy ${shade.package}.${shade.net.bytebuddy.source} + + 1.0b3 + 1.8.1 @@ -65,9 +68,7 @@ - org.apache.maven.plugins maven-shade-plugin - 2.4.1 package @@ -103,7 +104,6 @@ - org.apache.maven.plugins maven-antrun-plugin @@ -130,7 +130,7 @@ ant-contrib ant-contrib - 1.0b3 + ${ant-contrib.version} ant @@ -141,7 +141,7 @@ org.apache.ant ant-nodeps - 1.8.1 + ${ant-nodeps.version} diff --git a/apm-sniffer/optional-plugins/optional-spring-plugins/pom.xml b/apm-sniffer/optional-plugins/optional-spring-plugins/pom.xml index 7f01cfacb5bc..1f68be7d5e87 100644 --- a/apm-sniffer/optional-plugins/optional-spring-plugins/pom.xml +++ b/apm-sniffer/optional-plugins/optional-spring-plugins/pom.xml @@ -21,7 +21,7 @@ optional-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 pom diff --git a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-annotation-plugin/pom.xml b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-annotation-plugin/pom.xml index 6506a4f2d8b3..d5456444fcd6 100644 --- a/apm-sniffer/optional-plugins/optional-spring-plugins/spring-annotation-plugin/pom.xml +++ b/apm-sniffer/optional-plugins/optional-spring-plugins/spring-annotation-plugin/pom.xml @@ -21,18 +21,22 @@ optional-spring-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 jar apm-spring-annotation-plugin + + 3.2.0.RELEASE + + org.springframework spring-context - 3.2.0.RELEASE + ${spring-context.version} provided diff --git a/apm-sniffer/optional-plugins/pom.xml b/apm-sniffer/optional-plugins/pom.xml index 977cd111f10d..933438746f03 100644 --- a/apm-sniffer/optional-plugins/pom.xml +++ b/apm-sniffer/optional-plugins/pom.xml @@ -21,7 +21,7 @@ apm-sniffer org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -35,6 +35,9 @@ ${project.build.directory}${sdk.plugin.related.dir}/../../../../skywalking-agent ${agent.package.dest.dir}/optional-plugins + + 1.0b3 + 1.8.1 @@ -66,9 +69,7 @@ - org.apache.maven.plugins maven-shade-plugin - 2.4.1 package @@ -91,7 +92,6 @@ - org.apache.maven.plugins maven-antrun-plugin @@ -117,7 +117,7 @@ ant-contrib ant-contrib - 1.0b3 + ${ant-contrib.version} ant @@ -128,7 +128,7 @@ org.apache.ant ant-nodeps - 1.8.1 + ${ant-nodeps.version} diff --git a/apm-sniffer/optional-plugins/trace-ignore-plugin/pom.xml b/apm-sniffer/optional-plugins/trace-ignore-plugin/pom.xml index feaffe9da69e..2b73202b61a1 100644 --- a/apm-sniffer/optional-plugins/trace-ignore-plugin/pom.xml +++ b/apm-sniffer/optional-plugins/trace-ignore-plugin/pom.xml @@ -20,7 +20,7 @@ optional-plugins org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 @@ -33,7 +33,6 @@ - org.apache.maven.plugins maven-antrun-plugin diff --git a/apm-sniffer/pom.xml b/apm-sniffer/pom.xml index 08c0a3ebbf8a..4a4eceb8d1a4 100644 --- a/apm-sniffer/pom.xml +++ b/apm-sniffer/pom.xml @@ -21,7 +21,7 @@ apm org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 diff --git a/apm-webapp/pom.xml b/apm-webapp/pom.xml index 3ec2a8d195c4..3af790568971 100644 --- a/apm-webapp/pom.xml +++ b/apm-webapp/pom.xml @@ -21,17 +21,23 @@ apm org.apache.skywalking - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT 4.0.0 apm-webapp jar + 1.8 UTF-8 1.5.11.RELEASE 2.6.2 + 2.8.2 + 4.5.3 + Edgware.SR1 + 1.6 + ${project.parent.basedir}/skywalking-ui @@ -40,7 +46,7 @@ org.springframework.cloud spring-cloud-dependencies - Edgware.SR1 + ${spring-cloud-dependencies.version} pom import @@ -71,12 +77,12 @@ com.google.code.gson gson - 2.8.2 + ${gson.version} org.apache.httpcomponents httpclient - 4.5.3 + ${apache-httpclient.version} org.springframework.cloud @@ -111,7 +117,7 @@ com.github.eirslett frontend-maven-plugin - 1.6 + ${frontend-maven-plugin.version} ${ui.path} v8.9.4 @@ -144,7 +150,6 @@ - org.apache.maven.plugins maven-resources-plugin ${project.build.sourceEncoding} diff --git a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/proxy/NIWSServerListTest.java b/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/proxy/NIWSServerListTest.java deleted file mode 100644 index 38748cec0426..000000000000 --- a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/proxy/NIWSServerListTest.java +++ /dev/null @@ -1,95 +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.skywalking.apm.webapp.proxy; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.core.env.AbstractEnvironment; -import org.springframework.core.env.Environment; -import org.springframework.core.env.MapPropertySource; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import com.netflix.loadbalancer.Server; -import com.netflix.loadbalancer.ServerList; -import com.netflix.loadbalancer.ZoneAwareLoadBalancer; -import org.springframework.cloud.netflix.ribbon.SpringClientFactory; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest -@DirtiesContext -public class NIWSServerListTest { - @Autowired - private Environment env; - - @Autowired - private SpringClientFactory factory; - - private Map serverListClassNames = new HashMap(); - - @Before - public void initServerListClassNames() { - for (Iterator iter = ((AbstractEnvironment) env).getPropertySources().iterator(); iter.hasNext();) { - Object propertySource = iter.next(); - if (propertySource instanceof MapPropertySource) { - Map mapPropertySource = ((MapPropertySource) propertySource).getSource(); - for (Map.Entry entry : mapPropertySource.entrySet()) { - String key = entry.getKey(); - int index; - if (key.endsWith(".NIWSServerListClassName") && - (index = key.indexOf(".ribbon")) > 0) { - String clientName = key.substring(0, index); - serverListClassNames.put(clientName,(String)entry.getValue()); - } - } - } - } - } - - @Test - public void serverListClass() throws ClassNotFoundException { - for (String serverListClassName : serverListClassNames.values()) { - Class clazz = Class.forName(serverListClassName); - } - } - - @Test - public void serverListFliter() { - for (Map.Entry entry : serverListClassNames.entrySet()) { - String clientName = entry.getKey(); - String serverListClassName = entry.getValue(); - ServerList serverList = getLoadBalancer(clientName).getServerListImpl(); - assertNotNull("Client: " + clientName + "'s ServerListImpl is null",serverList); - assertEquals("Clinet: " + clientName + "'s ServerListImpl not Same with setting in configs", - serverListClassName, serverList.getClass().getName()); - } - } - - @SuppressWarnings("unchecked") - private ZoneAwareLoadBalancer getLoadBalancer(String name) { - return (ZoneAwareLoadBalancer)this.factory.getLoadBalancer(name); - } -} diff --git a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/proxy/RewritePathFilterTest.java b/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/proxy/RewritePathFilterTest.java deleted file mode 100644 index 013d96d3f332..000000000000 --- a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/proxy/RewritePathFilterTest.java +++ /dev/null @@ -1,60 +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.skywalking.apm.webapp.proxy; - -import com.netflix.zuul.context.RequestContext; -import org.junit.Before; -import org.junit.Test; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.*; -import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_DECORATION_FILTER_ORDER; - -public class RewritePathFilterTest { - - private RewritePathFilter filter = new RewritePathFilter(); - - @Before - public void init() { - filter.setPath("/graphql"); - } - - @Test - public void filterOrder() { - assertThat(filter.filterOrder(), is(PRE_DECORATION_FILTER_ORDER + 2)); - } - - @Test - public void filterType() { - assertThat(filter.filterType(), is("pre")); - } - - @Test - public void shouldFilter() { - assertFalse(filter.shouldFilter()); - RequestContext.getCurrentContext().set("requestURI"); - assertTrue(filter.shouldFilter()); - } - - @Test - public void run() { - filter.run(); - assertThat(RequestContext.getCurrentContext().get("requestURI"), is("/graphql")); - } -} \ No newline at end of file diff --git a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginFilterTest.java b/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginFilterTest.java deleted file mode 100644 index cb20ba2efa54..000000000000 --- a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginFilterTest.java +++ /dev/null @@ -1,70 +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.skywalking.apm.webapp.security; - -import com.netflix.zuul.context.RequestContext; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import static org.hamcrest.core.Is.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_DECORATION_FILTER_ORDER; - - -public class LoginFilterTest { - - private LoginFilter loginFilter; - - @Before - public void setUp() { - UserChecker checker = new UserChecker(); - UserChecker.User user = new UserChecker.User(); - user.setPassword("admin"); - checker.getUser().put("admin", user); - loginFilter = new LoginFilter(checker); - } - - @After - public void tearDown() { - RequestContext.testSetCurrentContext(null); - } - - @Test - public void assertFilterType() { - assertThat(loginFilter.filterType(), is("pre")); - } - - @Test - public void assertFilterOrder() { - assertThat(loginFilter.filterOrder(), is(PRE_DECORATION_FILTER_ORDER + 1)); - } - - @Test - public void assertShouldFilter() { - RequestContext ctx = new RequestContext(); - ctx.set("requestURI", "/login/account"); - RequestContext.testSetCurrentContext(ctx); - assertTrue(loginFilter.shouldFilter()); - ctx.set("requestURI", "/dashboard"); - assertFalse(loginFilter.shouldFilter()); - } -} \ No newline at end of file diff --git a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginTest.java b/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginTest.java deleted file mode 100644 index e077d5149940..000000000000 --- a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginTest.java +++ /dev/null @@ -1,90 +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.skywalking.apm.webapp.security; - -import com.netflix.zuul.context.RequestContext; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.StringReader; -import java.lang.reflect.UndeclaredThrowableException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.runners.MockitoJUnitRunner; - -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class LoginTest { - - private LoginFilter loginFilter; - - @Mock - private RequestContext ctx; - - @Mock - private HttpServletRequest request; - - @Mock - private HttpServletResponse response; - - @Before - public void setUp() { - UserChecker checker = new UserChecker(); - UserChecker.User user = new UserChecker.User(); - user.setPassword("admin"); - checker.getUser().put("admin", user); - loginFilter = new LoginFilter(checker); - when(ctx.getRequest()).thenReturn(request); - when(ctx.getResponse()).thenReturn(response); - RequestContext.testSetCurrentContext(ctx); - } - - @Test - public void assertSuccessLogin() throws IOException { - when(request.getReader()).thenReturn(new BufferedReader(new StringReader("{\"userName\": \"admin\", \"password\":\"admin\"}"))); - loginFilter.run(); - assertHeaderAndStatusCode(); - verify(ctx).setResponseBody("{\"status\":\"ok\",\"currentAuthority\":\"admin\"}"); - } - - @Test - public void assertFailLogin() throws IOException { - when(request.getReader()).thenReturn(new BufferedReader(new StringReader("{\"userName\": \"admin\", \"password\":\"888888\"}"))); - loginFilter.run(); - assertHeaderAndStatusCode(); - verify(ctx).setResponseBody("{\"status\":\"error\",\"currentAuthority\":\"guest\"}"); - } - - @Test(expected = UndeclaredThrowableException.class) - public void assertException() throws IOException { - when(request.getReader()).thenThrow(new IOException()); - loginFilter.run(); - } - - private void assertHeaderAndStatusCode() { - verify(ctx).setResponseStatusCode(HttpServletResponse.SC_OK); - verify(response).setContentType("application/json"); - verify(response).setCharacterEncoding("UTF-8"); - } -} diff --git a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/UserCheckerTest.java b/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/UserCheckerTest.java deleted file mode 100644 index 81c266b413f8..000000000000 --- a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/UserCheckerTest.java +++ /dev/null @@ -1,96 +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.skywalking.apm.webapp.security; - -import org.junit.Test; - -import static org.junit.Assert.*; - -public class UserCheckerTest { - - @Test - public void assertCheckSuccess() { - UserChecker checker = new UserChecker(); - UserChecker.User user = new UserChecker.User(); - user.setPassword("888888"); - checker.getUser().put("admin", user); - assertTrue(checker.check(new Account() { - @Override public String userName() { - return "admin"; - } - - @Override public String password() { - return "888888"; - } - })); - } - - @Test - public void assertCheckFail() { - UserChecker checker = new UserChecker(); - UserChecker.User user = new UserChecker.User(); - user.setPassword("123456"); - checker.getUser().put("guest", user); - assertFalse(checker.check(new Account() { - @Override public String userName() { - return "admin"; - } - - @Override public String password() { - return "888888"; - } - })); - assertFalse(checker.check(new Account() { - @Override public String userName() { - return "guest"; - } - - @Override public String password() { - return "888888"; - } - })); - assertFalse(checker.check(new Account() { - @Override public String userName() { - return "admin"; - } - - @Override public String password() { - return "123456"; - } - })); - assertFalse(checker.check(new Account() { - @Override public String userName() { - return ""; - } - - @Override public String password() { - return "123456"; - } - })); - assertFalse(checker.check(new Account() { - @Override public String userName() { - return "admin"; - } - - @Override public String password() { - return ""; - } - })); - } -} \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 0d3481c3a6f4..d6c68b956a64 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,6 +13,7 @@ * [[**Incubating**] Filter traces through custom services](../apm-sniffer/optional-plugins/trace-ignore-plugin/README.md) * [Architecture Design](en/Architecture.md) * Advanced Features + * [Locate agent config file by system property](en/Specified-agent-config.md) * [Override settings through System.properties](en/Setting-override.md) * [Direct uplink and disable naming discovery](en/Direct-uplink.md) * [Open TLS](en/TLS.md) diff --git a/docs/README_ZH.md b/docs/README_ZH.md index a698e6e750b4..d1bd9e645947 100644 --- a/docs/README_ZH.md +++ b/docs/README_ZH.md @@ -13,7 +13,9 @@ * [Spring beans 插件](cn/agent-optional-plugins-CN/Spring-bean-plugins-CN.md) * [Oracle and Resin 插件](cn/agent-optional-plugins-CN/Oracle-Resin-plugins-CN.md) * [[**孵化特性**] 自定义配置忽略追踪信息](../apm-sniffer/optional-plugins/trace-ignore-plugin/README_CN.md) + * [架构设计](cn/Architecture-CN.md) * 高级特性 + * [自定义探针配置文件路径](cn/Specified-agent-config-CN.md) * [通过系统启动参数进行覆盖配置](cn/Setting-override-CN.md) * [服务直连(Direct uplink)及禁用名称服务(naming service)](cn/Direct-uplink-CN.md) * [开启TLS](cn/TLS-CN.md) @@ -21,8 +23,9 @@ * [基于Token认证](cn/Token-auth-CN.md) * [添加自定义组件库](cn/Component-libraries-extend-CN.md) * 孵化特性 - * [个性化服务过滤](../apm-sniffer/optional-plugins/trace-ignore-plugin/README_CN.md) + * [孵化特性的由来?](cn/Incubating/Abstract-CN.md) * [使用Shardingjdbc作为存储实现](cn/Use-ShardingJDBC-as-storage-implementor-CN.md) + * [接受Zipkin格式的span数据](../apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README-CN.md) * APM相关介绍资料 * [OpenTracing中文版](https://github.com/opentracing-contrib/opentracing-specification-zh) * Application Toolkit,应用程序工具包 diff --git a/docs/Supported-list.md b/docs/Supported-list.md index 5cd527a8fcf0..243d698875b1 100644 --- a/docs/Supported-list.md +++ b/docs/Supported-list.md @@ -33,6 +33,7 @@ * MQ * [RocketMQ](https://github.com/apache/rocketmq) 4.x * [Kafka](http://kafka.apache.org) 0.11.0.0 -> 1.0 + * [ActiveMQ](https://github.com/apache/activemq) 5.x * NoSQL * Redis * [Jedis](https://github.com/xetorthio/jedis) 2.x @@ -40,6 +41,8 @@ * Memcached Client * [Spymemcached](https://github.com/couchbase/spymemcached) 2.x * [Xmemcached](https://github.com/killme2008/xmemcached) 2.x + * [Elasticsearch](https://github.com/elastic/elasticsearch) + * [transport-client](https://github.com/elastic/elasticsearch/tree/master/client/transport) 5.2.x-5.6.x * Service Discovery * [Netflix Eureka](https://github.com/Netflix/eureka) * Spring Ecosystem diff --git a/docs/cn/Architecture-CN.md b/docs/cn/Architecture-CN.md new file mode 100644 index 000000000000..525c6e729fa6 --- /dev/null +++ b/docs/cn/Architecture-CN.md @@ -0,0 +1,104 @@ +# 架构设计 +## 背景 +对于APM来说,自动探针和手动探针,只是关于如何实现监控的技术细节。这些和架构设计无关。因此在本文档中,我们将它们仅视为客户端库。 + + + +## 基本原则 +SkyWalking架构的基本设计原则包括**易于维护、可控和流式处理**。 + +为了实现这些目标,SkyWalking后端采用以下设计。 +1. 模块化设计。 +2. 多种客户端连接方式。 +3. 后端集群服务发现机制。 +4. 流模式。 +5. 可切换的存储模块。 + +## 模块化 +SkyWalking后端基于纯**模块化设计**。用户可以根据自己的需求切换或组装后端功能。 + +### 模块 + +模块定义了一组特性,这些特性可以包括技术库(如:gRPC/Jetty服务器管理)、跟踪分析(如:跟踪段或zipkin span解析器)或聚合特性。 +这些完全由模块定义及其模块实现来决定。 + +每个模块都可以在Java接口中定义它们的服务,每个模块的提供者都必须为这些服务提供实现者。 +提供者应该基于自己的实现定义依赖模块。这意味着,即使两个不同的模块实现者,也可以依赖不同的模块。 + +此外,后端模块化core还检查启动序列,如果没有发现周期依赖或依赖,后端应该被core终止。 + +后端启动所有模块,这些模块的配置在`application.yml`中是分离的。在这个yaml文件中: +- 根级别是模块名称,例如`cluster`、`naming`等。 +- 第二级别是模块的实现者的名称,例如`zookeeper`是`cluster`等模块。 +- 第三级是实现者的具体属性。例如`hostPort`和`sessionTimeout`是`zookepper`的必需属性。 + +_yaml文件的一部分举例_ +```yml +cluster: + zookeeper: + hostPort: localhost:2181 + sessionTimeout: 100000 +naming: + jetty: + #OS real network IP(binding required), for agent to find collector cluster + host: localhost + port: 10800 + contextPath: / +``` + +## 多种连接方式 +首先,后端提供两种类型的连接,也即提供两种协议(HTTP和gRPC): +1. HTTP中的命名服务,它返回后端群集中的所有可用collector地址。 +2. 在gRPC(SkyWalking原生探针的主要部分)和HTTP中使用上行链路服务,它将跟踪和度量数据上传到后端。 +每个客户端将只向单个collector发送监视数据(跟踪和度量)。如果与连接的后端在某个时刻断开连接将会尝试连接其它的后端。 + +比如在SkyWalking Java探针中 +1. `collector.servers`表示命名服务,将`naming/jetty/ip:port`映射为HTTP请求地址。 +2. `collector.direct_servers` 表示直接设置上行服务,并使用gRPC发送监控数据。 + + +_客户端库和后端集群之间的流程图_ +``` + Client lib Collector1 Collector2 Collector3 + (Set collector.servers=Collector2) (Collector 1,2,3 constitute the cluster) + | + +-----------> naming service ---------------------------->| + | + |<------- receive gRPC IP:Port(s) of Collector 1,2,3---<--| + | + |Select a random gRPC service + |For example collector 3 + | + |------------------------->Uplink gRPC service----------------------------------->| +``` + + +## Collector 集群发现 +当Collector以群集模式运行时,后端必须以某种方式相互发现。默认情况下,SkyWalking使用Zookeeper进行协调,并作为实例发现的注册中心。 + +通过以上部分([多个连接方式](#多种连接方式)),客户端库将不会使用Zookeeper来查找集群。我们建议客户不要这么做。因为集群发现机制是可切换的,由模块化核心提供。依赖它会破坏可切换能力。 +我们希望社区提供更多的实现者来进行集群发现,例如Eureka,Consul,Kubernate等。 + + +## 流模式 +流模式类似轻量级storm/spark的实现,它允许使用API​​构建流处理图(DAG)以及每个节点的输入/输出数据协定。 + +新模块可以查找和扩展现有的流程图。 + +处理中有三种情况 +1. 同步过程,传统方法调用。 +2. 异步过程,又叫做基于队列缓冲区的批处理。 +3. 远程过程,汇总后端的汇总。以这种方式,在节点中定义选择器以决定如何在集群中找到collector。(HashCode,Rolling,ForeverFirst是支持的三种方式) + +通过具备的这些功能,collector集群像流式网络一样运行着去聚合、度量标准监控信息,并且不依赖于存储模块的实现来支持并发地编写相同的度量id。 + +## 可切换存储实现器 +由于流模式负责并发,因此存储模块的实现的职责是提供高速写入和组合查询。 + +目前,我们支持ElasticSearch作为主要实现模块,H2用于预览版本,以及由Sharding Shpere项目管理的MySQL关系数据库集群。 + +# Web 界面 +除了后端设计的原则,UI是SkyWalking的另一个核心组件。它基于React,Antd和Zuul代理实现,提供后端集群发现、查询调度和可视化的功能。 + +Web UI以[多连接方式](#多种连接方式)中的相似的流程机制作为客户端的`1.naming`、`2.uplink`。唯一的区别是,在`ui/jetty/yaml`定义下的主机和端口上(默认值:localhost:12800)用HTTP绑定中的GraphQL查询协议替换上行。 + diff --git a/docs/cn/How-to-build-CN.md b/docs/cn/How-to-build-CN.md index f90e77505a66..48f84cdda89b 100644 --- a/docs/cn/How-to-build-CN.md +++ b/docs/cn/How-to-build-CN.md @@ -13,25 +13,25 @@ 1. 切换到tag `git checkout [tagname]` (可选,当需要编译发行版本时,请是切换到指定分支) 1. `git submodule init` 1. `git submodule update` -1. 执行`mvn clean package -DskipTests` +1. 执行`./mvnw clean package -DskipTests` 1. 生成包在`/dist`目录下(.tar.gz是linux环境,.zip是windows环境) ### 从Apache源码镜像下载编译 1. 准备环境: jdk8,Maven -1. 执行`mvn clean package -DskipTests` +1. 执行`./mvnw clean package -DskipTests` 1. 生成包在`/dist`目录下(.tar.gz是linux环境,.zip是windows环境) ## 在IntelliJ IDEA中编译工程 上述步骤在命令行中,能够很好的编译工程,但导入到编译器中的工程依然会有一些报错,我们需要进行几步简单的操作。 -1. 在IntelliJ Terminal中,执行`mvn compile -Dmaven.test.skip=true`进行编译 +1. 在IntelliJ Terminal中,执行`./mvnw compile -Dmaven.test.skip=true`进行编译 1. 设置gRPC的自动生成代码目录,为源码目录 - **apm-protocol/apm-network/target/generated-sources/protobuf**目录下的`grpc-java`和`java`目录 - **apm-collector/apm-collector-remote/apm-remote-grpc-provider/target/generated-sources/protobuf**目录下的`grpc-java`和`java`目录 ## 在IntelliJ IDEA中编译工程 上述步骤在命令行中,能够很好的编译工程,但导入到编译器中的工程依然会有一些报错,我们需要进行几步简单的操作。 -1. 在IntelliJ Terminal中,执行`mvn compile -Dmaven.test.skip=true`进行编译 +1. 在IntelliJ Terminal中,执行`./mvnw compile -Dmaven.test.skip=true`进行编译 1. 设置gRPC的自动生成代码目录,为源码目录 - **apm-protocol/apm-network/target/generated-sources/protobuf**目录下的`grpc-java`和`java`目录 - **apm-collector/apm-collector-remote/apm-remote-grpc-provider/target/generated-sources/protobuf**目录下的`grpc-java`和`java`目录 @@ -100,13 +100,13 @@ 24.0-jre ``` -4. 执行`mvn compile -Dmaven.test.skip=true`进行编译 +4. 执行`./mvnw compile -Dmaven.test.skip=true`进行编译 5. 执行maven update,切记去掉勾选 Clean projects选项(会清掉complie生成的proto转化Java文件) -6. mvn compile 编译collector-remote-grpc-provider和apm-protocol工程并Refresh +6. ./mvnw compile 编译collector-remote-grpc-provider和apm-protocol工程并Refresh ## 编译Resin-3, Resin-4 和 Oracle JDBC 驱动插件 为了遵守Apache关于协议(License)的相关要求,不符合Apache相关要求的类库所对应的Plugin不会自动编译。如需编译对应的插件, -需要手动下载驱动或类库,并将文件拷贝到`ci-dependencies/`中,运行`mvn package`进行编译。 +需要手动下载驱动或类库,并将文件拷贝到`ci-dependencies/`中,运行`./mvnw package`进行编译。 `ci-dependencies/`下对应的类库文件名为: * resin-3.0.9.jar diff --git a/docs/cn/Incubating/Abstract-CN.md b/docs/cn/Incubating/Abstract-CN.md new file mode 100644 index 000000000000..04ce589a20e2 --- /dev/null +++ b/docs/cn/Incubating/Abstract-CN.md @@ -0,0 +1,11 @@ +# 孵化特性 +孵化的功能特性是由SkyWalking社区人员开发和贡献代码. +目前代码还是原型,或者预览版本,并已经提交到主干代码,并进行发布。同时,功能开发者希望社区更多的开发者参与,对功能进行完善。 + +PMC和Committor团队会评估提交的特性,确保它是否具有移植性,是否兼容当前版本. + +下面是已知的,可能存在的孵化功能: +1. collector提供了新的存储实现,例如:支持 ElasticSearch REST API(HTTP协议),MYSQL...... +1. collector添加新的模块. +1. agent添加新的监控插件. +1. collector集成了一些新的功能和服务. diff --git a/docs/cn/Specified-agent-config-CN.md b/docs/cn/Specified-agent-config-CN.md new file mode 100644 index 000000000000..67db7fa157d6 --- /dev/null +++ b/docs/cn/Specified-agent-config-CN.md @@ -0,0 +1,26 @@ +# 自定义探针配置文件路径 + +## 版本支持 + +5.0.0-RC+ + +## 什么是自定义探针配置文件路径? +默认情况下, SkyWalking 探针读取与 `SkyWalking-agent.jar` 同目录级别下的 `config` 目录下的 `agent.config` 配置文件。 +用户可以自定义探针配置文件的路径,让探针监控的每个服务都是用其特有文件目录的探针配置,用来统一管理一台物理机器上面的多个不同运行服务的探针配置。此自定义探针配置文件与[通过系统启动参数进行覆盖配置](Setting-override-CN.md)无任何冲突。 + +## 配置优先级 +自定义探针配置文件 > 默认的配置文件 + +## 自定义探针配置路径 + 自定义的探针配置文件内容格式必须与默认探针配置文件内容格式一致,这里所改变的仅仅只是配置文件的路径 + +**使用方式:使用 `启动参数(-D)` 的方式来设置探针配置文件路径** + + ``` + -Dskywalking_config=/path/to/agent.config + ``` + 其中的`/path/to/agent.config` 代表的是自定义探针配置文件的绝对路径 + + + + diff --git a/docs/en/How-to-build.md b/docs/en/How-to-build.md index 06f187ac13be..006ce4331fd3 100644 --- a/docs/en/How-to-build.md +++ b/docs/en/How-to-build.md @@ -11,17 +11,17 @@ This document helps people to compile and build the project in your maven and se 1. Switch to the tag by using `git checkout [tagname]` (Optional, switch if want to build a release from source codes) 1. `git submodule init` 1. `git submodule update` -1. Run `mvn clean package -DskipTests` +1. Run `./mvnw clean package -DskipTests` 1. All packages are in `/dist`.(.tar.gz for Linux and .zip for Windows). ### Build from Apache source codes 1. Prepare JDK8 and maven3 -1. Run `mvn clean package -DskipTests` +1. Run `./mvnw clean package -DskipTests` 1. All packages are in `/dist`.(.tar.gz for Linux and .zip for Windows). ## Setup your IntelliJ IDEA 1. Import the project as a maven project -1. Run `mvn compile -Dmaven.test.skip=true` to compile project and generate source codes. Because we use gRPC and protobuf. +1. Run `./mvnw compile -Dmaven.test.skip=true` to compile project and generate source codes. Because we use gRPC and protobuf. 1. Set **Generated Source Codes** folders. * `grpc-java` and `java` folders in **apm-protocol/apm-network/target/generated-sources/protobuf** * `grpc-java` and `java` folders in **apm-collector/apm-collector-remote/apm-remote-grpc-provider/target/generated-sources/protobuf** @@ -90,9 +90,9 @@ This document helps people to compile and build the project in your maven and se 24.0-jre ``` -5. Run `mvn compile -Dmaven.test.skip=true` +5. Run `./mvnw compile -Dmaven.test.skip=true` 6. Run `maven update`. Must remove the clean projects item before maven update(This will be clear the proto conversion Java file generated by the complie) -7. Run `mvn compile` complie collector-remote-grpc-provider and apm-protocol +7. Run `./mvnw compile` complie collector-remote-grpc-provider and apm-protocol 8. Refresh project ## Building Resin-3, Resin-4, and OJDBC sdk plugins diff --git a/docs/en/How-to-release.md b/docs/en/How-to-release.md index 8ca7f5dbdfbc..5663d9c3d3a7 100644 --- a/docs/en/How-to-release.md +++ b/docs/en/How-to-release.md @@ -30,18 +30,18 @@ Use the following block as a template and place it in ~/.m2/settings.xml ## Test your settings ``` -mvn clean install -Papache-release (this will build artifacts, sources and sign) +./mvnw clean install -Papache-release (this will build artifacts, sources and sign) ``` ## Prepare the release ``` -mvn release:clean -mvn release:prepare -DautoVersionSubmodules=true +./mvnw release:clean +./mvnw release:prepare -DautoVersionSubmodules=true ``` ## Stage the release ``` -mvn release:perform -DskipTests -Ptravis-ci-submodule +./mvnw release:perform -DskipTests -Ptravis-ci-submodule ``` 1. Set version number as x.y.z, and tag as x.y.z-RCx. `x` in `RCx` is based the number of attempts release, aka `RELEASE_ROUND` in this doc, and starts with 1. 1. The release will automatically be inserted into a temporary staging repository for you. @@ -198,7 +198,7 @@ are in `https://dist.apache.org/repos/dist/dev/incubator/skywalking/x.y.z` with 1. `LICENSE` and `NOTICE` are in Source code and distribution package. 1. Check `shasum -c apache-skywalking-apm-incubating-x.y.z-src.tgz.sha512` 1. Build distribution from source code package (apache-skywalking-incubating-x.y.z-src.tar.gz) by following this [doc](https://github.com/apache/incubator-skywalking/blob/master/docs/en/How-to-build.md#build-from-apache-source-codes). -1. Apache RAT check. Run `mvn apache-rat:check`. (No binary in source codes) +1. Apache RAT check. Run `./mvnw apache-rat:check`. (No binary in source codes) 1. DISCLAIMER exists ## Call for a vote in Apache IPMC diff --git a/docs/en/Specified-agent-config.md b/docs/en/Specified-agent-config.md new file mode 100644 index 000000000000..bd0b70641a02 --- /dev/null +++ b/docs/en/Specified-agent-config.md @@ -0,0 +1,29 @@ +# Locate agent config file by system property + +## Supported version + +5.0.0-RC+ + +## What is Locate agent config file by system property ? +In Default. The agent will try to locate `agent.config`, which should be in the `/config` dictionary of agent package. +If User sets the specified agent config file through system properties, The agent will try to load file from there. +By the way, This function has no conflict with [Setting Override](Setting-override.md) + +## Override priority +The specified agent config > The default agent config + +## How to use + +The content formats of the specified config must be same as the default config. + + +**Using `System.Properties(-D)` to set the specified config path** + + ``` + -Dskywalking_config=/path/to/agent.config + ``` + `/path/to/agent.config` is the absolute path of the specified config file + + + + diff --git a/docs/users.md b/docs/users.md new file mode 100644 index 000000000000..c3224735142a --- /dev/null +++ b/docs/users.md @@ -0,0 +1,41 @@ +# Uses + +All uses are reported through direct message/mail or [online issue](https://github.com/apache/incubator-skywalking/issues/443), +if any entity(company or organization) has any doubt, please contact us by [any official channel](../README.md#contact-us). + +- 300.cn 中企动力科技股份有限公司 http://www.300.cn/ +- 4499.com 四三九九网络股份有限公司. http://www.4399.com/ +- AsiaInfo Inc. http://www.asiainfo.com.cn/ +- Autohome. 汽车之家. http://www.autohome.com.cn +- Baixing.com 百姓网 http://www.baixing.com/ +- Bizsaas.cn 北京商云科技发展有限公司. http://www.bizsaas.cn/ +- Chehejia Automotive. 北京车和家信息技术有限责任公司. https://www.chehejia.com/ +- Chinadaas. 北京中数智汇科技股份有限公司. https://www.chinadaas.com/ +- Dangdang.com. 当当网. http://www.dangdang.com/ +- DaoCloud. https://www.daocloud.io/ +- Deyoushenghuo in WeChat app. 河南有态度信息科技有限公司,微信小程序:得有生活 +- Eqxiu.com. 北京中网易企秀科技有限公司 http://www.eqxiu.com/ +- Haier. 海尔消费金融 https://www.haiercash.com/ +- Haoyunhu. 上海好运虎供应链管理有限公司 http://www.haoyunhu56.com/ +- Hundun YUNRONG Fintech. 杭州恒生云融网络科技有限公司 https://www.hsjry.com/ +- iFLYTEK. 科大讯飞股份有限公司-消费者BG http://www.iflytek.com/ +- Keking.cn 凯京集团. http://www.keking.cn +- GTrace System. (No company provided) +- Gdeng.cn 深圳谷登科技有限公司 http://www.gdeng.cn/ +- Huawei Inc. DevCloud. https://www.huaweicloud.com/devcloud/ +- laocaibao. 上海证大爱特金融信息服务有限公司 https://www.laocaibao.com/ +- Madecare. 北京美德远健科技有限公司. http://www.madecare.com/ +- Mxnavi. 沈阳美行科技有限公司 http://www.mxnavi.com/ +- Moji 墨叽(深圳)科技有限公司 https://www.mojivip.com +- Qsdjf.com 浙江钱宝网络科技有限公司 https://www.qsdjf.com/index.html +- Rongjinbao. 深圳融金宝互联网金融服务有限公司. http://www.rjb777.com +- Successchannel 苏州渠成易销网络科技有限公司. http://www.successchannel.com +- Shouqi Limousine & chauffeur Group 首约科技(北京)有限公司. https://www.01zhuanche.com/ +- Today36524.com Today便利店 +- Tsfinance.com 重庆宜迅联供应链科技有限公司 https://www.tsfinance.com.cn/ +- VBill Payment Co., LTD. 随行付. https://www.vbill.cn/ +- Weier. 广州文尔软件科技有限公司. https://www.site0.cn +- Xiaomi. 小米. https://www.mi.com/en/ +- Yinji(shenzhen)Network Technology Co.,Ltd. 印记. http://www.yinjiyun.cn/ + +The list is in alphabeta order. diff --git a/mvnw b/mvnw new file mode 100755 index 000000000000..5551fde8e7db --- /dev/null +++ b/mvnw @@ -0,0 +1,286 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# 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. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + wget "$jarUrl" -O "$wrapperJarPath" + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + curl -o "$wrapperJarPath" "$jarUrl" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100755 index 000000000000..48363fa60b93 --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,161 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" +FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + echo Found %WRAPPER_JAR% +) else ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" + echo Finished downloading %WRAPPER_JAR% +) +@REM End of extension + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml index f25824190562..e63eb3513642 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ org.apache.skywalking apm - 5.0.0-RC-SNAPSHOT + 5.0.0-GA-SNAPSHOT org.apache @@ -111,21 +111,43 @@ 1.8 2.11.7 1.6.4 - 0.4.13 6.18 + 4.12 + 1.10.19 + + + 0.4.13 + 0.6.1 + 1.6.0 + 1.8 + 2.8.2 + 3.1.0 + 2.22.0 + 2.22.0 + 3.1.0 + 3.1.1 + 3.0.0-M2 + 0.12 + 3.8.0 + 3.1.0 + 3.0.1 + 2.5 + 4.3.0 + 0.8.1 + 3.0.0 junit junit - 4.12 + ${junit.version} test org.mockito mockito-all - 1.10.19 + ${mockito-all.version} test @@ -143,11 +165,74 @@ + + + + + io.takari + maven + ${takari-maven-plugin.version} + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + maven-antrun-plugin + ${maven-antrun-plugin.version} + + + maven-deploy-plugin + ${maven-deploy-plugin.version} + + + maven-assembly-plugin + ${maven-assembly-plugin.version} + + + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + maven-jar-plugin + ${maven-jar-plugin.version} + + + maven-shade-plugin + ${maven-shade-plugin.version} + + + + + maven-enforcer-plugin + ${maven-enforcer-plugin.version} + + + enforce-java + + enforce + + + + + + [1.8,9) + + + + + + org.apache.rat apache-rat-plugin - 0.12 + ${apache-rat-plugin.version} **/target/** @@ -203,6 +288,9 @@ skywalking-ui/package.json skywalking-ui/package-lock.json + + + .mvn/wrapper/maven-wrapper.properties @@ -215,19 +303,17 @@ - org.apache.maven.plugins maven-compiler-plugin + ${maven-compiler-plugin.version} ${compiler.version} ${compiler.version} ${project.build.sourceEncoding} - 3.6.1 - org.apache.maven.plugins maven-resources-plugin - 2.4.3 + ${maven-resource-plugin.version} ${project.build.sourceEncoding} @@ -242,8 +328,8 @@ - org.apache.maven.plugins maven-source-plugin + ${maven-source-plugin.version} @@ -254,17 +340,16 @@ - 2.4 org.codehaus.mojo versions-maven-plugin - 2.3 + ${versions-maven-plugin.version} org.eluder.coveralls coveralls-maven-plugin - 4.1.0 + ${coveralls-maven-plugin.version} ${project.build.sourceDirectory} @@ -275,7 +360,7 @@ org.jacoco jacoco-maven-plugin - 0.7.9 + ${jacoco-maven-plugin.version} *MethodAccess @@ -292,7 +377,7 @@ maven-checkstyle-plugin - 2.17 + ${maven-checkstyle-plugin.version} org.apache.skywalking @@ -337,7 +422,6 @@ org.codehaus.mojo exec-maven-plugin - 1.6.0 git submodule update @@ -374,7 +458,6 @@ org.codehaus.mojo exec-maven-plugin - 1.6.0 install-ojdbc @@ -424,7 +507,6 @@ org.codehaus.mojo exec-maven-plugin - 1.6.0 install-resin-4 diff --git a/skywalking-ui b/skywalking-ui index f9c602936ab4..ad3ee45dbadf 160000 --- a/skywalking-ui +++ b/skywalking-ui @@ -1 +1 @@ -Subproject commit f9c602936ab4f386576bf16f203efac61962e424 +Subproject commit ad3ee45dbadfae35d77238bdd7a1df593158f109