Skip to content

Commit 8b0ffcc

Browse files
committed
Adding support for Apache Skywalking
1 parent a435231 commit 8b0ffcc

File tree

30 files changed

+4212
-0
lines changed

30 files changed

+4212
-0
lines changed

.gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,29 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
.DS_Store
132+
133+
# Compiled class file
134+
*.class
135+
136+
# Log file
137+
*.log
138+
139+
# BlueJ files
140+
*.ctxt
141+
142+
# Mobile Tools for Java (J2ME)
143+
.mtj.tmp/
144+
145+
# Package Files #
146+
*.jar
147+
*.war
148+
*.nar
149+
*.ear
150+
*.zip
151+
*.tar.gz
152+
*.rar
153+
154+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
155+
hs_err_pid*

core/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ In the container, you can generate and run ctests as shown below.
4848

4949
Run `./setup_ubuntu.sh` or `sudo ./setup_ubuntu.sh`.
5050

51+
For Apache Skywalking Project - Run `sudo ./setup_ubuntu_skywalking.sh`
52+
5153
### 2. Target Project
5254

5355
To generate ctests or run ctest, you need to first clone the target project.
@@ -61,6 +63,8 @@ To generate ctests or run ctest, you need to first clone the target project.
6163

6264
`<main project>` can be `hadoop`, `hbase`, `zookeeper` or `alluxio`.
6365

66+
For Apache Skywalking Project - Run `./add_project_skywalking.sh -r <skwywalking_release_version>`
67+
6468
## Usage
6569

6670
### 1. Generating Ctests

core/add_project_skywalking.sh

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
while getopts r: flag
4+
do
5+
case "${flag}" in
6+
r) version=${OPTARG};;
7+
esac
8+
done
9+
10+
if [ -z "$version" ]
11+
then
12+
echo "Usage : ./add_project_skywalking.sh -r <release_version>"
13+
exit
14+
fi
15+
16+
echo $version
17+
18+
rm -rf app/skywalking
19+
20+
mkdir -p app/skywalking
21+
22+
cd app/skywalking
23+
24+
wget https://dlcdn.apache.org/skywalking/$version/apache-skywalking-apm-$version-src.tgz
25+
26+
tar zxvf apache-skywalking-apm-$version-src.tgz
27+
28+
cd apache-skywalking-apm-$version
29+
30+
git apply ../../../patch/skywalking/skywalking.patch
31+
32+
cd oap-server
33+
34+
mvn clean install -DskipTests
35+
36+
cd ..
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
configuration.apollo.apolloEnv DEV Configure appolo environment
2+
services[1].duration 20000 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
3+
configuration.nacos.port 49317 Nacos Server Port
4+
configuration.zookeeper.hostPort localhost:49315 Zookeeper host port
5+
configuration.nacos.username nacos Nacos auth username
6+
configuration.nacos.port 49319 Nacos Server Port
7+
storage.mysql.metadataQueryMaxSize 5000 Metadata query max size
8+
configuration.apollo.period 1 Unit seconds sync period default fetch every 60 seconds
9+
configuration.nacos.period 2 Unit seconds sync period default fetch every 60 seconds
10+
configuration.nacos.accessKey Nacos auth accessKey
11+
configuration.consul.period 1 Sync period in seconds. Defaults to 60 seconds.
12+
configuration.etcd.period 1 Unit seconds sync period default fetch every 60 seconds
13+
configuration.zookeeper.maxRetries 3 max number of times to retry
14+
configuration.apollo.apolloCluster default Apollo cluster name
15+
configuration.zookeeper.hostPort localhost:49310 Zookeeper host port
16+
core.default.enableDataKeeperExecutor TRUE Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
17+
default.rate 10000 The sample rate precision is 1/10000. 10000 means 100% sample in default
18+
receiver-zipkin.default.restPort 9411 Port used by OAP to collect zipkin trace from HTTP
19+
services[1].name name1 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
20+
services[0].rate 2000 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
21+
MO-1.MO-1-P1.prop2 value2-prop Example configs
22+
MO-1.MO-1-P1.p1 value1 Example configs
23+
configuration.consul.hostAndPorts localhost:49296 Consul host and ports separated by comma eg 1.2.3.4:8500,2.3.4.5:8500
24+
configuration.zookeeper.namespace /default Zookeeper namespace
25+
configuration.nacos.secretKey Nacos auth accessKey
26+
configuration.apollo.appId SampleApp Apollo application id
27+
storage.mysql.properties.jdbcUrl jdbc:mysql://localhost:3306/swtest?rewriteBatchedStatements Mysql jdbc connection string
28+
configuration.nacos.serverAddr localhost Nacos Server Host
29+
configuration.etcd.endpoints http://127.0.0.1:49305 Etcd Server Host
30+
services[1].rate 1000 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
31+
configuration.nacos.group skywalking Nacos Configuration Group
32+
configuration.apollo.apolloMeta http://localhost:49284 Apollo host and port
33+
configuration.etcd.endpoints http://127.0.0.1:49302 Etcd Server Host
34+
services[0].name name2 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
35+
configuration.zookeeper.baseSleepTimeMs 1000 initial amount of time to wait between retries
36+
storage.mysql.properties.dataSource.password !AI!3B Mysql datasource password
37+
configuration.apollo.apolloMeta http://localhost:49287 Apollo host and port
38+
default.duration -1 The sample rate precision is 1/10000. 10000 means 100% sample in default
39+
configuration.consul.hostAndPorts localhost:49290 localhost:49296 Consul host and ports separated by comma eg 1.2.3.4:8500,2.3.4.5:8500
40+
receiver-zipkin.default.restHost 0.0.0.0 Host used by OAP to collect zipkin trace from HTTP
41+
configuration.nacos.namespace Nacos Configuration namespace
42+
configuration.nacos.password nacos Nacos auth username
43+
MO-1.MO-1-P1.p2 value2 Example configs
44+
services[0].duration 30000 The sample rate precision is 1/10000. 10000 means 100% sample in default. Setting this threshold about the latency would make the slow trace segments sampled if they cost more time, even the sampling mechanism activated. The default value is `-1`, which means would not sample slow traces. Unit, millisecond.
45+
configuration.zookeeper.period 1 Unit seconds sync period default fetch every 60 seconds
46+
configuration.etcd.namespace /skywalking/ Etcd Configuration Group
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"configuration.apollo.period": [
3+
"org.apache.skywalking.oap.server.configuration.apollo.ITApolloConfigurationTest#shouldReadUpdated",
4+
"org.apache.skywalking.oap.server.configuration.apollo.ITApolloConfigurationTest#shouldReadUpdated4Group"
5+
],
6+
"configuration.zookeeper.maxRetries": [
7+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
8+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
9+
],
10+
"configuration.zookeeper.period": [
11+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
12+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
13+
],
14+
"configuration.zookeeper.baseSleepTimeMs": [
15+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
16+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
17+
],
18+
"configuration.zookeeper.namespace": [
19+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
20+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
21+
],
22+
"services[1].rate": [
23+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
24+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
25+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
26+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
27+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
28+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
29+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
30+
],
31+
"services[0].duration": [
32+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
33+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
34+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
35+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
36+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
37+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
38+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
39+
],
40+
"default.duration": [
41+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
42+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
43+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
44+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
45+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
46+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
47+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
48+
],
49+
"services[0].rate": [
50+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
51+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
52+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
53+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
54+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
55+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
56+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
57+
],
58+
"default.rate": [
59+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
60+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
61+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
62+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
63+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
64+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
65+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
66+
],
67+
"services[1].duration": [
68+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateDynamicUpdate",
69+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdNotify",
70+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testStaticConfigInit",
71+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify",
72+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateDynamicUpdate",
73+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testServiceSampleRateNotify",
74+
"org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testTraceLatencyThresholdDynamicUpdate"
75+
],
76+
"configuration.nacos.port": [
77+
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdatedGroup",
78+
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdated"
79+
],
80+
"configuration.nacos.group": [
81+
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdatedGroup",
82+
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdated"
83+
],
84+
"configuration.nacos.period": [
85+
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdatedGroup",
86+
"org.apache.skywalking.oap.server.configuration.nacos.ITNacosConfigurationTest#shouldReadUpdated"
87+
],
88+
"configuration.etcd.period": [
89+
"org.apache.skywalking.oap.server.configuration.etcd.ITEtcdConfigurationTest#shouldReadUpdated",
90+
"org.apache.skywalking.oap.server.configuration.etcd.ITEtcdConfigurationTest#shouldReadUpdated4Group"
91+
],
92+
"configuration.etcd.namespace": [
93+
"org.apache.skywalking.oap.server.configuration.etcd.ITEtcdConfigurationTest#shouldReadUpdated",
94+
"org.apache.skywalking.oap.server.configuration.etcd.ITEtcdConfigurationTest#shouldReadUpdated4Group"
95+
],
96+
"configuration.consul.period": [
97+
"org.apache.skywalking.oap.server.configuration.consul.ITConsulConfigurationTest#shouldReadUpdated",
98+
"org.apache.skywalking.oap.server.configuration.consul.ITConsulConfigurationTest#shouldReadUpdated4Group"
99+
]
100+
}
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Generating Parameter Sets for Apache Skywalking
2+
3+
**generate_ctest is used to automatically generate ctests**
4+
5+
```shell
6+
# Switch to the generate_ctest/skywalking directory
7+
cd <openctest dir>/core/generate_ctest/skywalking
8+
9+
# Build the project to generate the target/ctest-runner-1.0-SNAPSHOT-jar-with-dependencies.jar
10+
mvn clean package
11+
12+
# Switch to the instrumented apache skywalking directory
13+
cd /home/skywalking
14+
15+
# Run the jar by providing the following inputs
16+
# 1. temp directory which will contain the files needed for this run
17+
# 2. File test-to-config-flat.txt from the execution of the core/identify_param/skywalking step
18+
# 3. File skywalking-generated-values.tsv from the execution of the core/generate_value step
19+
# 4. Result directory which will contain the results of the execution
20+
java -jar <openctest dir>/core/generate_ctest/skywalking/target/ctest-runner-1.0-SNAPSHOT-jar-with-dependencies.jar <dir>/tmp <dir>/test-to-config-flat.txt <dir>/skywalking-generated-values.tsv <dir>/resultDir
21+
```
22+
23+
## Results
24+
25+
2 files are generated as a result of this run
26+
27+
1. Generates the `core/generate_ctest/ctest_mapping/ctests-skywalking.json` file
28+
```json
29+
{
30+
"configuration.apollo.period": [
31+
"org.apache.skywalking.oap.server.configuration.apollo.ITApolloConfigurationTest#shouldReadUpdated",
32+
"org.apache.skywalking.oap.server.configuration.apollo.ITApolloConfigurationTest#shouldReadUpdated4Group"
33+
],
34+
"configuration.zookeeper.maxRetries": [
35+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
36+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
37+
],
38+
"configuration.zookeeper.period": [
39+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated",
40+
"org.apache.skywalking.oap.server.configuration.zookeeper.it.ITZookeeperConfigurationTest#shouldReadUpdated4GroupConfig"
41+
]...
42+
}
43+
44+
```
45+
46+
2. Execution results for each case in the tab separated format
47+
48+
Param Test Value p/f Time_in_ns
49+
```json
50+
services[0].duration org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify 15000 p 9188519779
51+
services[0].duration org.apache.skywalking.oap.server.analyzer.provider.trace.TraceSamplingPolicyWatcherTest#testDefaultSampleRateNotify 60000 p 9179170267
52+
```
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>org.uiuc</groupId>
8+
<artifactId>ctest-runner</artifactId>
9+
<version>1.0-SNAPSHOT</version>
10+
11+
<properties>
12+
<maven.compiler.source>8</maven.compiler.source>
13+
<maven.compiler.target>8</maven.compiler.target>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>org.apache.maven.shared</groupId>
20+
<artifactId>maven-invoker</artifactId>
21+
<version>3.2.0</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>com.google.code.gson</groupId>
25+
<artifactId>gson</artifactId>
26+
<version>2.9.1</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>com.anubhavshukla</groupId>
30+
<artifactId>properties-to-yaml-converter</artifactId>
31+
<version>1.0.1</version>
32+
</dependency>
33+
</dependencies>
34+
35+
<build>
36+
<plugins>
37+
<plugin>
38+
<artifactId>maven-assembly-plugin</artifactId>
39+
<configuration>
40+
<archive>
41+
<manifest>
42+
<mainClass>org.uiuc.Main</mainClass>
43+
</manifest>
44+
</archive>
45+
<descriptorRefs>
46+
<descriptorRef>jar-with-dependencies</descriptorRef>
47+
</descriptorRefs>
48+
</configuration>
49+
<executions>
50+
<execution>
51+
<id>make-assembly</id> <!-- this is used for inheritance merges -->
52+
<phase>package</phase> <!-- bind to the packaging phase -->
53+
<goals>
54+
<goal>single</goal>
55+
</goals>
56+
</execution>
57+
</executions>
58+
</plugin>
59+
</plugins>
60+
</build>
61+
62+
</project>

0 commit comments

Comments
 (0)