当前位置:网站首页>Add traceid to the project log
Add traceid to the project log
2022-07-26 07:42:00 【New generation programmers】
Add... To the log traceid
traceid What is it? ?
- What I'm talking about here traceid It refers to adding the same to every log after the server receives the client request and returns the result to the client traceid To track the whole process from request to return .
Why add traceid?
- Recently, I am going to add traceid. This facilitates the server gateway to track the entire requested link after receiving the request and before returning to the client . It is convenient to check online bug And the performance bottleneck of statistical query requests .
- Add one traceid, It's not difficult for a new project , But for a project that has been mature and launched , There are still many things to pay attention to .
- At present, our online project adopts the idea of microservice : In the project, the relatively independent parts of the function are separated into processes . Facilitate rapid iteration of services , Rapid deployment and partial updates . In fact, such a splitting effect is quite obvious , The hot update can be achieved without stopping the service if the functions are required , Greatly reduced maintenance costs , Improved user experience .
How to design traceid?
- Here is the traceid Divide into 4 Parts of :
- User related uid
- Message related msgid
- Incremental or unique tid
- Time related timestamp timestamp
- User uid Needless to say , It is convenient to identify which user is related to this business .
- news msgid It is convenient to locate the business .
- tid In order to ensure traceid Uniqueness .
- Timestamp is convenient to count the time consumed from request to return , At the same time, the time consumed can be calculated after each further step .
traceid Whether it is possible to transmit the business through ?
- At present, for online business structure , Can't get through . Only through between nodes 、 Pass parameters between function calls traceid How to use traceid, This is the simplest and most cumbersome scheme . But it's quite practical , Be able to solve problems . At present, let each node support traceid Link tracking , It will be optimized later .
summary
- traceid The addition of is still in progress , At present, the link log printing of some nodes has been completed . The statistics of link time consumption will be added later . Here is the first record . I will use traceid Let's count each api Time consuming to call .
边栏推荐
- 0 dynamic programming leetcode1567. Length of the longest subarray with positive product
- 力扣(LeetCode)206. 反转链表(2022.07.25)
- OVS底层实现原理
- Solution to the problem of token loss when microservice feign is called
- 2021全球机器学习大会演讲稿
- IDEA快捷键
- Learning Efficient Convolutional Networks Through Network Slimming
- Vscode cannot start the problem solving idea
- Network Trimming: A Data-Driven Neuron Pruning Approach towards Efficient Deep Architectures论文翻译/笔记
- Practice of online question feedback module (XIV): realize online question answering function
猜你喜欢

Crawler - > tpimgspider

WCF 部署在IIS上

Practice of online question feedback module (XIV): realize online question answering function

Kdd2022 | uncover the mystery of Kwai short video recommendation re ranking, and recommend the new SOTA

“尝鲜”元宇宙,周杰伦最佳拍档方文山将于7月25日官宣《华流元宇宙》

Jmeter性能测试之将每次接口请求的结果保存到文件中
![[daily question 1] 919. Complete binary tree inserter](/img/a2/2ff77ccdfb78bb1812b989342c2331.png)
[daily question 1] 919. Complete binary tree inserter

Lambda and stream

NFS service and Samba service deployment

What is message subscription and publishing?
随机推荐
Practice of online question feedback module (XIV): realize online question answering function
模型剪枝三:Learning Structured Sparsity in Deep Neural Networks
Jmeter性能测试之命令行执行和生成测试报告
PostgreSQL UUID fuzzy search UUID string type conversion SQL error [42883] explicit type casts
OVSDB
系统架构&微服务
TensorFlow学习日记之tflearn
Use of JMeter performance test to store response content to file listener
Anaconda 中安装 百度飞浆Paddle 深度学习框架 教程
元宇宙基础设施:WEB 3.0 chain33 优势分析
dcn(deep cross network)三部曲
Jmeter性能测试之使用存储响应内容到文件监听器
Command line execution and test report generation of JMeter performance test
Common templates for web development
2021-11-09
Comparison and difference between dependence and Association
2022.7.22DAY612
Audio and video learning (10) -- PS streaming
Open source management system based on ThinkPHP
2021全球机器学习大会演讲稿