Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 使用zipkin时未捕获子调用的URL路径_Spring_Spring Boot_Zipkin_Distributed Tracing - Fatal编程技术网

Spring 使用zipkin时未捕获子调用的URL路径

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,

我正在为一个微服务应用程序实现分布式跟踪。在ZipkinUI中,我无法获取子URL路径。

对于父调用,整个URL被捕获为“post/cart/create”。但对于孩子们来说,电话只能是“get”和“post”。未显示子调用的整个URL。如何解决这个问题?我需要帮助

Zipkin_spans表中的数据如上图所示

我的呼叫服务代码:

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;
}
我使用的依赖项是

  • 斯普林云侦探
  • 春云侦探齐普金
  • 这个问题似乎前后矛盾。有时显示整个URL,有时不显示。经过多次测试,我才知道这一点。我甚至用SpringCloud-starter-zipkin进行了测试。但它也没有显示出任何有希望的结果

    所以,如果整个URL是必要的,那么我不应该使用zipkin吗?建议使用spring为微服务提供任何其他跟踪机制