jsonResponse.add(ERROR_FIELD, callException.toJson()); writeResponse(resp, HttpServletResponse.SC_BAD_REQUEST, jsonResponse.toString()); incrementFailureCounter("unknown", context.getRpcOriginService(), context.getRpcOriginMethod()); return; methodTimer = getMethodTimer(methodName, context.getRpcOriginService(), context.getRpcOriginMethod()); startTime = methodTimer.start(); incrementSuccessCounter(methodName, context.getRpcOriginService(), context.getRpcOriginMethod()); } catch (IOException e) { incrementFailureCounter(methodName, context.getRpcOriginService(), context.getRpcOriginMethod()); } finally {
incrementFailureCounter(methodName, context.getRpcOriginService(), context.getRpcOriginMethod()); throw new IllegalArgumentException("Invalid method: " + GoTimer methodTimer = getMethodTimer(methodName, context.getRpcOriginService(), context.getRpcOriginMethod()); long startTime = methodTimer.start(); incrementSuccessCounter(methodName, context.getRpcOriginService(), context.getRpcOriginMethod()); } catch (RpcCallException rpcEx) { Tags.ERROR.set(span, true); incrementFailureCounter(methodName, context.getRpcOriginService(), context.getRpcOriginMethod()); } catch (RpcReadException ex) { Tags.ERROR.set(span, true); incrementFailureCounter(methodName, context.getRpcOriginService(), context.getRpcOriginMethod()); } catch (Exception ex) { incrementFailureCounter(methodName, context.getRpcOriginService(), context.getRpcOriginMethod()); } finally {
protected Span getSpan(String methodName, Map<String, String> headers, OrangeContext context) { Span span = null; if (tracer != null) { SpanContext spanContext = tracer.extract(Format.Builtin.HTTP_HEADERS, new TextMapExtractAdapter(headers)); if (spanContext != null) { span = tracer.buildSpan(methodName).asChildOf(spanContext).start(); } else { span = tracer.buildSpan(methodName).start(); } span.setTag("correlation_id", context.getCorrelationId()); span.setTag("rpc.call", methodName); Tags.SPAN_KIND.set(span, Tags.SPAN_KIND_SERVER); Tags.PEER_SERVICE.set(span, context.getRpcOriginService()); context.setTracingContext(span.context()); } return span; }