use of org.nutz.http.Request.METHOD in project incubator-skywalking by apache.
the class SenderSendInterceptor method beforeMethod.
@Override
public void beforeMethod(final EnhancedInstance objInst, final Method method, final Object[] allArguments, final Class<?>[] argumentsTypes, final MethodInterceptResult result) throws Throwable {
Request req = (Request) objInst.getSkyWalkingDynamicField();
final URI requestURL = req.getUrl().toURI();
final METHOD httpMethod = req.getMethod();
final ContextCarrier contextCarrier = new ContextCarrier();
String remotePeer = requestURL.getHost() + ":" + requestURL.getPort();
AbstractSpan span = ContextManager.createExitSpan(requestURL.getPath(), contextCarrier, remotePeer);
span.setComponent(ComponentsDefine.NUTZ_HTTP);
Tags.URL.set(span, requestURL.getScheme() + "://" + requestURL.getHost() + ":" + requestURL.getPort() + requestURL.getPath());
Tags.HTTP.METHOD.set(span, httpMethod.toString());
SpanLayer.asHttp(span);
CarrierItem next = contextCarrier.items();
while (next.hasNext()) {
next = next.next();
req.getHeader().set(next.getHeadKey(), next.getHeadValue());
}
}
Aggregations