| | |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(Java110TraceFactory.class); |
| | | |
| | | // trace-id |
| | | public static final String TRACE_ID = "TRACE-ID"; |
| | | |
| | | //SPAN-ID |
| | | public static final String SPAN_ID = "SPAN-ID"; |
| | | |
| | | //SPAN-ID |
| | | public static final String PARENT_SPAN_ID = "PARENT-SPAN-ID"; |
| | | public static final String PARENT_SPAN_ID = "parent-span-id"; |
| | | |
| | | public static final String LOG_TRACE_TOPIC = "logTrace"; |
| | | |
| | |
| | | public static String createTrace(String name, Map<String, Object> headers) { |
| | | String traceId = ""; |
| | | String parentId = ""; |
| | | if (headers.containsKey(CommonConstant.TRANSACTION_ID)) { |
| | | if (headers.containsKey(CommonConstant.TRACE_ID)) { //先取trace Id |
| | | traceId = headers.get(CommonConstant.TRACE_ID).toString(); |
| | | }else if (headers.containsKey(CommonConstant.TRANSACTION_ID)) { |
| | | traceId = headers.get(CommonConstant.TRANSACTION_ID).toString(); |
| | | } else { |
| | | traceId = GenerateCodeFactory.getUUID(); |