未验证 提交 da44d285 编写于 作者: D Daming 提交者: GitHub

Introduce Agent-Test-Tool suite (#4458)

* Introduce Agent-Test-Tool suite

* rename term
上级 8e1530d4
......@@ -10,7 +10,7 @@ target/
packages/
**/dependency-reduced-pom.xml
/skywalking-agent/
/dist/
**/dist/
/docker/snapshot/*.gz
.mvn/wrapper/*.jar
OALLexer.tokens
......
......@@ -214,7 +214,7 @@ as the version number, it will be changed in the test for every version.
**Register verify description format**
```yml
registryItems:
applications:
services:
- APPLICATION_CODE: APPLICATION_ID(int)
...
instances:
......@@ -228,7 +228,7 @@ registryItems:
| Field | Description
| --- | ---
| applications | The registered service codes. Normally, not 0 should be enough.
| services | The registered service codes. Normally, not 0 should be enough.
| instances | The number of service instances exists in this test case.
| operationNames | All endpoint registered in this test case. Also means, the operation names of all entry spans.
......@@ -237,7 +237,7 @@ registryItems:
```yml
segments:
-
applicationCode: APPLICATION_CODE(string)
serviceName: APPLICATION_CODE(string)
segmentSize: SEGMENT_SIZE(int)
segments:
- segmentId: SEGMENT_ID(string)
......@@ -248,7 +248,7 @@ segments:
| Field | Description
| --- | ---
| applicationCode | Service code.
| serviceName | Service code.
| segmentSize | The number of segments is expected.
| segmentId | trace ID.
| spans | segment span list. Follow the next section to see how to describe every span.
......@@ -446,7 +446,7 @@ HttpClient test case is running in Tomcat container, only one instance exists, s
```yml
registryItems:
applications:
services:
- {httpclient-case: nq 0}
instances:
- {httpclient-case: 1}
......@@ -462,7 +462,7 @@ By following the flow of HttpClient case, there should be two segments created.
```yml
segments:
- applicationCode: httpclient-case
- serviceName: httpclient-case
segmentSize: ge 2 # Could have more than one health check segments, because, the dependency is not standby.
```
......
......@@ -16,20 +16,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
PRG="$0"
PRGDIR=`dirname "$PRG"`
[ -z "$COLLECTOR_HOME" ] && COLLECTOR_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
WORK_DIRECTORY=$1
RESPOSITORY=$2
COMMIT_ID=$3
DIST_DIRECTORY=$4
_RUNJAVA=${JAVA_HOME}/bin/java
[ -z "$JAVA_HOME" ] && _RUNJAVA=`java`
HOME_DIR="$(cd "$(dirname $0)"; pwd)"
CLASSPATH="$COLLECTOR_HOME/config:$CLASSPATH"
for i in "$COLLECTOR_HOME"/libs/*.jar
do
CLASSPATH="$i:$CLASSPATH"
done
git clone $RESPOSITORY $WORK_DIRECTORY
JAVA_OPTS="${JAVA_OPTS} -Xmx256m -Xms256m"
JAVA_OPTS="${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 "
cd $WORK_DIRECTORY
$_RUNJAVA ${JAVA_OPTS} -classpath $CLASSPATH org.apache.skywalking.plugin.test.mockcollector.Main
git checkout $COMMIT_ID
mvn -B package -DskipTests
[[ -d $DIST_DIRECTORY ]] || mkdir -p $DIST_DIRECTORY
cp $WORK_DIRECTORY/dist/* $DIST_DIRECTORY/
\ No newline at end of file
......@@ -16,8 +16,11 @@
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
......@@ -26,56 +29,45 @@
<version>1.0.0</version>
</parent>
<artifactId>validator</artifactId>
<packaging>jar</packaging>
<name>skywalking-validator-tools</name>
<url>http://maven.apache.org</url>
<artifactId>agent-test-tools</artifactId>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>
<name>SkyWalking Agent Test Tools</name>
<packaging>pom</packaging>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.23</version>
</dependency>
</dependencies>
<properties>
<agent-test-tools.version>d3acf65652b136b0ba0c23ce38168dd4a9830927</agent-test-tools.version>
<agent-test-tools.workingDirectory>${project.basedir}/target/agent-test-tools</agent-test-tools.workingDirectory>
<agent-test-tools.repos>https://github.com/apache/skywalking-agent-test-tool.git</agent-test-tools.repos>
</properties>
<build>
<finalName>skywalking-validator-tools</finalName>
<finalName>skywalking-mock-collector</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<phase>package</phase>
<phase>initialize</phase>
<goals>
<goal>shade</goal>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.apache.skywalking.plugin.test.agent.tool.Main</mainClass>
</transformer>
</transformers>
<outputFile>../dist/${project.build.finalName}.jar</outputFile>
<executable>bash</executable>
<arguments>
<argument>${project.basedir}/bin/fetch-code.sh</argument>
<argument>${agent-test-tools.workingDirectory}</argument>
<argument>${agent-test-tools.repos}</argument>
<argument>${agent-test-tools.version}</argument>
<argument>${project.basedir}/dist</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
</plugin>
</plugins>
</build>
</project>
</project>
\ No newline at end of file
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {${scenario_name}: 2}
instances:
- {${scenario_name}: 1}
......@@ -22,6 +22,6 @@ registryItems:
- ${scenario_name}: []
heartbeat: []
segmentItems:
- applicationCode: ${scenario_name}
- serviceName: ${scenario_name}
segmentSize:
segments:
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {${scenario_name}: 2}
instances:
- {${scenario_name}: 1}
......@@ -22,6 +22,6 @@ registryItems:
- ${scenario_name}: []
heartbeat: []
segmentItems:
- applicationCode: ${scenario_name}
- serviceName: ${scenario_name}
segmentSize:
segments:
......@@ -22,7 +22,7 @@ WORKDIR /usr/local/skywalking/tools
COPY run.sh /
RUN chmod +x /run.sh
COPY skywalking-validator-tools.jar /usr/local/skywalking/tools
COPY validator.jar /usr/local/skywalking/tools/skywalking-validator-tools.jar
COPY skywalking-mock-collector.tar.gz /usr/local/skywalking/tools
RUN tar -xvf skywalking-mock-collector.tar.gz -C /usr/local/skywalking/tools
......
......@@ -30,9 +30,10 @@
</parent>
<artifactId>jvm-container</artifactId>
<name>agent-test-jvm</name>
<name>name>SkyWalking JVM Runner Image</name>
<properties>
<skip.docker>false</skip.docker>
<docker.image.name>skywalking/agent-test-jvm</docker.image.name>
</properties>
</project>
......@@ -30,6 +30,8 @@
</parent>
<artifactId>containers</artifactId>
<name>SkyWalking Plugin Test Runner Images</name>
<modules>
<module>tomcat-container</module>
<module>jvm-container</module>
......@@ -37,6 +39,7 @@
<properties>
<skip.docker>true</skip.docker>
<docker.image.name>skywalking/${project.name}</docker.image.name>
</properties>
<build>
......@@ -46,15 +49,16 @@
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
<configuration>
<imageName>skywalking/${project.name}:${BUILD_NO}</imageName>
<!--suppress UnresolvedMavenProperty -->
<imageName>${docker.image.name}:${BUILD_NO}</imageName>
<dockerDirectory>${project.basedir}/docker</dockerDirectory>
<skipDocker>${skip.docker}</skipDocker>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.basedir}/../../dist</directory>
<directory>${project.basedir}/../../agent-test-tools/dist</directory>
<include>skywalking-mock-collector.tar.gz</include>
<include>skywalking-validator-tools.jar</include>
<include>validator.jar</include>
</resource>
</resources>
</configuration>
......
......@@ -23,7 +23,7 @@ ENV CATALINA_OPTS ""
COPY run.sh /
COPY catalina.sh /usr/local/tomcat/bin/
COPY skywalking-validator-tools.jar /usr/local/skywalking/tools
COPY validator.jar /usr/local/skywalking/tools/skywalking-validator-tools.jar
COPY skywalking-mock-collector.tar.gz /usr/local/skywalking/tools
RUN tar -xvf skywalking-mock-collector.tar.gz -C /usr/local/skywalking/tools
......
......@@ -30,11 +30,11 @@
</parent>
<artifactId>tomcat-container</artifactId>
<name>agent-test-tomcat</name>
<name>name>SkyWalking Tomcat Runner Image</name>
<properties>
<skip.docker>false</skip.docker>
<docker.image.name>skywalking/agent-test-tomcat</docker.image.name>
</properties>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking.plugin</groupId>
<artifactId>apache-skywalking-test-plugin</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>skywalking-mock-collector</artifactId>
<version>6.0.0-2018</version>
<packaging>jar</packaging>
<name>skywalking-mock-collector</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.4.0</grpc.version>
<netty.version>4.1.12.Final</netty.version>
<jetty.version>9.4.2.v20170220</jetty.version>
<gson.version>2.8.0</gson.version>
<snakeyaml.version>1.18</snakeyaml.version>
<docker.image.name>skywalking/mock-collector</docker.image.name>
<docker.image.version>${project.version}</docker.image.version>
</properties>
<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>${grpc.version}</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-handler-proxy</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http2</artifactId>
<version>${netty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
</dependencies>
<build>
<finalName>skywalking-mock-collector</finalName>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.4.1.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier}
</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.4.0:exe:${os.detected.classifier}
</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<outputDirectory>${project.basedir}/../dist</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<excludes>
<exclude>*.properties</exclude>
<exclude>*.yaml</exclude>
<exclude>*.xml</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id></id>
<formats>
<format>tar.gz</format>
</formats>
<dependencySets>
<dependencySet>
<outputDirectory>/libs</outputDirectory>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.basedir}/bin</directory>
<outputDirectory>/bin</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>collector.properties</include>
<include>log4j2.xml</include>
</includes>
<outputDirectory>/config</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/libs</outputDirectory>
<includes>
<include>${build.finalName}.jar</include>
</includes>
</fileSet>
</fileSets>
</assembly>
/*
* 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.plugin.test.mockcollector;
import io.grpc.netty.NettyServerBuilder;
import io.netty.channel.local.LocalAddress;
import java.io.IOException;
import java.net.InetSocketAddress;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData;
import org.apache.skywalking.plugin.test.mockcollector.service.ClearReceiveDataService;
import org.apache.skywalking.plugin.test.mockcollector.service.GrpcAddressHttpService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockInstanceDiscoveryService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockInstancePingService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockJVMMetricReportService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockNetworkAddressRegisterService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockRegisterService;
import org.apache.skywalking.plugin.test.mockcollector.service.MockTraceSegmentService;
import org.apache.skywalking.plugin.test.mockcollector.service.ReceiveDataService;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
public class Main {
public static void main(String[] args) throws Exception {
NettyServerBuilder.forAddress(LocalAddress.ANY)
.forPort(19876)
.maxConcurrentCallsPerConnection(12)
.maxMessageSize(16777216)
.addService(new MockRegisterService())
.addService(new MockInstancePingService())
.addService(new MockInstanceDiscoveryService())
.addService(new MockNetworkAddressRegisterService())
.addService(new MockTraceSegmentService())
.addService(new MockJVMMetricReportService())
.build()
.start();
Server jettyServer = new Server(new InetSocketAddress("0.0.0.0", Integer.valueOf(12800)));
String contextPath = "/";
ServletContextHandler servletContextHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
servletContextHandler.setContextPath(contextPath);
servletContextHandler.addServlet(new ServletHolder(new HttpServlet() {
@Override
protected void doGet(HttpServletRequest req,
HttpServletResponse resp) throws ServletException, IOException {
if (ValidateData.INSTANCE.getRegistryItem().getApplications().isEmpty()) {
resp.setStatus(500);
return;
}
resp.setStatus(200);
resp.getWriter().write("Success");
resp.getWriter().flush();
}
}), "/status");
servletContextHandler.addServlet(GrpcAddressHttpService.class, GrpcAddressHttpService.SERVLET_PATH);
servletContextHandler.addServlet(ReceiveDataService.class, ReceiveDataService.SERVLET_PATH);
servletContextHandler.addServlet(ClearReceiveDataService.class, ClearReceiveDataService.SERVLET_PATH);
jettyServer.setHandler(servletContextHandler);
jettyServer.start();
}
}
/*
* 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.plugin.test.mockcollector.entity;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class RegistryItem {
/**
* applicationCode, applicationId
*/
private final Map<String, Integer> applications;
/**
* applicationCode, operationName
*/
private final Map<String, Set<String>> operationNames;
/**
* applicationCode, instanceId
*/
private final Map<String, List<Integer>> instanceMapping;
/**
* applicationCode, count
*/
private final Map<String, Integer> heartBeats;
public RegistryItem() {
applications = new ConcurrentHashMap<>();
operationNames = new ConcurrentHashMap<>();
instanceMapping = new ConcurrentHashMap<>();
heartBeats = new ConcurrentHashMap<>();
}
public void registryApplication(Application application) {
applications.putIfAbsent(application.applicationCode, application.applicationId);
}
public void registryOperationName(OperationName operationName) {
String applicationCode = findApplicationCode(operationName.applicationId);
Set<String> operationNameList = operationNames.get(applicationCode);
if (operationNameList == null) {
operationNameList = new HashSet<>();
operationNames.put(applicationCode, operationNameList);
}
operationNameList.add(operationName.operationName);
}
public void registryInstance(Instance instance) {
String applicationCode = findApplicationCode(instance.applicationId);
List<Integer> instances = instanceMapping.get(applicationCode);
if (instances == null) {
instances = new ArrayList<>();
instanceMapping.put(applicationCode, instances);
}
if (!instances.contains(instance)) {
instances.add(instance.instanceId);
}
}
public String findApplicationCode(int id) {
for (Map.Entry<String, Integer> entry : applications.entrySet()) {
if (entry.getValue() == id) {
return entry.getKey();
}
}
throw new RuntimeException("Cannot found the code of applicationID[" + id + "].");
}
public void registryHeartBeat(HeartBeat heartBeat) {
for (Map.Entry<String, List<Integer>> entry : instanceMapping.entrySet()) {
if (entry.getValue().contains(heartBeat.instanceID)) {
Integer count = heartBeats.get(entry.getKey());
if (count != null) {
heartBeats.put(entry.getKey(), 0);
heartBeats.put(entry.getKey(), count++);
}
}
}
}
public static class OperationName {
int applicationId;
String operationName;
public OperationName(int applicationId, String operationName) {
this.applicationId = applicationId;
this.operationName = operationName;
}
}
public static class Application {
String applicationCode;
int applicationId;
public Application(String applicationCode, int applicationId) {
this.applicationCode = applicationCode;
this.applicationId = applicationId;
}
}
public static class Instance {
int applicationId;
int instanceId;
public Instance(int applicationId, int instanceId) {
this.applicationId = applicationId;
this.instanceId = instanceId;
}
}
public static class HeartBeat {
private int instanceID;
public HeartBeat(int instanceID) {
this.instanceID = instanceID;
}
}
public Map<String, Integer> getApplications() {
return applications;
}
public Map<String, Set<String>> getOperationNames() {
return operationNames;
}
public Map<String, List<Integer>> getInstanceMapping() {
return instanceMapping;
}
public Map<String, Integer> getHeartBeats() {
return heartBeats;
}
}
/*
* 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.plugin.test.mockcollector.entity;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import java.lang.reflect.Type;
public class RegistryItemSerializer implements JsonSerializer<RegistryItem> {
@Override
public JsonElement serialize(RegistryItem src, Type typeOfSrc, JsonSerializationContext context) {
JsonObject jsonObject = new JsonObject();
JsonArray applicationArrays = new JsonArray();
src.getApplications().forEach((applicationCode, applicationId) -> {
JsonObject applicationJson = new JsonObject();
applicationJson.addProperty(applicationCode, applicationId);
applicationArrays.add(applicationJson);
});
jsonObject.add("applications", applicationArrays);
JsonArray instanceArrays = new JsonArray();
src.getInstanceMapping().forEach((applicationCode, instanceIds) -> {
JsonObject instanceJson = new JsonObject();
instanceJson.addProperty(applicationCode, instanceIds.size());
instanceArrays.add(instanceJson);
});
jsonObject.add("instances", instanceArrays);
JsonArray operationNameArrays = new JsonArray();
src.getOperationNames().forEach((applicationCode, operationNames) -> {
JsonObject instanceJson = new JsonObject();
instanceJson.add(applicationCode, new Gson().toJsonTree(operationNames));
operationNameArrays.add(instanceJson);
});
jsonObject.add("operationNames", operationNameArrays);
JsonArray heartBeatArrays = new JsonArray();
src.getHeartBeats().forEach((applicationCode, count) -> {
JsonObject instanceJson = new JsonObject();
instanceJson.addProperty(applicationCode, count);
heartBeatArrays.add(instanceJson);
});
jsonObject.add("heartbeat", heartBeatArrays);
return jsonObject;
}
}
/*
* 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.plugin.test.mockcollector.entity;
import java.util.ArrayList;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.ToString;
import org.apache.skywalking.apm.network.language.agent.UniqueId;
@ToString
@Builder
@AllArgsConstructor
public class Segment {
private String segmentId;
private List<Span> spans;
public static class SegmentBuilder {
public SegmentBuilder addSpan(Span.SpanBuilder spanBuilder) {
if (spans == null) {
this.spans = new ArrayList<>();
}
spans.add(spanBuilder.build());
return this;
}
public SegmentBuilder segmentId(UniqueId segmentUniqueId) {
segmentId = String.join(".", Long.toString(segmentUniqueId.getIdParts(0)), Long.toString(segmentUniqueId.getIdParts(1)), Long
.toString(segmentUniqueId.getIdParts(2)));
return this;
}
}
}
/*
* 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.plugin.test.mockcollector.entity;
import java.util.ArrayList;
import java.util.List;
public class SegmentItem {
private String applicationCode;
private List<Segment> segments;
public SegmentItem(String applicationCode) {
this.applicationCode = applicationCode;
segments = new ArrayList<>();
}
public void addSegments(Segment item) {
segments.add(item);
}
public String getApplicationCode() {
return applicationCode;
}
public List<Segment> getSegments() {
return segments;
}
}
/*
* 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.plugin.test.mockcollector.entity;
import java.util.HashMap;
import java.util.Map;
public class SegmentItems {
private Map<String, SegmentItem> segmentItems;
public SegmentItems() {
this.segmentItems = new HashMap<>();
}
public SegmentItems addSegmentItem(int applicationId, Segment segment) {
String applicationCode = ValidateData.INSTANCE.getRegistryItem().findApplicationCode(applicationId);
SegmentItem segmentItem = segmentItems.get(applicationCode);
if (segmentItem == null) {
segmentItem = new SegmentItem(applicationCode);
segmentItems.put(applicationCode, segmentItem);
}
segmentItem.addSegments(segment);
return this;
}
public Map<String, SegmentItem> getSegmentItems() {
return segmentItems;
}
}
/*
* 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.plugin.test.mockcollector.entity;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import java.lang.reflect.Type;
public class SegmentItemsSerializer implements JsonSerializer<SegmentItems> {
@Override
public JsonElement serialize(SegmentItems src, Type typeOfSrc, JsonSerializationContext context) {
JsonArray applicationSegmentItems = new JsonArray();
src.getSegmentItems().forEach((applicationCode, segmentItem) -> {
JsonObject segmentJson = new JsonObject();
segmentJson.addProperty("applicationCode", applicationCode);
segmentJson.addProperty("segmentSize", segmentItem.getSegments().size());
JsonArray segments = new JsonArray();
segmentItem.getSegments().forEach(segment -> {
segments.add(new Gson().toJsonTree(segment));
});
segmentJson.add("segments", segments);
applicationSegmentItems.add(segmentJson);
});
return applicationSegmentItems;
}
}
/*
* 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.
*/
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package org.apache.skywalking.plugin.test.mockcollector.entity;
import java.util.ArrayList;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.ToString;
import org.apache.skywalking.apm.network.common.KeyStringValuePair;
import org.apache.skywalking.apm.network.language.agent.KeyWithStringValue;
import org.apache.skywalking.apm.network.language.agent.TraceSegmentReference;
import org.apache.skywalking.apm.network.language.agent.UniqueId;
import org.apache.skywalking.apm.network.language.agent.v2.SegmentReference;
@Builder
@ToString
@AllArgsConstructor
public class Span {
private String operationName;
private int operationId;
private int parentSpanId;
private int spanId;
private String spanLayer;
private long startTime;
private long endTime;
private int componentId;
private String componentName;
private boolean isError;
private String spanType;
private String peer;
private int peerId;
private List<KeyValuePair> tags = new ArrayList<>();
private List<LogEvent> logs = new ArrayList<>();
private List<SegmentRef> refs = new ArrayList<>();
public static class LogEvent {
private List<KeyValuePair> logEvent;
public LogEvent() {
this.logEvent = new ArrayList<>();
}
}
public static class SpanBuilder {
public SpanBuilder logEvent(List<KeyStringValuePair> eventMessage) {
if (logs == null) {
logs = new ArrayList<>();
}
LogEvent event = new LogEvent();
for (KeyStringValuePair value : eventMessage) {
event.logEvent.add(new KeyValuePair(value.getKey(), value.getValue()));
}
logs.add(event);
return this;
}
public SpanBuilder tags(String key, String value) {
if (tags == null) {
tags = new ArrayList<>();
}
tags.add(new KeyValuePair(key, value));
return this;
}
public SpanBuilder ref(SegmentRef segmentRefBuilder) {
if (refs == null) {
refs = new ArrayList<>();
}
refs.add(segmentRefBuilder);
return this;
}
public SpanBuilder logEventV1(List<KeyWithStringValue> dataList) {
if (logs == null) {
logs = new ArrayList<>();
}
LogEvent event = new LogEvent();
for (KeyWithStringValue value : dataList) {
event.logEvent.add(new KeyValuePair(value.getKey(), value.getValue()));
}
logs.add(event);
return this;
}
}
public static class KeyValuePair {
@Getter
private String key;
@Getter
private String value;
public KeyValuePair(String key, String value) {
this.key = key;
this.value = value;
}
}
@ToString
public static class SegmentRef {
@Getter
private int parentEndpointId;
@Getter
private String parentEndpoint;
@Getter
private int networkAddressId;
@Getter
private int entryEndpointId;
@Getter
private String refType;
@Getter
private int parentSpanId;
@Getter
private String parentTraceSegmentId;
@Getter
private int parentServiceInstanceId;
@Getter
private String networkAddress;
@Getter
private String entryEndpoint;
@Getter
private int entryServiceInstanceId;
public SegmentRef(SegmentReference ref) {
UniqueId segmentUniqueId = ref.getParentTraceSegmentId();
this.parentTraceSegmentId = String.join(".", Long.toString(segmentUniqueId.getIdParts(0)), Long.toString(segmentUniqueId
.getIdParts(1)), Long.toString(segmentUniqueId.getIdParts(2)));
this.refType = ref.getRefType().toString();
this.parentSpanId = ref.getParentSpanId();
this.entryEndpointId = ref.getEntryEndpointId();
this.networkAddressId = ref.getNetworkAddressId();
this.parentServiceInstanceId = ref.getParentServiceInstanceId();
this.parentEndpointId = ref.getParentEndpointId();
this.parentEndpoint = ref.getParentEndpoint();
this.networkAddress = ref.getNetworkAddress();
this.entryEndpoint = ref.getEntryEndpoint();
this.entryServiceInstanceId = ref.getEntryServiceInstanceId();
}
public SegmentRef(TraceSegmentReference ref) {
UniqueId segmentUniqueId = ref.getParentTraceSegmentId();
this.parentTraceSegmentId = String.join(".", Long.toString(segmentUniqueId.getIdParts(0)), Long.toString(segmentUniqueId
.getIdParts(1)), Long.toString(segmentUniqueId.getIdParts(2)));
this.refType = ref.getRefType().toString();
this.parentSpanId = ref.getParentSpanId();
this.entryEndpointId = ref.getEntryServiceId();
this.networkAddressId = ref.getNetworkAddressId();
this.parentServiceInstanceId = ref.getParentApplicationInstanceId();
this.parentEndpointId = ref.getParentServiceId();
this.parentEndpoint = ref.getParentServiceName();
this.networkAddress = ref.getNetworkAddress();
this.entryEndpoint = ref.getEntryServiceName();
this.entryServiceInstanceId = ref.getEntryApplicationInstanceId();
}
}
}
/*
* 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.plugin.test.mockcollector.entity;
public class ValidateData {
public static ValidateData INSTANCE = new ValidateData();
private RegistryItem registryItem;
private SegmentItems segmentItem;
public ValidateData() {
registryItem = new RegistryItem();
segmentItem = new SegmentItems();
}
public RegistryItem getRegistryItem() {
return registryItem;
}
public SegmentItems getSegmentItem() {
return segmentItem;
}
public static void clearData() {
System.out.println("Clear Data");
INSTANCE.segmentItem = new SegmentItems();
INSTANCE.registryItem.getOperationNames().clear();
}
}
/*
* 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.plugin.test.mockcollector.entity;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import java.lang.reflect.Type;
public class ValidateDataSerializer implements JsonSerializer<ValidateData> {
@Override
public JsonElement serialize(ValidateData src, Type typeOfSrc, JsonSerializationContext context) {
Gson gson = new GsonBuilder().registerTypeAdapter(RegistryItem.class, new RegistryItemSerializer())
.registerTypeAdapter(SegmentItems.class, new SegmentItemsSerializer())
.create();
JsonObject jsonObject = new JsonObject();
jsonObject.add("registryItems", gson.toJsonTree(src.getRegistryItem()));
jsonObject.add("segmentItems", gson.toJsonTree(src.getSegmentItem()));
return jsonObject;
}
}
/*
* 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.plugin.test.mockcollector.service;
import java.io.IOException;
import java.io.Writer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData;
public class ClearReceiveDataService extends HttpServlet {
public static final String SERVLET_PATH = "/receiveData/clear";
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("text/json");
resp.setCharacterEncoding("utf-8");
resp.setStatus(200);
ValidateData.clearData();
Writer out = resp.getWriter();
out.flush();
out.close();
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req, resp);
}
}
/*
* 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.plugin.test.mockcollector.service;
import com.google.gson.JsonArray;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.skywalking.plugin.test.mockcollector.util.ConfigReader;
public class GrpcAddressHttpService extends HttpServlet {
public static String SERVLET_PATH = "/agent/gRPC";
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
JsonArray jsonArray = new JsonArray();
jsonArray.add(ConfigReader.getGrpcBindHost() + ":" + ConfigReader.getGrpcBindPort());
resp.setContentType("text/json");
resp.setCharacterEncoding("utf-8");
resp.setStatus(200);
PrintWriter out = resp.getWriter();
out.print(jsonArray.toString());
out.flush();
out.close();
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doPost(req, resp);
}
}
/*
* 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.plugin.test.mockcollector.service;
import io.grpc.stub.StreamObserver;
import org.apache.skywalking.apm.network.common.Commands;
import org.apache.skywalking.apm.network.language.agent.v2.CLRMetricCollection;
import org.apache.skywalking.apm.network.language.agent.v2.CLRMetricReportServiceGrpc;
/**
* Author Daming Email zteny@foxmail.com
**/
public class MockCLRMetricReportService extends CLRMetricReportServiceGrpc.CLRMetricReportServiceImplBase {
@Override
public void collect(CLRMetricCollection request, StreamObserver<Commands> responseObserver) {
responseObserver.onNext(Commands.newBuilder().build());
responseObserver.onCompleted();
}
}
/*
* 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.plugin.test.mockcollector.service;
import io.grpc.stub.StreamObserver;
import org.apache.skywalking.apm.network.language.agent.ApplicationInstance;
import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceHeartbeat;
import org.apache.skywalking.apm.network.language.agent.ApplicationInstanceMapping;
import org.apache.skywalking.apm.network.language.agent.Downstream;
import org.apache.skywalking.apm.network.language.agent.InstanceDiscoveryServiceGrpc;
import org.apache.skywalking.plugin.test.mockcollector.entity.RegistryItem;
import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData;
public class MockInstanceDiscoveryService extends InstanceDiscoveryServiceGrpc.InstanceDiscoveryServiceImplBase {
@Override
public void heartbeat(ApplicationInstanceHeartbeat request, StreamObserver<Downstream> responseObserver) {
ValidateData.INSTANCE.getRegistryItem()
.registryHeartBeat(new RegistryItem.HeartBeat(request.getApplicationInstanceId()));
responseObserver.onNext(Downstream.getDefaultInstance());
responseObserver.onCompleted();
}
@Override
public void registerInstance(ApplicationInstance request,
StreamObserver<ApplicationInstanceMapping> responseObserver) {
int instanceId = Sequences.INSTANCE_SEQUENCE.incrementAndGet();
ValidateData.INSTANCE.getRegistryItem()
.registryInstance(new RegistryItem.Instance(request.getApplicationId(), instanceId));
responseObserver.onNext(ApplicationInstanceMapping.newBuilder()
.setApplicationId(request.getApplicationId())
.setApplicationInstanceId(instanceId)
.build());
responseObserver.onCompleted();
}
}
/*
* 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.plugin.test.mockcollector.service;
import io.grpc.stub.StreamObserver;
import org.apache.skywalking.apm.network.common.Commands;
import org.apache.skywalking.apm.network.register.v2.ServiceInstancePingGrpc;
import org.apache.skywalking.apm.network.register.v2.ServiceInstancePingPkg;
import org.apache.skywalking.plugin.test.mockcollector.entity.RegistryItem;
import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData;
public class MockInstancePingService extends ServiceInstancePingGrpc.ServiceInstancePingImplBase {
@Override
public void doPing(ServiceInstancePingPkg request, StreamObserver<Commands> responseObserver) {
ValidateData.INSTANCE.getRegistryItem()
.registryHeartBeat(new RegistryItem.HeartBeat(request.getServiceInstanceId()));
responseObserver.onNext(Commands.getDefaultInstance());
responseObserver.onCompleted();
}
}
/*
* 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.plugin.test.mockcollector.service;
import io.grpc.stub.StreamObserver;
import org.apache.skywalking.apm.network.common.Commands;
import org.apache.skywalking.apm.network.language.agent.v2.JVMMetricCollection;
import org.apache.skywalking.apm.network.language.agent.v2.JVMMetricReportServiceGrpc;
/**
* Author Daming Email zteny@foxmail.com
**/
public class MockJVMMetricReportService extends JVMMetricReportServiceGrpc.JVMMetricReportServiceImplBase {
@Override
public void collect(JVMMetricCollection request, StreamObserver<Commands> responseObserver) {
responseObserver.onNext(Commands.newBuilder().build());
responseObserver.onCompleted();
}
}
/*
* 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.plugin.test.mockcollector.service;
import io.grpc.stub.StreamObserver;
import org.apache.skywalking.apm.network.language.agent.NetworkAddressMappings;
import org.apache.skywalking.apm.network.language.agent.NetworkAddressRegisterServiceGrpc;
import org.apache.skywalking.apm.network.language.agent.NetworkAddresses;
public class MockNetworkAddressRegisterService extends NetworkAddressRegisterServiceGrpc.NetworkAddressRegisterServiceImplBase {
@Override
public void batchRegister(NetworkAddresses request, StreamObserver<NetworkAddressMappings> responseObserver) {
responseObserver.onNext(NetworkAddressMappings.getDefaultInstance());
responseObserver.onCompleted();
}
}
/*
* 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.plugin.test.mockcollector.service;
import io.grpc.stub.StreamObserver;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.skywalking.apm.network.common.KeyIntValuePair;
import org.apache.skywalking.apm.network.register.v2.Endpoint;
import org.apache.skywalking.apm.network.register.v2.EndpointMapping;
import org.apache.skywalking.apm.network.register.v2.Enpoints;
import org.apache.skywalking.apm.network.register.v2.NetAddressMapping;
import org.apache.skywalking.apm.network.register.v2.NetAddresses;
import org.apache.skywalking.apm.network.register.v2.RegisterGrpc;
import org.apache.skywalking.apm.network.register.v2.Service;
import org.apache.skywalking.apm.network.register.v2.ServiceInstance;
import org.apache.skywalking.apm.network.register.v2.ServiceInstanceRegisterMapping;
import org.apache.skywalking.apm.network.register.v2.ServiceInstances;
import org.apache.skywalking.apm.network.register.v2.ServiceRegisterMapping;
import org.apache.skywalking.apm.network.register.v2.Services;
import org.apache.skywalking.plugin.test.mockcollector.entity.RegistryItem;
import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData;
public class MockRegisterService extends RegisterGrpc.RegisterImplBase {
private Logger logger = LogManager.getLogger(MockTraceSegmentService.class);
@Override
public void doEndpointRegister(Enpoints request, StreamObserver<EndpointMapping> responseObserver) {
for (Endpoint endpoint : request.getEndpointsList()) {
ValidateData.INSTANCE.getRegistryItem()
.registryOperationName(new RegistryItem.OperationName(endpoint.getServiceId(), endpoint
.getEndpointName()));
}
responseObserver.onNext(EndpointMapping.getDefaultInstance());
responseObserver.onCompleted();
}
@Override
public void doNetworkAddressRegister(NetAddresses request, StreamObserver<NetAddressMapping> responseObserver) {
responseObserver.onNext(NetAddressMapping.getDefaultInstance());
responseObserver.onCompleted();
}
@Override
public void doServiceInstanceRegister(ServiceInstances request,
StreamObserver<ServiceInstanceRegisterMapping> responseObserver) {
if (request.getInstancesCount() <= 0) {
responseObserver.onNext(ServiceInstanceRegisterMapping.getDefaultInstance());
responseObserver.onCompleted();
return;
}
for (ServiceInstance serviceInstance : request.getInstancesList()) {
int instanceId = Sequences.INSTANCE_SEQUENCE.incrementAndGet();
ValidateData.INSTANCE.getRegistryItem()
.registryInstance(new RegistryItem.Instance(serviceInstance.getServiceId(), instanceId));
responseObserver.onNext(ServiceInstanceRegisterMapping.newBuilder()
.addServiceInstances(KeyIntValuePair.newBuilder()
.setKey(serviceInstance
.getInstanceUUID())
.setValue(instanceId)
.build())
.build());
responseObserver.onCompleted();
}
}
@Override
public void doServiceRegister(Services request, StreamObserver<ServiceRegisterMapping> responseObserver) {
logger.debug("receive application register.");
if (request.getServicesCount() <= 0) {
logger.warn("The service count is empty. return the default service register mapping");
responseObserver.onNext(ServiceRegisterMapping.getDefaultInstance());
responseObserver.onCompleted();
return;
}
for (Service service : request.getServicesList()) {
String applicationCode = service.getServiceName();
ServiceRegisterMapping.Builder builder = ServiceRegisterMapping.newBuilder();
if (applicationCode.startsWith("localhost") || applicationCode.startsWith("127.0.0.1") || applicationCode.contains(":") || applicationCode
.contains("/")) {
responseObserver.onNext(builder.build());
responseObserver.onCompleted();
return;
}
Integer applicationId = Sequences.SERVICE_MAPPING.get(applicationCode);
if (applicationId == null) {
applicationId = Sequences.ENDPOINT_SEQUENCE.incrementAndGet();
Sequences.SERVICE_MAPPING.put(applicationCode, applicationId);
ValidateData.INSTANCE.getRegistryItem()
.registryApplication(new RegistryItem.Application(applicationCode, applicationId));
}
builder.addServices(KeyIntValuePair.newBuilder().setKey(applicationCode).setValue(applicationId).build());
responseObserver.onNext(builder.build());
responseObserver.onCompleted();
}
}
}
/*
* 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.plugin.test.mockcollector.service;
import com.google.protobuf.InvalidProtocolBufferException;
import io.grpc.stub.StreamObserver;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.skywalking.apm.network.common.Commands;
import org.apache.skywalking.apm.network.common.KeyStringValuePair;
import org.apache.skywalking.apm.network.language.agent.UpstreamSegment;
import org.apache.skywalking.apm.network.language.agent.v2.Log;
import org.apache.skywalking.apm.network.language.agent.v2.SegmentObject;
import org.apache.skywalking.apm.network.language.agent.v2.SegmentReference;
import org.apache.skywalking.apm.network.language.agent.v2.SpanObjectV2;
import org.apache.skywalking.apm.network.language.agent.v2.TraceSegmentReportServiceGrpc;
import org.apache.skywalking.plugin.test.mockcollector.entity.Segment;
import org.apache.skywalking.plugin.test.mockcollector.entity.Span;
import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData;
public class MockTraceSegmentService extends TraceSegmentReportServiceGrpc.TraceSegmentReportServiceImplBase {
private Logger logger = LogManager.getLogger(MockTraceSegmentService.class);
@Override
public StreamObserver<UpstreamSegment> collect(StreamObserver<Commands> responseObserver) {
return new StreamObserver<UpstreamSegment>() {
@Override
public void onNext(UpstreamSegment value) {
try {
SegmentObject traceSegmentObject = SegmentObject.parseFrom(value.getSegment());
Segment.SegmentBuilder segmentBuilder = Segment.builder()
.segmentId(traceSegmentObject.getTraceSegmentId());
logger.debug("Receive segment: ServiceID[{}], TraceSegmentId[{}]", traceSegmentObject.getServiceId(), traceSegmentObject
.getTraceSegmentId());
for (SpanObjectV2 spanObject : traceSegmentObject.getSpansList()) {
Span.SpanBuilder spanBuilder = Span.builder()
.operationName(spanObject.getOperationName())
.parentSpanId(spanObject.getParentSpanId())
.spanId(spanObject.getSpanId())
.componentId(spanObject.getComponentId())
.componentName(spanObject.getComponent())
.spanLayer(spanObject.getSpanLayer().toString())
.endTime(spanObject.getEndTime())
.isError(spanObject.getIsError())
.startTime(spanObject.getStartTime())
.spanType(spanObject.getSpanType().toString())
.peer(spanObject.getPeer())
.peerId(spanObject.getPeerId())
.operationId(spanObject.getOperationNameId());
for (Log logMessage : spanObject.getLogsList()) {
spanBuilder.logEvent(logMessage.getDataList());
}
for (KeyStringValuePair tags : spanObject.getTagsList()) {
spanBuilder.tags(tags.getKey(), tags.getValue());
}
for (SegmentReference ref : spanObject.getRefsList()) {
spanBuilder.ref(new Span.SegmentRef(ref));
}
segmentBuilder.addSpan(spanBuilder);
}
ValidateData.INSTANCE.getSegmentItem()
.addSegmentItem(traceSegmentObject.getServiceId(), segmentBuilder.build());
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
}
@Override
public void onError(Throwable t) {
}
@Override
public void onCompleted() {
responseObserver.onNext(Commands.newBuilder().build());
responseObserver.onCompleted();
}
};
}
}
/*
* 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.plugin.test.mockcollector.service;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.IOException;
import java.io.Writer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateData;
import org.apache.skywalking.plugin.test.mockcollector.entity.ValidateDataSerializer;
import org.yaml.snakeyaml.Yaml;
public class ReceiveDataService extends HttpServlet {
public static final String SERVLET_PATH = "/receiveData";
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setContentType("text/json");
resp.setCharacterEncoding("utf-8");
resp.setStatus(200);
Gson gson = new GsonBuilder().registerTypeAdapter(ValidateData.class, new ValidateDataSerializer()).create();
System.out.println();
Yaml yaml = new Yaml();
Writer out = resp.getWriter();
out.write(yaml.dump(yaml.load(gson.toJson(ValidateData.INSTANCE))));
out.flush();
out.close();
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req, resp);
}
}
/*
* 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.plugin.test.mockcollector.service;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
public class Sequences {
public static final AtomicInteger INSTANCE_SEQUENCE = new AtomicInteger();
public static final AtomicInteger ENDPOINT_SEQUENCE = new AtomicInteger(1);
public static final ConcurrentHashMap<String, Integer> SERVICE_MAPPING = new ConcurrentHashMap<String, Integer>();
}
/*
* 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.plugin.test.mockcollector.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class ConfigReader {
private static Properties config = new Properties();
static {
InputStream inputStream = ConfigReader.class.getClassLoader().getResourceAsStream("config.properties");
try {
config.load(inputStream);
} catch (IOException e) {
System.err.println("Failed to load config.");
System.exit(-1);
}
}
public static String getGrpcBindHost() {
return config.getProperty("grpc_bind_host", "127.0.0.1");
}
public static int getGrpcBindPort() {
return Integer.parseInt(config.getProperty("grpc_bind_port", "19876"));
}
}
# Apache SkyWalking data collect protocol
Apache SkyWalking can collect data from different sources. Each kind of source should follow the protocols in this repo.
## License
Apache 2.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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "common/common.proto";
message CLRMetric {
int64 time = 1;
CPU cpu = 2;
ClrGC gc = 3;
ClrThread thread = 4;
}
message ClrGC {
int64 Gen0CollectCount = 1;
int64 Gen1CollectCount = 2;
int64 Gen2CollectCount = 3;
int64 HeapMemory = 4;
}
message ClrThread {
int32 AvailableCompletionPortThreads = 1;
int32 AvailableWorkerThreads = 2;
int32 MaxCompletionPortThreads = 3;
int32 MaxWorkerThreads = 4;
}
\ No newline at end of file
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "common/common.proto";
message JVMMetric {
int64 time = 1;
CPU cpu = 2;
repeated Memory memory = 3;
repeated MemoryPool memoryPool = 4;
repeated GC gc = 5;
}
message Memory {
bool isHeap = 1;
int64 init = 2;
int64 max = 3;
int64 used = 4;
int64 committed = 5;
}
message MemoryPool {
PoolType type = 1;
int64 init = 2;
int64 max = 3;
int64 used = 4;
int64 commited = 5;
}
enum PoolType {
CODE_CACHE_USAGE = 0;
NEWGEN_USAGE = 1;
OLDGEN_USAGE = 2;
SURVIVOR_USAGE = 3;
PERMGEN_USAGE = 4;
METASPACE_USAGE = 5;
}
message GC {
GCPhrase phrase = 1;
int64 count = 2;
int64 time = 3;
}
enum GCPhrase {
NEW = 0;
OLD = 1;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.common";
option csharp_namespace = "SkyWalking.NetworkProtocol";
message KeyStringValuePair {
string key = 1;
string value = 2;
}
message KeyIntValuePair {
string key = 1;
int32 value = 2;
}
message CPU {
double usagePercent = 2;
}
// In most cases, detect point should be `server` or `client`.
// Even in service mesh, this means `server`/`client` side sidecar
// `proxy` is reserved only.
enum DetectPoint {
client = 0;
server = 1;
proxy = 2;
}
message Commands {
repeated Command commands = 1;
}
message Command {
string command = 1;
repeated KeyStringValuePair args = 2;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
message UpstreamSegment {
repeated UniqueId globalTraceIds = 1;
bytes segment = 2; // the byte array of TraceSegmentObject
}
enum SpanType {
Entry = 0;
Exit = 1;
Local = 2;
}
message UniqueId {
repeated int64 idParts = 1;
}
enum RefType {
CrossProcess = 0;
CrossThread = 1;
}
enum SpanLayer {
Unknown = 0;
Database = 1;
RPCFramework = 2;
Http = 3;
MQ = 4;
Cache = 5;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent.v2";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "common/common.proto";
import "common/CLR.proto";
service CLRMetricReportService {
rpc collect (CLRMetricCollection) returns (Commands) {
}
}
message CLRMetricCollection {
repeated CLRMetric metrics = 1;
int32 serviceInstanceId = 2;
}
\ No newline at end of file
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent.v2";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "common/common.proto";
import "common/JVM.proto";
service JVMMetricReportService {
rpc collect (JVMMetricCollection) returns (Commands) {
}
}
message JVMMetricCollection {
repeated JVMMetric metrics = 1;
int32 serviceInstanceId = 2;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent.v2";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "common/common.proto";
import "common/trace-common.proto";
service TraceSegmentReportService {
rpc collect (stream UpstreamSegment) returns (Commands) {
}
}
message SegmentObject {
UniqueId traceSegmentId = 1;
repeated SpanObjectV2 spans = 2;
int32 serviceId = 3;
int32 serviceInstanceId = 4;
bool isSizeLimited = 5;
}
message SegmentReference {
RefType refType = 1;
UniqueId parentTraceSegmentId = 2;
int32 parentSpanId = 3;
int32 parentServiceInstanceId = 4;
string networkAddress = 5;
int32 networkAddressId = 6;
int32 entryServiceInstanceId = 7;
string entryEndpoint = 8;
int32 entryEndpointId = 9;
string parentEndpoint = 10;
int32 parentEndpointId = 11;
}
message SpanObjectV2 {
int32 spanId = 1;
int32 parentSpanId = 2;
int64 startTime = 3;
int64 endTime = 4;
repeated SegmentReference refs = 5;
int32 operationNameId = 6;
string operationName = 7;
int32 peerId = 8;
string peer = 9;
SpanType spanType = 10;
SpanLayer spanLayer = 11;
int32 componentId = 12;
string component = 13;
bool isError = 14;
repeated KeyStringValuePair tags = 15;
repeated Log logs = 16;
}
message Log {
int64 time = 1;
repeated KeyStringValuePair data = 2;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "language-agent/KeyWithIntegerValue.proto";
//register service for ApplicationCode, this service is called when service starts.
service ApplicationRegisterService {
rpc applicationCodeRegister (Application) returns (ApplicationMapping) {
}
}
message Application {
string applicationCode = 1;
}
message ApplicationMapping {
KeyWithIntegerValue application = 1;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "language-agent/Downstream.proto";
import "common/trace-common.proto";
service InstanceDiscoveryService {
rpc registerInstance (ApplicationInstance) returns (ApplicationInstanceMapping) {
}
rpc heartbeat (ApplicationInstanceHeartbeat) returns (Downstream) {
}
}
message ApplicationInstance {
int32 applicationId = 1;
string agentUUID = 2;
int64 registerTime = 3;
OSInfo osinfo = 4;
}
message ApplicationInstanceMapping {
int32 applicationId = 1;
int32 applicationInstanceId = 2;
}
message ApplicationInstanceRecover {
int32 applicationId = 1;
int32 applicationInstanceId = 2;
int64 registerTime = 3;
OSInfo osinfo = 4;
}
message ApplicationInstanceHeartbeat {
int32 applicationInstanceId = 1;
int64 heartbeatTime = 2;
}
message OSInfo {
string osName = 1;
string hostname = 2;
int32 processNo = 3;
repeated string ipv4s = 4;
}
//discovery service for ServiceName by Network address or application code
service ServiceNameDiscoveryService {
rpc discovery (ServiceNameCollection) returns (ServiceNameMappingCollection) {
}
}
message ServiceNameCollection {
repeated ServiceNameElement elements = 1;
}
message ServiceNameMappingCollection {
repeated ServiceNameMappingElement elements = 1;
}
message ServiceNameMappingElement {
int32 serviceId = 1;
ServiceNameElement element = 2;
}
message ServiceNameElement {
string serviceName = 1;
int32 applicationId = 2;
SpanType srcSpanType = 3;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
// nothing down stream from collector yet.
message Downstream {
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "language-agent/Downstream.proto";
import "common/JVM.proto";
service JVMMetricsService {
rpc collect (JVMMetrics) returns (Downstream) {
}
}
message JVMMetrics {
repeated JVMMetric metrics = 1;
int32 applicationInstanceId = 2;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
message KeyWithIntegerValue {
string key = 1;
int32 value = 2;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
message KeyWithStringValue {
string key = 1;
string value = 2;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "language-agent/KeyWithIntegerValue.proto";
service NetworkAddressRegisterService {
rpc batchRegister (NetworkAddresses) returns (NetworkAddressMappings) {
}
}
message NetworkAddresses {
repeated string addresses = 1;
}
message NetworkAddressMappings {
repeated KeyWithIntegerValue addressIds = 1;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.language.agent";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "language-agent/Downstream.proto";
import "language-agent/KeyWithStringValue.proto";
import "common/trace-common.proto";
service TraceSegmentService {
rpc collect (stream UpstreamSegment) returns (Downstream) {
}
}
message TraceSegmentObject {
UniqueId traceSegmentId = 1;
repeated SpanObject spans = 2;
int32 applicationId = 3;
int32 applicationInstanceId = 4;
bool isSizeLimited = 5;
}
message TraceSegmentReference {
RefType refType = 1;
UniqueId parentTraceSegmentId = 2;
int32 parentSpanId = 3;
int32 parentApplicationInstanceId = 4;
string networkAddress = 5;
int32 networkAddressId = 6;
int32 entryApplicationInstanceId = 7;
string entryServiceName = 8;
int32 entryServiceId = 9;
string parentServiceName = 10;
int32 parentServiceId = 11;
}
message SpanObject {
int32 spanId = 1;
int32 parentSpanId = 2;
int64 startTime = 3;
int64 endTime = 4;
repeated TraceSegmentReference refs = 5;
int32 operationNameId = 6;
string operationName = 7;
int32 peerId = 8;
string peer = 9;
SpanType spanType = 10;
SpanLayer spanLayer = 11;
int32 componentId = 12;
string component = 13;
bool isError = 14;
repeated KeyWithStringValue tags = 15;
repeated LogMessage logs = 16;
}
message LogMessage {
int64 time = 1;
repeated KeyWithStringValue data = 2;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.register.v2";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "common/common.proto";
service ServiceInstancePing {
rpc doPing (ServiceInstancePingPkg) returns (Commands) {
}
}
message ServiceInstancePingPkg {
int32 serviceInstanceId = 1;
int64 time = 2;
string serviceInstanceUUID = 3;
}
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.register.v2";
option csharp_namespace = "SkyWalking.NetworkProtocol";
import "common/common.proto";
//register service for ApplicationCode, this service is called when service starts.
service Register {
rpc doServiceRegister (Services) returns (ServiceRegisterMapping) {
}
rpc doServiceInstanceRegister (ServiceInstances) returns (ServiceInstanceRegisterMapping) {
}
rpc doEndpointRegister (Enpoints) returns (EndpointMapping) {
}
rpc doNetworkAddressRegister (NetAddresses) returns (NetAddressMapping) {
}
rpc doServiceAndNetworkAddressMappingRegister (ServiceAndNetworkAddressMappings) returns(Commands) {
}
}
// Service register
message Services {
repeated Service services = 1;
}
message Service {
string serviceName = 1;
repeated KeyStringValuePair tags = 3;
repeated KeyStringValuePair properties = 4;
}
message ServiceRegisterMapping {
repeated KeyIntValuePair services = 1;
}
// Service Instance register
message ServiceInstances {
repeated ServiceInstance instances = 1;
}
message ServiceInstance {
int32 serviceId = 1;
string instanceUUID = 2;
int64 time = 3;
repeated KeyStringValuePair tags = 4;
repeated KeyStringValuePair properties = 5;
}
message ServiceInstanceRegisterMapping {
repeated KeyIntValuePair serviceInstances = 1;
}
// Network address register
// Only known use case is the language agent.
// Network address represents the ip/hostname:port, which is usually used at client side of RPC.
message NetAddresses {
repeated string addresses = 1;
}
message NetAddressMapping {
repeated KeyIntValuePair addressIds = 1;
}
// Endpint register
message Enpoints {
repeated Endpoint endpoints = 1;
}
message Endpoint {
int32 serviceId = 1;
string endpointName = 2;
repeated KeyStringValuePair tags = 3;
repeated KeyStringValuePair properties = 4;
// For endpoint
// from DetectPoint is either `client` or `server`. No chance to be `proxy`.
DetectPoint from = 5;
}
message EndpointMapping {
repeated EndpointMappingElement elements = 1;
}
message EndpointMappingElement {
int32 serviceId = 1;
string endpointName = 2;
int32 endpointId = 3;
DetectPoint from = 4;
}
message ServiceAndNetworkAddressMappings {
repeated ServiceAndNetworkAddressMapping mappings = 1;
}
message ServiceAndNetworkAddressMapping {
int32 serviceId = 1;
int32 serviceInstanceId = 2;
string networkAddress = 3;
int32 networkAddressId = 4;
}
---
title: Apache SkyWalking
description: Adapter to deliver metrics to Apache SkyWalking.
location: https://istio.io/docs/reference/config/policy-and-telemetry/adapters/apache-skywalking.html
layout: protoc-gen-docs
generator: protoc-gen-docs
provider: Apache SkyWalking
contact_email: dev@skywalking.apache.org
support_link:
source_link: https://github.com/apache/skywalking
latest_release_link: https://skywalking.apache.org/downloads/
helm_chart_link:
istio_versions: "1.0.3, 1.0.4, 1.1.0, 1.1.1"
supported_templates: metric
logo_link: https://github.com/apache/skywalking-website/raw/master/docs/.vuepress/public/assets/logo.svg
number_of_entries: 1
---
<!-- 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. -->
<p>The SkyWalking adapter uses the <code>Istio bypass</code> adapter to collect metrics and make them available to
<a href="https://skywalking.apache.org/">Apache SkyWalking</a>. SkyWalking provides a topology map and metrics graph
to visualize the whole mesh.</p>
<p>This adapter supports the <a href="https://istio.io/docs/reference/config/policy-and-telemetry/templates/metric/">metric template</a>.</p>
<p>Follow the <a href="https://github.com/apache/skywalking/blob/master/docs/README.md">official Apache SkyWalking documentation</a>
and <a href="https://github.com/apache/skywalking-kubernetes">SkyWalking k8s documentation</a> for details on configuring SkyWalking and the Istio bypass adapter.</p>
/*
* 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.
*
*/
syntax = "proto3";
option java_multiple_files = true;
option java_package = "org.apache.skywalking.apm.network.servicemesh";
import "common/common.proto";
service ServiceMeshMetricService {
rpc collect(stream ServiceMeshMetric) returns (MeshProbeDownstream) {
}
}
message ServiceMeshMetric {
int64 startTime = 1;
int64 endTime = 2;
string sourceServiceName = 3;
int32 sourceServiceId = 4;
string sourceServiceInstance = 5;
int32 sourceServiceInstanceId = 6;
string destServiceName = 7;
int32 destServiceId = 8;
string destServiceInstance = 9;
int32 destServiceInstanceId = 10;
string endpoint = 11;
int32 latency = 12;
int32 responseCode = 13;
bool status = 14;
Protocol protocol = 15;
DetectPoint detectPoint = 16;
}
enum Protocol {
HTTP = 0;
gRPC = 1;
}
message MeshProbeDownstream {
}
# 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.
grpc_bind_host=127.0.0.1
grpc_bind_port=19876
# 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.
expectData:
- registryItem:
- applications:
- test-applicationCode1: nq 0 // the application id of test-applicationCode is 3
- test-applicationCode2: nq 0
- operationNames:
- test-applicationCode1: {testOperationName, testOperationName1} // there are three operation names in test-applicationCode1 has been registery
- instances:
- test-applicationCode1: eq 3 // test-applicationCode1 has 3 instances
- test-applicationCode2: 1 // test-applicationCode2 has 1 instance
- heartbeat:
- test-applicationCode1: gt 2 // there are 3 instance of test-applicationCode has been send heartbeat
- segmentsItems:
-
test-applicationCode: 1 // test-applicationCode has seend 1 segment.
segments:
-
segmentId: not null
refs:
- parentSpanId: 1
- parentTraceSegmentId: ${test-applicationCode2[0]}
- networkAddress: xxx
- parentServiceId: 1
- parentServiceName: not null
- networkAddressId: 1
- entryServiceId: 1
- refType: xx
- parentApplicationInstanceId: 1
- entryServiceName: xx
spans:
-
operationName: testOperationName
parentSpanId: 0
spanId: 1
spanLayer: HTTP
logs:
- xx: xx
- bb: bb
tags:
- xx: xx
- aa: aa
stattime: not empty
endtime: not empty
componentId: 1
componentName:
spanType: Entry
isError: false
-
test-applicationCode2: 2
segments:
-
segmentId: not null
spans:
-
operationName: testOperationName
parentSpanId: 0
spanId: 1
spanLayer: HTTP
logs:
- xx: xx
- bb: bb
globalSegmentId:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<Configuration status="ERROR">
<Appenders>
<Console name="Console" target="SYSTEM_ERR">
<PatternLayout charset="UTF-8" pattern="[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%p] - %l - %m%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="ERROR">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
# 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.
#
validateData:
- registryItem:
- applications:
- test-applicationCode1: 3 // the application id of test-applicationCode is 3
- test-applicationCode2: 1
- operationNames:
- test-applicationCode1: {testOperationName, testOperationName1} // there are three operation names in test-applicationCode1 has been registery
- instances:
- test-applicationCode1: 3 // test-applicationCode1 has 3 instances
- test-applicationCode2: 1 // test-applicationCode2 has 1 instance
- heartbeat:
- test-applicationCode1: 3 // there are 3 instance of test-applicationCode has been send heartbeat
- segmentsItems:
-
test-applicationCode: 1 // test-applicationCode has seend 1 segment.
segments:
-
segmentId: xxxx
refs:
- parentSpanId: 1
- parentTraceSegmentId: ${test-applicationCode2[0]}
- networkAddress: xxx
- parentServiceId: 1
- parentServiceName: not null
- networkAddressId: 1
- entryServiceId: 1
- refType: xx
- parentApplicationInstanceId: 1
- entryServiceName: xx
spans:
-
operationName: testOperationName
parentSpanId: 0
spanId: 1
spanLayer: HTTP
logs:
- xx: xx
- bb: bb
tags:
- xx: xx
- aa: aa
stattime: 141
endtime: 141
componentId: 1
componentName:
spanType: Entry
isError: false
-
test-applicationCode2: 2
segments:
//.....
......@@ -32,8 +32,7 @@
<modules>
<module>runner-helper</module>
<module>validator</module>
<module>mock-collector</module>
<module>agent-test-tools</module>
<module>containers</module>
</modules>
......
......@@ -28,7 +28,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>runner-helper</artifactId>
<name>plugin-runner-helper</name>
<name>SkyWalking Plugin Test Runner Helper</name>
<dependencies>
<dependency>
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {activemq-scenario: nq 0}
instances:
- {activemq-scenario: nq 0}
......@@ -22,7 +22,7 @@ registryItems:
- activemq-scenario: [ActiveMQ/Queue/test/Consumer, /activemq-scenario/case/activemq]
heartbeat: []
segmentItems:
- applicationCode: activemq-scenario
- serviceName: activemq-scenario
segmentSize: ge 2
segments:
- segmentId: not null
......
......@@ -15,7 +15,7 @@
# limitations under the License.
registryItems:
applications:
services:
- {apm-toolkit-trace-scenario: 2}
instances:
- {apm-toolkit-trace-scenario: 1}
......@@ -24,7 +24,7 @@ registryItems:
/case/tool-kit, /case/asyncVisit/supplier]
heartbeat: []
segmentItems:
- applicationCode: apm-toolkit-trace-scenario
- serviceName: apm-toolkit-trace-scenario
segmentSize: gt 5
segments:
- segmentId: not null
......
......@@ -16,7 +16,7 @@
registryItems:
applications:
services:
- {'armeria-0.96minus-scenario': 2}
instances:
- {'armeria-0.96minus-scenario': 1}
......@@ -24,7 +24,7 @@ registryItems:
- 'armeria-0.96minus-scenario': [/greet/skywalking]
heartbeat: []
segmentItems:
- applicationCode: armeria-0.96minus-scenario
- serviceName: armeria-0.96minus-scenario
segmentSize: ge 2
segments:
- segmentId: not null
......
......@@ -16,7 +16,7 @@
registryItems:
applications:
services:
- {'armeria-0.96plus-scenario': 2}
instances:
- {'armeria-0.96plus-scenario': 1}
......@@ -24,7 +24,7 @@ registryItems:
- 'armeria-0.96plus-scenario': [/greet/skywalking]
heartbeat: []
segmentItems:
- applicationCode: armeria-0.96plus-scenario
- serviceName: armeria-0.96plus-scenario
segmentSize: ge 2
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {avro-server: 2}
- {avro-client: 3}
instances:
......@@ -25,7 +25,7 @@ registryItems:
- avro-client: [/avro-scenario/case/healthCheck, /avro-scenario/case/avro-scenario]
heartbeat: []
segmentItems:
- applicationCode: avro-server
- serviceName: avro-server
segmentSize: 1
segments:
- segmentId: not null
......@@ -48,7 +48,7 @@ segmentItems:
entryEndpointId: 0, refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null,
parentServiceInstanceId: 2, networkAddress: 'localhost/127.0.0.1:9018', entryEndpoint: /avro-scenario/case/avro-scenario,
entryServiceInstanceId: 2}
- applicationCode: avro-client
- serviceName: avro-client
segmentSize: ge 2
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {canal-scenario: 2}
instances:
- {canal-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- canal-scenario: [/canal-scenario/case/canal-case]
heartbeat: []
segmentItems:
- applicationCode: canal-scenario
- serviceName: canal-scenario
segmentSize: gt 1
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {cassandra-java-driver-3.x-scenario: 2}
instances:
- {cassandra-java-driver-3.x-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- cassandra-java-driver-3.x-scenario: [/cassandra-java-driver-3.x-scenario/case/cassandra]
heartbeat: []
segmentItems:
- applicationCode: cassandra-java-driver-3.x-scenario
- serviceName: cassandra-java-driver-3.x-scenario
segmentSize: ge 1
segments:
- segmentId: not null
......
......@@ -15,14 +15,14 @@
# limitations under the License.
registryItems:
applications:
services:
- {customize-scenario: nq 0}
instances:
- {customize-scenario: 1}
operationNames:
- customize-scenario: [/case/customize]
segmentItems:
- applicationCode: customize-scenario
- serviceName: customize-scenario
segmentSize: gt 1
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {dubbo-2.5.x-scenario: 2}
instances:
- {dubbo-2.5.x-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- dubbo-2.5.x-scenario: [/dubbo-2.5.x-scenario/case/dubbo, org.apache.skywalking.apm.testcase.dubbo.services.GreetService.doBusiness()]
heartbeat: []
segmentItems:
- applicationCode: dubbo-2.5.x-scenario
- serviceName: dubbo-2.5.x-scenario
segmentSize: ge 3
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {dubbo-2.7.x-scenario: 2}
instances:
- {dubbo-2.7.x-scenario: 1}
......@@ -23,7 +23,7 @@ registryItems:
org.apache.skywalking.apm.testcase.dubbo.services.GreetService.doBusiness()]
heartbeat: []
segmentItems:
- applicationCode: dubbo-2.7.x-scenario
- serviceName: dubbo-2.7.x-scenario
segmentSize: ge 3
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {ehcache-2.x-scenario: 2}
instances:
- {ehcache-2.x-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- ehcache-2.x-scenario: [/ehcache-2.x-scenario/case/ehcache]
heartbeat: []
segmentItems:
- applicationCode: ehcache-2.x-scenario
- serviceName: ehcache-2.x-scenario
segmentSize: ge 2
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {elasticsearch-5.x-scenario: nq 0}
instances:
- {elasticsearch-5.x-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- elasticsearch-5.x-scenario: [/case/elasticsearch]
heartbeat: []
segmentItems:
- applicationCode: elasticsearch-5.x-scenario
- serviceName: elasticsearch-5.x-scenario
segmentSize: ge 1
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {elasticsearch-6.x-scenario: nq 0}
instances:
- {elasticsearch-6.x-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- elasticsearch-6.x-scenario: [/elasticsearch-case/case/elasticsearch]
heartbeat: []
segmentItems:
- applicationCode: elasticsearch-6.x-scenario
- serviceName: elasticsearch-6.x-scenario
segmentSize: ge 1
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {elasticsearch-7.x-scenario: nq 0}
instances:
- {elasticsearch-7.x-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- elasticsearch-7.x-scenario: [/elasticsearch-case/case/elasticsearch]
heartbeat: []
segmentItems:
- applicationCode: elasticsearch-7.x-scenario
- serviceName: elasticsearch-7.x-scenario
segmentSize: ge 1
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {feign-scenario: nq 0}
instances:
- {feign-scenario: 1}
......@@ -23,7 +23,7 @@ registryItems:
/feign-scenario/case/feign-scenario, /feign-scenario/delete/1]
heartbeat: []
segmentItems:
- applicationCode: feign-scenario
- serviceName: feign-scenario
segmentSize: ge 1
segments:
- segmentId: not null
......
......@@ -15,7 +15,7 @@
# limitations under the License.
registryItems:
applications:
services:
- {gateway-projectB-scenario: nq 0}
- {gateway-projectA-scenario: nq 0}
instances:
......@@ -26,7 +26,7 @@ registryItems:
- gateway-projectA-scenario: [WEBFLUX.handle]
heartbeat: []
segmentItems:
- applicationCode: gateway-projectB-scenario
- serviceName: gateway-projectB-scenario
segmentSize: nq 0
segments:
- segmentId: not null
......@@ -52,7 +52,7 @@ segmentItems:
entryEndpointId: 0, refType: CrossProcess, parentSpanId: 0, parentTraceSegmentId: not null,
parentServiceInstanceId: not null, networkAddress: 'localhost:18070', entryEndpoint: WEBFLUX.handle,
entryServiceInstanceId: not null}
- applicationCode: gateway-projectA-scenario
- serviceName: gateway-projectA-scenario
segmentSize: nq 0
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- { grpc-scenario: 2 }
instances:
- { grpc-scenario: 1 }
......@@ -22,7 +22,7 @@ registryItems:
- grpc-scenario: [Greeter.sayHello, GreeterBlocking.sayHello, GreeterBlockingError.sayHello, /grpc-scenario/case/grpc-scenario]
heartbeat: []
segmentItems:
- applicationCode: grpc-scenario
- serviceName: grpc-scenario
segmentSize: gt 10
segments:
- segmentId: not null
......
......@@ -14,14 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {gson-scenario: nq 0}
instances:
- {gson-scenario: nq 0}
operationNames:
- gson-scenario: [/gson-scenario/case/gson-scenario]
segmentItems:
- applicationCode: gson-scenario
- serviceName: gson-scenario
segmentSize: ge 2
segments:
- segmentId: nq 0
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {h2-scenario: 2}
instances:
- {h2-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- h2-scenario: [/h2-scenario/case/h2-scenario]
heartbeat: []
segmentItems:
- applicationCode: h2-scenario
- serviceName: h2-scenario
segmentSize: gt 1
segments:
- segmentId: not null
......
......@@ -14,14 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {httpasyncclient-scenario: nq 0}
instances:
- {httpasyncclient-scenario: 1}
operationNames:
- httpasyncclient-scenario: [/httpasyncclient/case/httpasyncclient, /httpasyncclient/back]
segmentItems:
- applicationCode: httpasyncclient-scenario
- serviceName: httpasyncclient-scenario
segmentSize: ge 4
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {httpclient-3.x-scenario: 2}
instances:
- {httpclient-3.x-scenario: 1}
......@@ -23,7 +23,7 @@ registryItems:
/httpclient-3.x-scenario/case/context-propagate]
heartbeat: []
segmentItems:
- applicationCode: httpclient-3.x-scenario
- serviceName: httpclient-3.x-scenario
segmentSize: ge 3
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {httpclient-4.3.x-scenario: 2}
instances:
- {httpclient-4.3.x-scenario: 1}
......@@ -24,7 +24,7 @@ registryItems:
/httpclient-4.3.x-scenario/case/context-propagate]
heartbeat: []
segmentItems:
- applicationCode: httpclient-4.3.x-scenario
- serviceName: httpclient-4.3.x-scenario
segmentSize: ge 3
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {hystrix-scenario: 2}
instances:
- {hystrix-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- hystrix-scenario: [/case/hystrix-scenario]
heartbeat: []
segmentItems:
- applicationCode: hystrix-scenario
- serviceName: hystrix-scenario
segmentSize: ge 1
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {jdk-http-scenario: 2}
instances:
- {jdk-http-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- jdk-http-scenario: [/jdk-http-scenario/case/receiveContext-0, /jdk-http-scenario/case/jdk-http-scenario]
heartbeat: []
segmentItems:
- applicationCode: jdk-http-scenario
- serviceName: jdk-http-scenario
segmentSize: gt 2
segments:
- segmentId: not null
......
......@@ -15,7 +15,7 @@
# limitations under the License.
registryItems:
applications:
services:
- {jdk-threading-scenario: 2}
instances:
- {jdk-threading-scenario: 1}
......@@ -24,7 +24,7 @@ registryItems:
heartbeat: []
segmentItems:
- applicationCode: jdk-threading-scenario
- serviceName: jdk-threading-scenario
segmentSize: ge 4
segments:
- segmentId: not null
......
......@@ -15,7 +15,7 @@
# limitations under the License.
registryItems:
applications:
services:
- {jedis-scenario: 2}
instances:
- {jedis-scenario: 1}
......@@ -23,7 +23,7 @@ registryItems:
- jedis-scenario: [/jedis-scenario/case/jedis-scenario]
heartbeat: []
segmentItems:
- applicationCode: jedis-scenario
- serviceName: jedis-scenario
segmentSize: gt 1
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {jettyserver-scenario: nq 0}
- {jettyclient-scenario: nq 0}
instances:
......@@ -25,7 +25,7 @@ registryItems:
- jettyclient-scenario: [/jettyclient-case/case/jettyclient-case,
/jettyclient-case/case/healthCheck]
segmentItems:
- applicationCode: jettyserver-scenario
- serviceName: jettyserver-scenario
segmentSize: 1
segments:
- segmentId: not null
......@@ -48,7 +48,7 @@ segmentItems:
- {key: http.method, value: GET}
refs:
- {parentEndpointId: 0, parentEndpoint: /jettyclient-case/case/jettyclient-case, networkAddressId: 0, entryEndpointId: 0, refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: "${jettyclient-scenario[0]}", parentServiceInstanceId: nq 0, networkAddress: 'localhost:18080', entryEndpoint: /jettyclient-case/case/jettyclient-case, entryServiceInstanceId: nq 0 }
- applicationCode: jettyclient-scenario
- serviceName: jettyclient-scenario
segmentSize: 2
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {kafka-scenario: 2}
instances:
- {kafka-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- kafka-scenario: [Kafka/test/Consumer/testGroup, /case/kafka-case]
heartbeat: []
segmentItems:
- applicationCode: kafka-scenario
- serviceName: kafka-scenario
segmentSize: gt 3
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {kotlin-coroutine-scenario: 2}
instances:
- {kotlin-coroutine-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- kotlin-coroutine-scenario: [/kotlin-coroutine-scenario/case/h2]
heartbeat: []
segmentItems:
- applicationCode: kotlin-coroutine-scenario
- serviceName: kotlin-coroutine-scenario
segmentSize: gt 1
segments:
- segmentId: not null
......
......@@ -15,7 +15,7 @@
# limitations under the License.
registryItems:
applications:
services:
- {lettuce-scenario: 2}
instances:
- {lettuce-scenario: 1}
......@@ -23,7 +23,7 @@ registryItems:
- lettuce-scenario: [/lettuce-scenario/case/lettuce-case, /lettuce-scenario/case/healthCheck]
heartbeat: []
segmentItems:
- applicationCode: lettuce-scenario
- serviceName: lettuce-scenario
segmentSize: nq 0
segments:
- segmentId: not null
......
......@@ -15,7 +15,7 @@
# limitations under the License.
registryItems:
applications:
services:
- {mongodb-3.x-scenario: nq 0}
instances:
- {mongodb-3.x-scenario: 1}
......@@ -24,7 +24,7 @@ registryItems:
heartbeat: []
segmentItems:
- applicationCode: mongodb-3.x-scenario
- serviceName: mongodb-3.x-scenario
segmentSize: ge 2
segments:
- segmentId: not null
......
......@@ -14,14 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {mysql-scenario: nq 0}
instances:
- {mysql-scenario: 1}
operationNames:
- mysql-scenario: [/mysql-scenario/case/healthCheck, /mysql-scenario/case/mysql-scenario]
segmentItems:
- applicationCode: mysql-scenario
- serviceName: mysql-scenario
segmentSize: ge 2
segments:
- segmentId: not null
......
......@@ -15,7 +15,7 @@
# limitations under the License.
registryItems:
applications:
services:
- {netty-socketio-scenario: 2}
instances:
- {netty-socketio-scenario: 1}
......@@ -24,7 +24,7 @@ registryItems:
/netty-socketio-scenario/healthCheck, SocketIO/onConnect, SocketIO/send_data/receive]
heartbeat: []
segmentItems:
- applicationCode: netty-socketio-scenario
- serviceName: netty-socketio-scenario
segmentSize: ge 5
segments:
- segmentId: not null
......
......@@ -15,7 +15,7 @@
# limitations under the License.
registryItems:
applications:
services:
- {okhttp-scenario: nq 0}
instances:
- {okhttp-scenario: 1}
......@@ -23,7 +23,7 @@ registryItems:
- okhttp-scenario: [/case/receiveContext-0, /case/healthCheck, /case/okhttp-case, /case/receiveContext-1]
heartbeat: []
segmentItems:
- applicationCode: okhttp-scenario
- serviceName: okhttp-scenario
segmentSize: ge 5
segments:
- segmentId: not null
......
......@@ -14,14 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {oracle-scenario: nq 0}
instances:
- {oracle-scenario: 1}
operationNames:
- oracle-scenario: [/oracle-scenario/case/oracle]
segmentItems:
- applicationCode: oracle-scenario
- serviceName: oracle-scenario
segmentSize: ge 1
segments:
- segmentId: not null
......
......@@ -14,14 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {play-scenario: 2}
instances:
- {play-scenario: 1}
operationNames:
- play-scenario: ["/play-scenario/case/play-scenario/projects/{projectId}"]
segmentItems:
- applicationCode: play-scenario
- serviceName: play-scenario
segmentSize: gt 1
segments:
- segmentId: not null
......
......@@ -14,14 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {postgresql-above9.4.1207-scenario: nq 0}
instances:
- {postgresql-above9.4.1207-scenario: 1}
operationNames:
- postgresql-above9.4.1207-scenario: [/postgresql-scenario/case/postgres]
segmentItems:
- applicationCode: postgresql-above9.4.1207-scenario
- serviceName: postgresql-above9.4.1207-scenario
segmentSize: ge 1
segments:
- segmentId: not null
......
......@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
registryItems:
applications:
services:
- {postgresql-scenario: nq 0}
instances:
- {postgresql-scenario: 1}
......@@ -22,7 +22,7 @@ registryItems:
- postgresql-scenario: [/postgresql-scenario/case/postgres]
heartbeat: []
segmentItems:
- applicationCode: postgresql-scenario
- serviceName: postgresql-scenario
segmentSize: ge 1
segments:
- segmentId: not null
......
......@@ -15,14 +15,14 @@
# limitations under the License.
registryItems:
applications:
services:
- {pulsar-scenario: nq 0}
instances:
- {pulsar-scenario: nq 0}
operationNames:
- pulsar-scenario: [/case/pulsar-case, Pulsar/test/Consumer/test]
segmentItems:
- applicationCode: pulsar-scenario
- serviceName: pulsar-scenario
segmentSize: ge 3
segments:
- segmentId: not null
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册