Spring 使用zipkin时未捕获子调用的URL路径
我正在为一个微服务应用程序实现分布式跟踪。在ZipkinUI中,我无法获取子URL路径。 对于父调用,整个URL被捕获为“post/cart/create”。但对于孩子们来说,电话只能是“get”和“post”。未显示子调用的整个URL。如何解决这个问题?我需要帮助 Zipkin_spans表中的数据如上图所示 我的呼叫服务代码:Spring 使用zipkin时未捕获子调用的URL路径,spring,spring-boot,zipkin,distributed-tracing,Spring,Spring Boot,Zipkin,Distributed Tracing,我正在为一个微服务应用程序实现分布式跟踪。在ZipkinUI中,我无法获取子URL路径。 对于父调用,整个URL被捕获为“post/cart/create”。但对于孩子们来说,电话只能是“get”和“post”。未显示子调用的整个URL。如何解决这个问题?我需要帮助 Zipkin_spans表中的数据如上图所示 我的呼叫服务代码: public Cart createCartItem(Cart cartItem, String userId) { Map<String,
public Cart createCartItem(Cart cartItem, String userId) {
Map<String,String> params = new HashMap<String, String>();
params.put("userId", userId);
String inventoryUrl
= "http://item-service/inventory/get/"+cartItem.getItem_id();
ResponseEntity<Integer> response
= restTemplate.getForEntity(inventoryUrl, Integer.class, params);
if(!response.equals(0)) {
Cart cart = cartRepository.save(cartItem);
String inventoryQtyUpdateUrl
= "http://item-service/inventory/qty/"+cartItem.getItem_id();
restTemplate.postForLocation(inventoryQtyUpdateUrl, null, params);
return cart;
}
return null;
}
public Cart createCartItem(Cart cartItem,字符串userId){
Map params=新的HashMap();
参数put(“userId”,userId);
字符串清单URL
= "http://item-service/inventory/get/“+cartItem.getItem_id();
反应性反应
=restTemplate.getForEntity(inventoryUrl、Integer.class、params);
如果(!response.equals(0)){
购物车=cartRepository.save(cartItem);
字符串inventoryQtyUpdateUrl
= "http://item-service/inventory/qty/“+cartItem.getItem_id();
postForLocation(inventoryQtyUpdateUrl,null,参数);
返回车;
}
返回null;
}
我使用的依赖项是