Merge branch 'master' into feature/collector-modelization
* master: Update version for 3.2.4 release. add exception handler for disruptorQueue support jdbc4 api of postgresql support for logback MDC AgentStream NullPointerException with RemoteWorker
This commit is contained in:
commit
1e0e052496
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-application-toolkit</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-application-toolkit</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-application-toolkit</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* 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.skywalking.apm.toolkit.log.logback.v1.x.mdc;
|
||||
|
||||
import ch.qos.logback.classic.pattern.MDCConverter;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.util.OptionHelper;
|
||||
|
||||
/**
|
||||
* @author zhangkewei
|
||||
*/
|
||||
public class LogbackMDCPatternConverter extends MDCConverter {
|
||||
private static final String CONVERT_KEY = "tid";
|
||||
|
||||
private boolean convert4TID = false;
|
||||
@Override
|
||||
public void start() {
|
||||
super.start();
|
||||
String[] key = OptionHelper.extractDefaultReplacement(getFirstOption());
|
||||
if (null != key && key.length > 0 && CONVERT_KEY.equals(key[0])) {
|
||||
convert4TID = true;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String convert(ILoggingEvent iLoggingEvent) {
|
||||
return convert4TID ? convertTID() : super.convert(iLoggingEvent);
|
||||
}
|
||||
|
||||
public String convertTID() {
|
||||
return "TID: N/A";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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.skywalking.apm.toolkit.log.logback.v1.x.mdc;
|
||||
|
||||
import ch.qos.logback.classic.PatternLayout;
|
||||
|
||||
/**
|
||||
* Override "X",SuperClass run before Subclass.
|
||||
* @author zhangkewei
|
||||
*/
|
||||
public class TraceIdMDCPatternLogbackLayout extends PatternLayout {
|
||||
static {
|
||||
defaultConverterMap.put("X", LogbackMDCPatternConverter.class.getName());
|
||||
}
|
||||
}
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-application-toolkit</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-application-toolkit</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>apm-application-toolkit</artifactId>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector-3.2.3</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector-3.2.3</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ public class NodeComponentSpanListener implements EntrySpanListener, ExitSpanLis
|
|||
}
|
||||
|
||||
nodeComponent.setPeerId(spanDecorator.getPeerId());
|
||||
nodeComponent.setPeer(Const.EMPTY_STRING);
|
||||
id = id + Const.ID_SPLIT + nodeComponent.getPeerId();
|
||||
nodeComponent.setId(id);
|
||||
nodeComponents.add(nodeComponent);
|
||||
|
|
@ -81,6 +82,7 @@ public class NodeComponentSpanListener implements EntrySpanListener, ExitSpanLis
|
|||
}
|
||||
|
||||
nodeComponent.setPeerId(applicationId);
|
||||
nodeComponent.setPeer(Const.EMPTY_STRING);
|
||||
id = id + Const.ID_SPLIT + String.valueOf(applicationId);
|
||||
nodeComponent.setId(id);
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public class NodeMappingSpanListener implements RefsListener, FirstSpanListener
|
|||
NodeMappingDataDefine.NodeMapping nodeMapping = new NodeMappingDataDefine.NodeMapping();
|
||||
nodeMapping.setApplicationId(applicationId);
|
||||
nodeMapping.setAddressId(referenceDecorator.getNetworkAddressId());
|
||||
nodeMapping.setAddress(Const.EMPTY_STRING);
|
||||
String id = String.valueOf(applicationId) + Const.ID_SPLIT + String.valueOf(nodeMapping.getAddressId());
|
||||
nodeMapping.setId(id);
|
||||
nodeMappings.add(nodeMapping);
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ public class NodeReferenceSpanListener implements EntrySpanListener, ExitSpanLis
|
|||
NodeReferenceDataDefine.NodeReference nodeReference = new NodeReferenceDataDefine.NodeReference();
|
||||
nodeReference.setFrontApplicationId(applicationId);
|
||||
nodeReference.setBehindApplicationId(spanDecorator.getPeerId());
|
||||
nodeReference.setBehindPeer(Const.EMPTY_STRING);
|
||||
nodeReference.setTimeBucket(TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime()));
|
||||
|
||||
StringBuilder idBuilder = new StringBuilder();
|
||||
|
|
@ -79,6 +80,7 @@ public class NodeReferenceSpanListener implements EntrySpanListener, ExitSpanLis
|
|||
NodeReferenceDataDefine.NodeReference nodeReference = new NodeReferenceDataDefine.NodeReference();
|
||||
nodeReference.setFrontApplicationId(Const.USER_ID);
|
||||
nodeReference.setBehindApplicationId(applicationId);
|
||||
nodeReference.setBehindPeer(Const.EMPTY_STRING);
|
||||
nodeReference.setTimeBucket(TimeBucketUtils.INSTANCE.getMinuteTimeBucket(spanDecorator.getStartTime()));
|
||||
|
||||
String idBuilder = String.valueOf(nodeReference.getTimeBucket()) + Const.ID_SPLIT + nodeReference.getFrontApplicationId() +
|
||||
|
|
@ -96,6 +98,7 @@ public class NodeReferenceSpanListener implements EntrySpanListener, ExitSpanLis
|
|||
NodeReferenceDataDefine.NodeReference referenceSum = new NodeReferenceDataDefine.NodeReference();
|
||||
referenceSum.setFrontApplicationId(parentApplicationId);
|
||||
referenceSum.setBehindApplicationId(applicationId);
|
||||
referenceSum.setBehindPeer(Const.EMPTY_STRING);
|
||||
references.add(referenceSum);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,12 +127,15 @@ public class ServiceReferenceSpanListener implements FirstSpanListener, EntrySpa
|
|||
|
||||
idBuilder.append(entryServiceId).append(Const.ID_SPLIT);
|
||||
serviceReference.setEntryServiceId(entryServiceId);
|
||||
serviceReference.setEntryServiceName(Const.EMPTY_STRING);
|
||||
|
||||
idBuilder.append(frontServiceId).append(Const.ID_SPLIT);
|
||||
serviceReference.setFrontServiceId(frontServiceId);
|
||||
serviceReference.setFrontServiceName(Const.EMPTY_STRING);
|
||||
|
||||
idBuilder.append(behindServiceId);
|
||||
serviceReference.setBehindServiceId(behindServiceId);
|
||||
serviceReference.setBehindServiceName(Const.EMPTY_STRING);
|
||||
|
||||
serviceReference.setId(idBuilder.toString());
|
||||
serviceReference.setTimeBucket(timeBucket);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector-3.2.3</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
package org.skywalking.apm.collector.queue.disruptor;
|
||||
|
||||
import com.lmax.disruptor.ExceptionHandler;
|
||||
import com.lmax.disruptor.RingBuffer;
|
||||
import com.lmax.disruptor.dsl.Disruptor;
|
||||
import org.skywalking.apm.collector.core.queue.DaemonThreadFactory;
|
||||
|
|
@ -25,12 +26,16 @@ import org.skywalking.apm.collector.core.queue.MessageHolder;
|
|||
import org.skywalking.apm.collector.core.queue.QueueCreator;
|
||||
import org.skywalking.apm.collector.core.queue.QueueEventHandler;
|
||||
import org.skywalking.apm.collector.core.queue.QueueExecutor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author peng-yongsheng
|
||||
*/
|
||||
public class DisruptorQueueCreator implements QueueCreator {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(DisruptorQueueCreator.class);
|
||||
|
||||
@Override public QueueEventHandler create(int queueSize, QueueExecutor executor) {
|
||||
// Specify the size of the ring buffer, must be power of 2.
|
||||
if (!((((queueSize - 1) & queueSize) == 0) && queueSize != 0)) {
|
||||
|
|
@ -40,6 +45,20 @@ public class DisruptorQueueCreator implements QueueCreator {
|
|||
// Construct the Disruptor
|
||||
Disruptor<MessageHolder> disruptor = new Disruptor(MessageHolderFactory.INSTANCE, queueSize, DaemonThreadFactory.INSTANCE);
|
||||
|
||||
disruptor.setDefaultExceptionHandler(new ExceptionHandler<MessageHolder>() {
|
||||
@Override public void handleEventException(Throwable ex, long sequence, MessageHolder event) {
|
||||
logger.error("handler message error! message: {}.", event.getMessage(), ex);
|
||||
}
|
||||
|
||||
@Override public void handleOnStartException(Throwable ex) {
|
||||
logger.error("create disruptor failed!", ex);
|
||||
}
|
||||
|
||||
@Override public void handleOnShutdownException(Throwable ex) {
|
||||
logger.error("shutdown disruptor failed!", ex);
|
||||
}
|
||||
});
|
||||
|
||||
RingBuffer<MessageHolder> ringBuffer = disruptor.getRingBuffer();
|
||||
DisruptorEventHandler eventHandler = new DisruptorEventHandler(ringBuffer, executor);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector-3.2.3</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector-3.2.3</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
@ -24,4 +24,4 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector-ui</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-collector</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-commons</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-commons</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sniffer</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-agent-core</artifactId>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sniffer</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-agent</artifactId>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-grpc-1.x-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-httpClient-4.x-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-jedis-2.x-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>jetty-plugins</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>jetty-plugins</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>jetty-plugins</artifactId>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-mongodb-3.x-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>nutz-plugins</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>nutz-plugins</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>nutz-plugins</artifactId>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sniffer</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ import static org.skywalking.apm.plugin.jdbc.define.Constants.ROLLBACK_METHOD_NA
|
|||
import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS;
|
||||
|
||||
/**
|
||||
* {@link ConnectionInstrumentation} intercept the following methods that the class which extend {@link
|
||||
* org.postgresql.jdbc.PgConnection}. <br/>
|
||||
* {@link Jdbc3ConnectionInstrumentation} intercept the following methods that the class which extend {@link
|
||||
* org.postgresql.jdbc3.Jdbc3Connection}. <br/>
|
||||
*
|
||||
* 1. Enhance <code>prepareStatement</code> by <code>org.skywalking.apm.plugin.jdbc.define.JDBCPrepareStatementInterceptor</code>
|
||||
* 2. Enhance <code>prepareCall</code> by
|
||||
|
|
|
|||
|
|
@ -0,0 +1,124 @@
|
|||
/*
|
||||
* 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.skywalking.apm.plugin.jdbc.postgresql.define;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
|
||||
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.CLOSE_METHOD_NAME;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.COMMIT_METHOD_NAME;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_INTERCEPT_CLASS;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.CREATE_STATEMENT_METHOD_NAME;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_INTERCEPT_CLASS;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_CALL_METHOD_NAME;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_INTERCEPT_CLASS;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.PREPARE_STATEMENT_METHOD_NAME;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.RELEASE_SAVE_POINT_METHOD_NAME;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.ROLLBACK_METHOD_NAME;
|
||||
import static org.skywalking.apm.plugin.jdbc.define.Constants.SERVICE_METHOD_INTERCEPT_CLASS;
|
||||
|
||||
/**
|
||||
* {@link Jdbc4ConnectionInstrumentation} intercept the following methods that the class which extend {@link
|
||||
* org.postgresql.jdbc4.Jdbc4Connection}. <br/>
|
||||
*
|
||||
* 1. Enhance <code>prepareStatement</code> by <code>org.skywalking.apm.plugin.jdbc.define.JDBCPrepareStatementInterceptor</code>
|
||||
* 2. Enhance <code>prepareCall</code> by
|
||||
* <code>org.skywalking.apm.plugin.jdbc.define.JDBCPrepareCallInterceptor</code>
|
||||
* 3. Enhance <code>createStatement</code>
|
||||
* by <code>org.skywalking.apm.plugin.jdbc.define.JDBCStatementInterceptor</code>
|
||||
* 4. Enhance <code>commit, rollback, close, releaseSavepoint</code> by <code>org.skywalking.apm.plugin.jdbc.define.ConnectionServiceMethodInterceptor</code>
|
||||
*
|
||||
* @author zhangxin
|
||||
*/
|
||||
public class Jdbc4ConnectionInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
public static final String ENHANCE_CLASS = "org.postgresql.jdbc4.Jdbc4Connection";
|
||||
|
||||
@Override protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return new ConstructorInterceptPoint[0];
|
||||
}
|
||||
|
||||
@Override protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[] {
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named(PREPARE_STATEMENT_METHOD_NAME).and(takesArguments(4));
|
||||
}
|
||||
|
||||
@Override public String getMethodsInterceptor() {
|
||||
return PREPARE_STATEMENT_INTERCEPT_CLASS;
|
||||
}
|
||||
|
||||
@Override public boolean isOverrideArgs() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named(PREPARE_CALL_METHOD_NAME).and(takesArguments(4));
|
||||
}
|
||||
|
||||
@Override public String getMethodsInterceptor() {
|
||||
return PREPARE_CALL_INTERCEPT_CLASS;
|
||||
}
|
||||
|
||||
@Override public boolean isOverrideArgs() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named(CREATE_STATEMENT_METHOD_NAME).and(takesArguments(3));
|
||||
}
|
||||
|
||||
@Override public String getMethodsInterceptor() {
|
||||
return CREATE_STATEMENT_INTERCEPT_CLASS;
|
||||
}
|
||||
|
||||
@Override public boolean isOverrideArgs() {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named(COMMIT_METHOD_NAME).or(named(ROLLBACK_METHOD_NAME)).or(named(CLOSE_METHOD_NAME)).or(named(RELEASE_SAVE_POINT_METHOD_NAME));
|
||||
}
|
||||
|
||||
@Override public String getMethodsInterceptor() {
|
||||
return SERVICE_METHOD_INTERCEPT_CLASS;
|
||||
}
|
||||
|
||||
@Override public boolean isOverrideArgs() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override protected ClassMatch enhanceClass() {
|
||||
return byName(ENHANCE_CLASS);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.DriverInstrumentation
|
||||
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.Jdbc3ConnectionInstrumentation
|
||||
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.Jdbc4ConnectionInstrumentation
|
||||
postgresql-8.x=org.skywalking.apm.plugin.jdbc.postgresql.define.ConnectionInstrumentation
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-resin-3.x-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-resin-4.x-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>spring-plugins</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>spring-plugins</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>spring-plugins</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-plugins</artifactId>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>spring-plugins</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>spring-cloud</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>netflix-plugins</artifactId>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>netflix-plugins</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-spring-cloud-feign-1.x-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>spring-plugins</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud</artifactId>
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-spymemcached-2.x-plugin</artifactId>
|
||||
|
|
@ -50,4 +50,4 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sdk-plugin</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-xmemcached-2.x-plugin</artifactId>
|
||||
|
|
@ -49,4 +49,4 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<artifactId>apm-sniffer</artifactId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>apm-test-tools</artifactId>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-toolkit-activation</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-toolkit-activation</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-toolkit-activation</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* 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.skywalking.apm.toolkit.activation.log.logback.v1.x.mdc;
|
||||
|
||||
import net.bytebuddy.description.method.MethodDescription;
|
||||
import net.bytebuddy.matcher.ElementMatcher;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.ConstructorInterceptPoint;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.InstanceMethodsInterceptPoint;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.ClassInstanceMethodsEnhancePluginDefine;
|
||||
import org.skywalking.apm.agent.core.plugin.match.ClassMatch;
|
||||
|
||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||
import static org.skywalking.apm.agent.core.plugin.match.NameMatch.byName;
|
||||
|
||||
/**
|
||||
* Support MDC https://logback.qos.ch/manual/mdc.html
|
||||
* @author: zhangkewei
|
||||
*/
|
||||
public class MDCConverterActivation extends ClassInstanceMethodsEnhancePluginDefine {
|
||||
|
||||
@Override
|
||||
protected ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
|
||||
return new InstanceMethodsInterceptPoint[] {
|
||||
new InstanceMethodsInterceptPoint() {
|
||||
@Override
|
||||
public ElementMatcher<MethodDescription> getMethodsMatcher() {
|
||||
return named("convertTID");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodsInterceptor() {
|
||||
return "org.skywalking.apm.toolkit.activation.log.logback.v1.x.mdc.PrintMDCTraceIdInterceptor";
|
||||
}
|
||||
|
||||
@Override public boolean isOverrideArgs() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ClassMatch enhanceClass() {
|
||||
return byName("org.skywalking.apm.toolkit.log.logback.v1.x.mdc.LogbackMDCPatternConverter");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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.skywalking.apm.toolkit.activation.log.logback.v1.x.mdc;
|
||||
|
||||
import org.skywalking.apm.agent.core.context.ContextManager;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor;
|
||||
import org.skywalking.apm.agent.core.plugin.interceptor.enhance.MethodInterceptResult;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* @author zhangkewei
|
||||
*/
|
||||
public class PrintMDCTraceIdInterceptor implements InstanceMethodsAroundInterceptor {
|
||||
@Override public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
|
||||
|
||||
}
|
||||
|
||||
@Override public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, Object ret) throws Throwable {
|
||||
return "TID:" + ContextManager.getGlobalTraceId();
|
||||
}
|
||||
|
||||
@Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments,
|
||||
Class<?>[] argumentsTypes, Throwable t) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +1,2 @@
|
|||
toolkit-logback=org.skywalking.apm.toolkit.activation.log.logback.v1.x.LogbackPatternConverterActivation
|
||||
toolkit-logback=org.skywalking.apm.toolkit.activation.log.logback.v1.x.mdc.MDCConverterActivation
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-toolkit-activation</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-toolkit-activation</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm-sniffer</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>apm</artifactId>
|
||||
<groupId>org.skywalking</groupId>
|
||||
<version>3.2.3-2017</version>
|
||||
<version>3.2.4-2017</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
version: '2.1'
|
||||
services:
|
||||
skywalking-webui:
|
||||
image: skywalking/skywalking-ui:3.2.3-2017
|
||||
image: skywalking/skywalking-ui:3.2.4-2017
|
||||
expose:
|
||||
- "8080"
|
||||
ports:
|
||||
|
|
@ -15,7 +15,7 @@ services:
|
|||
- COLLECTOR_SERVERS=skywalking-collector:10800
|
||||
|
||||
skywalking-collector:
|
||||
image: skywalking/skywalking-collector:3.2.3-2017
|
||||
image: skywalking/skywalking-collector:3.2.4-2017
|
||||
expose:
|
||||
- "10800"
|
||||
- "11800"
|
||||
|
|
|
|||
Loading…
Reference in New Issue