Skip to content

Commit 6b9ef38

Browse files
authored
Merge branch 'master' into master
2 parents f74ea2f + 329e53c commit 6b9ef38

File tree

9 files changed

+138
-4
lines changed

9 files changed

+138
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDU
6464
[Open Skywalking Organization Teams and Contributors](https://github.com/OpenSkywalking/Organization/blob/master/README.md)
6565

6666
# Partners
67-
<img src="https://skywalkingtest.github.io/page-resources/3.2.3/partners.png" width="600"/>
67+
<img src="https://skywalkingtest.github.io/page-resources/3.2.4/partners.png" width="800"/>
6868

6969
# License
7070
[Apache 2.0 License.](/LICENSE)

README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDU
6868
[Open Skywalking Organization Teams and Contributors](https://github.com/OpenSkywalking/Organization/blob/master/README.md)
6969

7070
# Partners
71-
<img src="https://skywalkingtest.github.io/page-resources/3.2.3/partners.png" width="600"/>
71+
<img src="https://skywalkingtest.github.io/page-resources/3.2.4/partners.png" width="800"/>
7272

7373
# License
7474
[Apache 2.0 License.](/LICENSE)

apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/component/NodeComponentSpanListener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public void parseExit(SpanDecorator spanDecorator, int applicationId, int applic
6060
}
6161

6262
nodeComponent.setPeerId(spanDecorator.getPeerId());
63+
nodeComponent.setPeer(Const.EMPTY_STRING);
6364
id = id + Const.ID_SPLIT + nodeComponent.getPeerId();
6465
nodeComponent.setId(id);
6566
nodeComponents.add(nodeComponent);
@@ -81,6 +82,7 @@ public void parseEntry(SpanDecorator spanDecorator, int applicationId, int appli
8182
}
8283

8384
nodeComponent.setPeerId(applicationId);
85+
nodeComponent.setPeer(Const.EMPTY_STRING);
8486
id = id + Const.ID_SPLIT + String.valueOf(applicationId);
8587
nodeComponent.setId(id);
8688

apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/node/mapping/NodeMappingSpanListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class NodeMappingSpanListener implements RefsListener, FirstSpanListener
5151
NodeMappingDataDefine.NodeMapping nodeMapping = new NodeMappingDataDefine.NodeMapping();
5252
nodeMapping.setApplicationId(applicationId);
5353
nodeMapping.setAddressId(referenceDecorator.getNetworkAddressId());
54+
nodeMapping.setAddress(Const.EMPTY_STRING);
5455
String id = String.valueOf(applicationId) + Const.ID_SPLIT + String.valueOf(nodeMapping.getAddressId());
5556
nodeMapping.setId(id);
5657
nodeMappings.add(nodeMapping);

apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/noderef/NodeReferenceSpanListener.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public void parseExit(SpanDecorator spanDecorator, int applicationId, int applic
5353
NodeReferenceDataDefine.NodeReference nodeReference = new NodeReferenceDataDefine.NodeReference();
5454
nodeReference.setFrontApplicationId(applicationId);
5555
nodeReference.setBehindApplicationId(spanDecorator.getPeerId());
56+
nodeReference.setBehindPeer(Const.EMPTY_STRING);
5657
nodeReference.setTimeBucket(TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime()));
5758

5859
StringBuilder idBuilder = new StringBuilder();
@@ -79,6 +80,7 @@ public void parseEntry(SpanDecorator spanDecorator, int applicationId, int appli
7980
NodeReferenceDataDefine.NodeReference nodeReference = new NodeReferenceDataDefine.NodeReference();
8081
nodeReference.setFrontApplicationId(Const.USER_ID);
8182
nodeReference.setBehindApplicationId(applicationId);
83+
nodeReference.setBehindPeer(Const.EMPTY_STRING);
8284
nodeReference.setTimeBucket(TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime()));
8385

8486
String idBuilder = String.valueOf(nodeReference.getTimeBucket()) + Const.ID_SPLIT + nodeReference.getFrontApplicationId() +
@@ -96,6 +98,7 @@ public void parseEntry(SpanDecorator spanDecorator, int applicationId, int appli
9698
NodeReferenceDataDefine.NodeReference referenceSum = new NodeReferenceDataDefine.NodeReference();
9799
referenceSum.setFrontApplicationId(parentApplicationId);
98100
referenceSum.setBehindApplicationId(applicationId);
101+
referenceSum.setBehindPeer(Const.EMPTY_STRING);
99102
references.add(referenceSum);
100103
}
101104

apm-collector/apm-collector-agentstream/src/main/java/org/skywalking/apm/collector/agentstream/worker/serviceref/ServiceReferenceSpanListener.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,15 @@ private void sendToAggregationWorker(StreamModuleContext context,
127127

128128
idBuilder.append(entryServiceId).append(Const.ID_SPLIT);
129129
serviceReference.setEntryServiceId(entryServiceId);
130+
serviceReference.setEntryServiceName(Const.EMPTY_STRING);
130131

131132
idBuilder.append(frontServiceId).append(Const.ID_SPLIT);
132133
serviceReference.setFrontServiceId(frontServiceId);
134+
serviceReference.setFrontServiceName(Const.EMPTY_STRING);
133135

134136
idBuilder.append(behindServiceId);
135137
serviceReference.setBehindServiceId(behindServiceId);
138+
serviceReference.setBehindServiceName(Const.EMPTY_STRING);
136139

137140
serviceReference.setId(idBuilder.toString());
138141
serviceReference.setTimeBucket(timeBucket);

apm-sniffer/apm-sdk-plugin/postgresql-8.x-plugin/src/main/java/org/skywalking/apm/plugin/jdbc/postgresql/define/Jdbc3ConnectionInstrumentation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS;
4242

4343
/**
44-
* {@link ConnectionInstrumentation} intercept the following methods that the class which extend {@link
45-
* org.postgresql.jdbc.PgConnection}. <br/>
44+
* {@link Jdbc3ConnectionInstrumentation} intercept the following methods that the class which extend {@link
45+
* org.postgresql.jdbc3.Jdbc3Connection}. <br/>
4646
*
4747
* 1. Enhance <code>prepareStatement</code> by <code>org.skywalking.apm.plugin.jdbc.define.JDBCPrepareStatementInterceptor</code>
4848
* 2. Enhance <code>prepareCall</code> by
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
/*
2+
* Copyright 2017, OpenSkywalking Organization All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
* Project repository: https://github.com/OpenSkywalking/skywalking
17+
*/
18+
19+
package org.skywalking.apm.plugin.jdbc.postgresql.define;
20+
21+
import net.bytebuddy.description.method.MethodDescription;
22+
import net.bytebuddy.matcher.ElementMatcher;
23+
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
24+
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
25+
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
26+
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
27+
28+
import static net.bytebuddy.matcher.ElementMatchers.named;
29+
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
30+
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
31+
import static org.skywalking.apm.plugin.jdbc.define.Constants.CLOSE_METHOD_NAME;
32+
import static org.skywalking.apm.plugin.jdbc.define.Constants.COMMIT_METHOD_NAME;
33+
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_INTERCEPT_CLASS;
34+
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_METHOD_NAME;
35+
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_INTERCEPT_CLASS;
36+
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_METHOD_NAME;
37+
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_INTERCEPT_CLASS;
38+
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_METHOD_NAME;
39+
import static org.skywalking.apm.plugin.jdbc.define.Constants.RELEASE_SAVE_POINT_METHOD_NAME;
40+
import static org.skywalking.apm.plugin.jdbc.define.Constants.ROLLBACK_METHOD_NAME;
41+
import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS;
42+
43+
/**
44+
* {@link Jdbc4ConnectionInstrumentation} intercept the following methods that the class which extend {@link
45+
* org.postgresql.jdbc4.Jdbc4Connection}. <br/>
46+
*
47+
* 1. Enhance <code>prepareStatement</code> by <code>org.skywalking.apm.plugin.jdbc.define.JDBCPrepareStatementInterceptor</code>
48+
* 2. Enhance <code>prepareCall</code> by
49+
* <code>org.skywalking.apm.plugin.jdbc.define.JDBCPrepareCallInterceptor</code>
50+
* 3. Enhance <code>createStatement</code>
51+
* by <code>org.skywalking.apm.plugin.jdbc.define.JDBCStatementInterceptor</code>
52+
* 4. Enhance <code>commit, rollback, close, releaseSavepoint</code> by <code>org.skywalking.apm.plugin.jdbc.define.ConnectionServiceMethodInterceptor</code>
53+
*
54+
* @author zhangxin
55+
*/
56+
public class Jdbc4ConnectionInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
57+
58+
public static final String ENHANCE_CLASS = "org.postgresql.jdbc4.Jdbc4Connection";
59+
60+
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
61+
return new ConstructorInterceptPoint[0];
62+
}
63+
64+
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
65+
return new InstanceMethodsInterceptPoint[] {
66+
new InstanceMethodsInterceptPoint() {
67+
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
68+
return named(PREPARE_STATEMENT_METHOD_NAME).and(takesArguments(4));
69+
}
70+
71+
@Override public String getMethodsInterceptor() {
72+
return PREPARE_STATEMENT_INTERCEPT_CLASS;
73+
}
74+
75+
@Override public boolean isOverrideArgs() {
76+
return false;
77+
}
78+
},
79+
new InstanceMethodsInterceptPoint() {
80+
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
81+
return named(PREPARE_CALL_METHOD_NAME).and(takesArguments(4));
82+
}
83+
84+
@Override public String getMethodsInterceptor() {
85+
return PREPARE_CALL_INTERCEPT_CLASS;
86+
}
87+
88+
@Override public boolean isOverrideArgs() {
89+
return false;
90+
}
91+
},
92+
new InstanceMethodsInterceptPoint() {
93+
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
94+
return named(CREATE_STATEMENT_METHOD_NAME).and(takesArguments(3));
95+
}
96+
97+
@Override public String getMethodsInterceptor() {
98+
return CREATE_STATEMENT_INTERCEPT_CLASS;
99+
}
100+
101+
@Override public boolean isOverrideArgs() {
102+
return false;
103+
}
104+
},
105+
new InstanceMethodsInterceptPoint() {
106+
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
107+
return named(COMMIT_METHOD_NAME).or(named(ROLLBACK_METHOD_NAME)).or(named(CLOSE_METHOD_NAME)).or(named(RELEASE_SAVE_POINT_METHOD_NAME));
108+
}
109+
110+
@Override public String getMethodsInterceptor() {
111+
return SERVICE_METHOD_INTERCEPT_CLASS;
112+
}
113+
114+
@Override public boolean isOverrideArgs() {
115+
return false;
116+
}
117+
}
118+
};
119+
}
120+
121+
@Override protected ClassMatch enhanceClass() {
122+
return byName(ENHANCE_CLASS);
123+
}
124+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.DriverInstrumentation
22
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.Jdbc3ConnectionInstrumentation
3+
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.Jdbc4ConnectionInstrumentation
34
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.ConnectionInstrumentation

0 commit comments

Comments
 (0)