侦探不显示跟踪ID和范围ID

时间:2017-04-30 15:01:54

标签: spring-boot spring-cloud-sleuth

我正在尝试运行Spring Boot应用程序并在Sleuth的支持下跟踪其执行情况。 日志显示服务名称,但不显示跟踪标识或跨区标识。我得到的只是[myservice ,,,]。

我错过了什么?

以下是日志中的一些行。

  

2017-04-30 14:41:38.750 INFO [myservice ,,,] 7 --- [主要]   s.c.a.AnnotationConfigApplicationContext:刷新   org.springframework.context.annotation.AnnotationConfigApplicationContext@5e57643e:   启动日期[Sun Apr 30 14:41:38 GMT 2017];上下文层次结构的根

     

2017-04-30 14:41:39.264 INFO [myservice ,,,] 7 --- [主要]   f.a.AutowiredAnnotationBeanPostProcessor:JSR-330   找到并支持'javax.inject.Inject'注释以进行自动装配

     

...

由于

2 个答案:

答案 0 :(得分:3)

就像达伦提到的那样,这是完全正常的。你想在这里追踪什么?跟踪是通过rpc调用启动的,或者是这样的。请阅读文档,在那里您可以阅读有关分布式跟踪的内容,您可以观看我的视频,其中我解释了如何使用侦探

答案 1 :(得分:0)

@Marcin Grzejszczak是正确的,traceId和spanId将显示在import 'package:flutter/foundation.dart'; class Product with ChangeNotifier { final String id; final String category; final String name; final String description; final String img; final double price; Product( {@required this.id, @required this.category, @required this.name, @required this.description, @required this.img, @required this.price}); } class Products with ChangeNotifier { List<Product> _items = [ Product( id: '1', name: 'Art Of The Deal', img: 'images/pi1.jpg', price: 5, category: 'Business', description: 'Trump: The Art of the Deal is a 1987 book credited to Donald J. Trump and journalist Tony Schwartz. Part memoir and part business-advice book, it was the first book credited to Trump, and helped to make him a "household name".', ), Product( id: '2', name: 'Rich Dad Poor Dad', img: 'images/pi1.jpg', price: 5, category: 'Business', description: 'Rich Dad Poor Dad is a 1997 book written by Robert Kiyosaki and Sharon Lechter. It advocates the importance of financial literacy, financial independence and building wealth through investing in assets', ), Product( id: '3', name: 'PS4 Dual Shock', img: 'https://upload.wikimedia.org/wikipedia/commons/5/59/DualShock_4.jpg', price: 4, category: 'Fiction', description: 'The PlayStation 4 (officially abbreviated as PS4) is an eighth-generation home video game console developed by Sony Interactive Entertainment. Announced as the successor to the PlayStation 3 in February 2013, it was launched on November 15 in North America, November 29 in Europe, South America and Australia, and on February 22, 2014 in Japan.', ), Product( id: '4', name: 'GTA V', img: 'https://upload.wikimedia.org/wikipedia/en/a/a5/Grand_Theft_Auto_V.png', price: 4, category: 'Romantc', description: 'Best selling poular free roaming game', ), Product( id: '5', name: 'RDR 2', img: 'images/pi2.jpgs', price: 4, category: 'Games', description: 'Free roam classic by Rockstar', ), Product( id: '6', name: 'Acer Aspire', img: 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/delish-homemade-pizza-horizontal-1542312378.png?crop=1.00xw:0.752xh;0,0.139xh&resize=640:*', price: 4, category: 'Laptops', description: '8 gb ram, mx 150.', ), ]; List<Product> get items { return [..._items]; } Product findById(String id) { return _items.firstWhere((pdt) => pdt.id == id); } }打印的日志行中

相关问题