diff --git a/skywalking-sniffer/skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/a/eye/skywalking/plugin/dubbo/DubboInterceptor.java b/skywalking-sniffer/skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/a/eye/skywalking/plugin/dubbo/DubboInterceptor.java index eea854141b3a16448cc0f9bdee52d4a90a79bf87..7ad8a65d6440af4088637694f2d9dbf7e3943df6 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/a/eye/skywalking/plugin/dubbo/DubboInterceptor.java +++ b/skywalking-sniffer/skywalking-sdk-plugin/dubbo-plugin/src/main/java/com/a/eye/skywalking/plugin/dubbo/DubboInterceptor.java @@ -27,7 +27,7 @@ import com.alibaba.dubbo.rpc.RpcContext; */ public class DubboInterceptor implements InstanceMethodsAroundInterceptor { - public static final String ATTACHMENT_NAME_OF_CONTEXT_DATA = "contextData"; + public static final String ATTACHMENT_NAME_OF_CONTEXT_DATA = "SWTraceContext"; public static final String DUBBO_COMPONENT = "Dubbo"; /** diff --git a/skywalking-sniffer/skywalking-sdk-plugin/httpClient-4.x-plugin/src/main/java/com/a/eye/skywalking/plugin/httpClient/v4/HttpClientExecuteInterceptor.java b/skywalking-sniffer/skywalking-sdk-plugin/httpClient-4.x-plugin/src/main/java/com/a/eye/skywalking/plugin/httpClient/v4/HttpClientExecuteInterceptor.java index 9851d1d47507d0b6ed9887020f1ea9c5f1860953..e59e67a58b9ab9a8f9f448b13f566ab4445a4975 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/httpClient-4.x-plugin/src/main/java/com/a/eye/skywalking/plugin/httpClient/v4/HttpClientExecuteInterceptor.java +++ b/skywalking-sniffer/skywalking-sdk-plugin/httpClient-4.x-plugin/src/main/java/com/a/eye/skywalking/plugin/httpClient/v4/HttpClientExecuteInterceptor.java @@ -23,7 +23,7 @@ import org.apache.http.StatusLine; * @author zhangxin */ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterceptor { - public static final String HEADER_NAME_OF_CONTEXT_DATA = "SKYWALKING_CONTEXT_DATA"; + public static final String HEADER_NAME_OF_CONTEXT_DATA = "SWTraceContext"; private static final String COMPONENT_NAME = "Http"; @Override diff --git a/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/main/java/com/a/eye/skywalking/plugin/motan/MotanProviderInterceptor.java b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/main/java/com/a/eye/skywalking/plugin/motan/MotanProviderInterceptor.java index bbc66f3a7c1acc8a1b990fbd09d20b5ccc11e670..73764170c41dbeb258bd55cabf20f7312e75029e 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/main/java/com/a/eye/skywalking/plugin/motan/MotanProviderInterceptor.java +++ b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/main/java/com/a/eye/skywalking/plugin/motan/MotanProviderInterceptor.java @@ -8,6 +8,7 @@ import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceConstructorIn import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodInvokeContext; import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor; import com.a.eye.skywalking.api.plugin.interceptor.enhance.MethodInterceptResult; +import com.a.eye.skywalking.api.util.StringUtil; import com.a.eye.skywalking.trace.Span; import com.a.eye.skywalking.trace.tag.Tags; import com.weibo.api.motan.rpc.Request; @@ -33,7 +34,7 @@ public class MotanProviderInterceptor implements InstanceConstructorInterceptor, /** * The {@link Request#getAttachments()} key. It maps to the serialized {@link ContextCarrier}. */ - private static final String ATTACHMENT_KEY_OF_CONTEXT_DATA = "contextData"; + private static final String ATTACHMENT_KEY_OF_CONTEXT_DATA = "SWTraceContext"; /** * Motan component */ @@ -50,7 +51,7 @@ public class MotanProviderInterceptor implements InstanceConstructorInterceptor, URL url = (URL) context.get(KEY_NAME_OF_REQUEST_URL); if (url != null) { com.weibo.api.motan.rpc.Request request = (com.weibo.api.motan.rpc.Request) interceptorContext.allArguments()[0]; - Span span = ContextManager.INSTANCE.createSpan(generateViewPoint(url, request)); + Span span = ContextManager.INSTANCE.createSpan(generateViewPoint(request)); Tags.COMPONENT.set(span, MOTAN_COMPONENT); Tags.URL.set(span, url.getIdentity()); Tags.PEER_PORT.set(span, url.getPort()); @@ -59,7 +60,9 @@ public class MotanProviderInterceptor implements InstanceConstructorInterceptor, Tags.SPAN_LAYER.asRPCFramework(span); String serializedContextData = request.getAttachments().get(ATTACHMENT_KEY_OF_CONTEXT_DATA); - ContextManager.INSTANCE.extract(new ContextCarrier().deserialize(serializedContextData)); + if (!StringUtil.isEmpty(serializedContextData)) { + ContextManager.INSTANCE.extract(new ContextCarrier().deserialize(serializedContextData)); + } } } @@ -72,6 +75,7 @@ public class MotanProviderInterceptor implements InstanceConstructorInterceptor, Tags.ERROR.set(span, true); span.log(response.getException()); } + ContextManager.INSTANCE.stopSpan(); return ret; } @@ -82,8 +86,8 @@ public class MotanProviderInterceptor implements InstanceConstructorInterceptor, } - private static String generateViewPoint(URL serviceURI, Request request) { - StringBuilder viewPoint = new StringBuilder(serviceURI.getUri()); + private static String generateViewPoint(Request request) { + StringBuilder viewPoint = new StringBuilder(request.getInterfaceName()); viewPoint.append("." + request.getMethodName()); viewPoint.append("(" + request.getParamtersDesc() + ")"); return viewPoint.toString(); diff --git a/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/test/java/com/a/eye/skywalking/plugin/motan/MotanConsumerFetchRequestURLInterceptorTest.java b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/test/java/com/a/eye/skywalking/plugin/motan/MotanConsumerFetchRequestURLInterceptorTest.java new file mode 100644 index 0000000000000000000000000000000000000000..190dea616d1e622353ec1dc4a043a32595c40b81 --- /dev/null +++ b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/test/java/com/a/eye/skywalking/plugin/motan/MotanConsumerFetchRequestURLInterceptorTest.java @@ -0,0 +1,54 @@ +package com.a.eye.skywalking.plugin.motan; + +import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext; +import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodInvokeContext; +import com.weibo.api.motan.rpc.URL; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Matchers; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class MotanConsumerFetchRequestURLInterceptorTest { + + private MotanConsumerFetchRequestURLInterceptor requestURLInterceptor; + + @Mock + private EnhancedClassInstanceContext instanceContext; + @Mock + private InstanceMethodInvokeContext interceptorContext; + + private URL url; + + @Before + public void setUp() { + requestURLInterceptor = new MotanConsumerFetchRequestURLInterceptor(); + url = URL.valueOf("motan://127.0.0.0.1:34000/com.a.eye.skywalking.test.TestService"); + + when(interceptorContext.allArguments()).thenReturn(new Object[]{url}); + } + + @Test + public void testFetchRequestURL() { + requestURLInterceptor.beforeMethod(instanceContext, interceptorContext, null); + requestURLInterceptor.afterMethod(instanceContext, interceptorContext, null); + + verify(instanceContext, times(1)).set(Matchers.any(), Matchers.any()); + } + + @Test + public void testFetchRequestURLWithException(){ + requestURLInterceptor.beforeMethod(instanceContext, interceptorContext, null); + requestURLInterceptor.handleMethodException(new RuntimeException(), instanceContext, interceptorContext); + requestURLInterceptor.afterMethod(instanceContext, interceptorContext, null); + + verify(instanceContext, times(1)).set(Matchers.any(), Matchers.any()); + } +} \ No newline at end of file diff --git a/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/test/java/com/a/eye/skywalking/plugin/motan/MotanConsumerInvokeInterceptorTest.java b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/test/java/com/a/eye/skywalking/plugin/motan/MotanConsumerInvokeInterceptorTest.java new file mode 100644 index 0000000000000000000000000000000000000000..22a4d9bfd503fbd7f10528f4f275ca9c3c8a7eaa --- /dev/null +++ b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/test/java/com/a/eye/skywalking/plugin/motan/MotanConsumerInvokeInterceptorTest.java @@ -0,0 +1,141 @@ +package com.a.eye.skywalking.plugin.motan; + +import com.a.eye.skywalking.api.context.TracerContext; +import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext; +import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodInvokeContext; +import com.a.eye.skywalking.sniffer.mock.context.MockTracerContextListener; +import com.a.eye.skywalking.sniffer.mock.context.SegmentAssert; +import com.a.eye.skywalking.trace.LogData; +import com.a.eye.skywalking.trace.Span; +import com.a.eye.skywalking.trace.TraceSegment; +import com.a.eye.skywalking.trace.tag.Tags; +import com.weibo.api.motan.rpc.Request; +import com.weibo.api.motan.rpc.Response; +import com.weibo.api.motan.rpc.URL; + +import org.hamcrest.CoreMatchers; +import org.hamcrest.MatcherAssert; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class MotanConsumerInvokeInterceptorTest { + + private MockTracerContextListener contextListener; + + private MotanConsumerInvokeInterceptor invokeInterceptor; + @Mock + private EnhancedClassInstanceContext instanceContext; + @Mock + private InstanceMethodInvokeContext interceptorContext; + @Mock + private Response response; + @Mock + private Request request; + + private URL url; + + @Before + public void setUp() { + contextListener = new MockTracerContextListener(); + invokeInterceptor = new MotanConsumerInvokeInterceptor(); + url = URL.valueOf("motan://127.0.0.1:34000/com.a.eye.skywalking.test.TestService"); + + TracerContext.ListenerManager.add(contextListener); + + when(instanceContext.get("REQUEST_URL")).thenReturn(url); + when(interceptorContext.allArguments()).thenReturn(new Object[]{request}); + when(request.getMethodName()).thenReturn("test"); + when(request.getInterfaceName()).thenReturn("com.a.eye.skywalking.test.TestService"); + when(request.getParamtersDesc()).thenReturn("java.lang.String, java.lang.Object"); + } + + @Test + public void testInvokeInterceptor() { + invokeInterceptor.beforeMethod(instanceContext, interceptorContext, null); + invokeInterceptor.afterMethod(instanceContext, interceptorContext, response); + + contextListener.assertSize(1); + contextListener.assertTraceSegment(0, new SegmentAssert() { + @Override + public void call(TraceSegment traceSegment) { + assertThat(traceSegment.getSpans().size(), is(1)); + Span span = traceSegment.getSpans().get(0); + assertMotanConsumerSpan(span); + verify(request, times(1)).setAttachment(anyString(), anyString()); + } + }); + } + + @Test + public void testResponseWithException() { + when(response.getException()).thenReturn(new RuntimeException()); + + invokeInterceptor.beforeMethod(instanceContext, interceptorContext, null); + invokeInterceptor.afterMethod(instanceContext, interceptorContext, response); + + contextListener.assertSize(1); + assertTraceSegmentWhenOccurException(); + } + + private void assertTraceSegmentWhenOccurException() { + contextListener.assertTraceSegment(0, new SegmentAssert() { + @Override + public void call(TraceSegment traceSegment) { + assertThat(traceSegment.getSpans().size(), is(1)); + Span span = traceSegment.getSpans().get(0); + assertMotanConsumerSpan(span); + verify(request, times(1)).setAttachment(anyString(), anyString()); + assertThat(span.getLogs().size(), is(1)); + LogData logData = span.getLogs().get(0); + assertLogData(logData); + } + }); + } + + @Test + public void testInvokeInterceptorWithException() { + + invokeInterceptor.beforeMethod(instanceContext, interceptorContext, null); + invokeInterceptor.handleMethodException(new RuntimeException(), instanceContext, interceptorContext); + invokeInterceptor.afterMethod(instanceContext, interceptorContext, response); + + contextListener.assertSize(1); + assertTraceSegmentWhenOccurException(); + } + + private void assertLogData(LogData logData) { + assertThat(logData.getFields().size(), is(4)); + MatcherAssert.assertThat(logData.getFields().get("event"), CoreMatchers.is("error")); + MatcherAssert.assertThat(logData.getFields().get("error.kind"), CoreMatchers.is(RuntimeException.class.getName())); + assertNull(logData.getFields().get("message")); + } + + private void assertMotanConsumerSpan(Span span) { + assertThat(span.getOperationName(), is("com.a.eye.skywalking.test.TestService.test(java.lang.String, java.lang.Object)")); + assertThat(Tags.COMPONENT.get(span), is("Motan")); + assertThat(Tags.SPAN_KIND.get(span), is(Tags.SPAN_KIND_CLIENT)); + assertThat(Tags.PEER_HOST.get(span), is("127.0.0.1")); + assertThat(Tags.PEER_PORT.get(span), is(34000)); + assertTrue(Tags.SPAN_LAYER.isRPCFramework(span)); + assertThat(Tags.URL.get(span), is("motan://127.0.0.1:34000/default_rpc/com.a.eye.skywalking.test.TestService/1.0/service")); + } + + @After + public void tearDown() { + TracerContext.ListenerManager.remove(contextListener); + } +} \ No newline at end of file diff --git a/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/test/java/com/a/eye/skywalking/plugin/motan/MotanProviderInterceptorTest.java b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/test/java/com/a/eye/skywalking/plugin/motan/MotanProviderInterceptorTest.java new file mode 100644 index 0000000000000000000000000000000000000000..6c1477908f0cb07809724f3fc0b49f8503ecfa0e --- /dev/null +++ b/skywalking-sniffer/skywalking-sdk-plugin/motan-plugin/src/test/java/com/a/eye/skywalking/plugin/motan/MotanProviderInterceptorTest.java @@ -0,0 +1,184 @@ +package com.a.eye.skywalking.plugin.motan; + +import com.a.eye.skywalking.api.context.TracerContext; +import com.a.eye.skywalking.api.plugin.interceptor.EnhancedClassInstanceContext; +import com.a.eye.skywalking.api.plugin.interceptor.enhance.ConstructorInvokeContext; +import com.a.eye.skywalking.api.plugin.interceptor.enhance.InstanceMethodInvokeContext; +import com.a.eye.skywalking.sniffer.mock.context.MockTracerContextListener; +import com.a.eye.skywalking.sniffer.mock.context.SegmentAssert; +import com.a.eye.skywalking.trace.LogData; +import com.a.eye.skywalking.trace.Span; +import com.a.eye.skywalking.trace.TraceSegment; +import com.a.eye.skywalking.trace.TraceSegmentRef; +import com.a.eye.skywalking.trace.tag.Tags; +import com.weibo.api.motan.rpc.Request; +import com.weibo.api.motan.rpc.Response; +import com.weibo.api.motan.rpc.URL; + +import org.hamcrest.CoreMatchers; +import org.hamcrest.MatcherAssert; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Matchers; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; + +import java.util.HashMap; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class MotanProviderInterceptorTest { + + + private MockTracerContextListener contextListener; + + private MotanProviderInterceptor invokeInterceptor; + @Mock + private EnhancedClassInstanceContext instanceContext; + @Mock + private InstanceMethodInvokeContext interceptorContext; + @Mock + private ConstructorInvokeContext constructorInvokeContext; + @Mock + private Response response; + @Mock + private Request request; + + private URL url; + + @Before + public void setUp() { + invokeInterceptor = new MotanProviderInterceptor(); + contextListener = new MockTracerContextListener(); + url = URL.valueOf("motan://127.0.0.1:34000/com.a.eye.skywalking.test.TestService"); + + TracerContext.ListenerManager.add(contextListener); + + when(instanceContext.get("REQUEST_URL")).thenReturn(url); + when(interceptorContext.allArguments()).thenReturn(new Object[]{request}); + when(request.getMethodName()).thenReturn("test"); + when(request.getInterfaceName()).thenReturn("com.a.eye.skywalking.test.TestService"); + when(request.getParamtersDesc()).thenReturn("java.lang.String, java.lang.Object"); + when(constructorInvokeContext.allArguments()).thenReturn(new Object[]{url}); + } + + @Test + public void testFetchRequestURL() { + invokeInterceptor.onConstruct(instanceContext, constructorInvokeContext); + verify(instanceContext, times(1)).set(Matchers.any(), Matchers.any()); + } + + @Test + public void testInvokerWithoutRefSegment() { + invokeInterceptor.beforeMethod(instanceContext, interceptorContext, null); + invokeInterceptor.afterMethod(instanceContext, interceptorContext, response); + + contextListener.assertSize(1); + contextListener.assertTraceSegment(0, new SegmentAssert() { + @Override + public void call(TraceSegment traceSegment) { + assertThat(traceSegment.getSpans().size(), is(1)); + Span span = traceSegment.getSpans().get(0); + assertMotanProviderSpan(span); + assertTrue(traceSegment.getPrimaryRef() == null); + } + }); + } + + @Test + public void testInvokerWithRefSegment() { + HashMap attachments = new HashMap(); + attachments.put("SWTraceContext", "302017.1487666919810.624424584.17332.1.1|1|REMOTE_APP|127.0.0.1"); + when(request.getAttachments()).thenReturn(attachments); + + invokeInterceptor.beforeMethod(instanceContext, interceptorContext, null); + invokeInterceptor.afterMethod(instanceContext, interceptorContext, response); + + contextListener.assertSize(1); + contextListener.assertTraceSegment(0, new SegmentAssert() { + @Override + public void call(TraceSegment traceSegment) { + assertThat(traceSegment.getSpans().size(), is(1)); + Span span = traceSegment.getSpans().get(0); + assertMotanProviderSpan(span); + assertRefSegment(traceSegment.getPrimaryRef()); + } + }); + } + + + @Test + public void testResponseWithException() { + when(response.getException()).thenReturn(new RuntimeException()); + + invokeInterceptor.beforeMethod(instanceContext, interceptorContext, null); + invokeInterceptor.afterMethod(instanceContext, interceptorContext, response); + + assertTraceSegmentWhenOccurException(); + } + + @Test + public void testOccurException() { + + invokeInterceptor.beforeMethod(instanceContext, interceptorContext, null); + invokeInterceptor.handleMethodException(new RuntimeException(), instanceContext, interceptorContext); + invokeInterceptor.afterMethod(instanceContext, interceptorContext, response); + + assertTraceSegmentWhenOccurException(); + } + + private void assertTraceSegmentWhenOccurException() { + contextListener.assertSize(1); + contextListener.assertTraceSegment(0, new SegmentAssert() { + @Override + public void call(TraceSegment traceSegment) { + assertThat(traceSegment.getSpans().size(), is(1)); + Span span = traceSegment.getSpans().get(0); + assertMotanProviderSpan(span); + assertThat(span.getLogs().size(), is(1)); + LogData logData = span.getLogs().get(0); + assertLogData(logData); + } + }); + } + + + private void assertLogData(LogData logData) { + assertThat(logData.getFields().size(), is(4)); + MatcherAssert.assertThat(logData.getFields().get("event"), CoreMatchers.is("error")); + MatcherAssert.assertThat(logData.getFields().get("error.kind"), CoreMatchers.is(RuntimeException.class.getName())); + assertNull(logData.getFields().get("message")); + } + + private void assertRefSegment(TraceSegmentRef primaryRef) { + assertThat(primaryRef.getTraceSegmentId(), is("302017.1487666919810.624424584.17332.1.1")); + assertThat(primaryRef.getSpanId(), is(1)); + assertThat(primaryRef.getPeerHost(), is("127.0.0.1")); + } + + + private void assertMotanProviderSpan(Span span) { + assertThat(span.getOperationName(), is("com.a.eye.skywalking.test.TestService.test(java.lang.String, java.lang.Object)")); + assertThat(Tags.COMPONENT.get(span), is("Motan")); + assertThat(Tags.SPAN_KIND.get(span), is(Tags.SPAN_KIND_SERVER)); + assertThat(Tags.PEER_HOST.get(span), is("127.0.0.1")); + assertThat(Tags.PEER_PORT.get(span), is(34000)); + assertTrue(Tags.SPAN_LAYER.isRPCFramework(span)); + assertThat(Tags.URL.get(span), is("motan://127.0.0.1:34000/default_rpc/com.a.eye.skywalking.test.TestService/1.0/service")); + } + + + @After + public void tearDown() { + TracerContext.ListenerManager.remove(contextListener); + } +} \ No newline at end of file diff --git a/skywalking-sniffer/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/a/eye/skywalking/plugin/tomcat78x/TomcatInterceptor.java b/skywalking-sniffer/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/a/eye/skywalking/plugin/tomcat78x/TomcatInterceptor.java index b690b3168598f23ca301f30416a9bcc7350d177e..07f5181133e8fe26ad214f21556d6b3b74f9a288 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/a/eye/skywalking/plugin/tomcat78x/TomcatInterceptor.java +++ b/skywalking-sniffer/skywalking-sdk-plugin/tomcat-7.x-8.x-plugin/src/main/java/com/a/eye/skywalking/plugin/tomcat78x/TomcatInterceptor.java @@ -22,7 +22,7 @@ public class TomcatInterceptor implements InstanceMethodsAroundInterceptor { /** * Header name that the serialized context data stored in {@link HttpServletRequest#getHeader(String)}. */ - public static final String HEADER_NAME_OF_CONTEXT_DATA = "SKYWALKING_CONTEXT_DATA"; + public static final String HEADER_NAME_OF_CONTEXT_DATA = "SWTraceContext"; /** * Tomcat component. */