[英]How send file through http from one end point to another end point in spring boot application
[英]End to end tracing of a flow from API/Scheduler in a Spring Boot application
我正在使用 Spring Boot 應用程序。 我想為每個請求添加一個TraceId
,因為它到達應用程序端點。 在這種情況下,我添加了類似於以下內容的spring-cloud-starter-sleuth
的依賴項:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
<version>3.1.5</version>
</dependency>
我沒有做任何其他更改。 它沒有解決從頭到尾跟蹤請求的問題。
1.請求訪問日志中沒有TraceId
。 現在它會像下面這樣
[0:0:0:0:0:0:0:1] - - [09/Dec/2022:07:00:42 +0000] "GET /api/my-service/paginated?shared=false&size=15&page=0&isTemplate=false HTTP/1.1" 200 2121
如您所見,日志中沒有添加跟蹤 ID。
2.其次,在 Hibernate 查詢日志中,也沒有TraceId
。 我在這里給出一個例子以便更好地理解:
Hibernate: select myTable0_.name as nam1_22_0_ from myTable myTable0_ where myTable0_.name=?
3.第三,在一個請求中,我可能需要調用我也擁有的另一項服務,它也沒有在那里傳播。 所以,截至目前,我無法從頭到尾追蹤任何請求。 這不僅適用於 API,也適用於調度程序。 有人可以在這里幫忙嗎?
根據共享的日志,您似乎有一個自定義日志記錄模式(也許?)
如果那是正確的,那么您很可能需要此處所示的配置才能在日志中查看 traceId。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.