- Building Microservices with Go
- Nic Jackson
- 164字
- 2021-07-15 17:28:13
Standard response headers
All services should return the following headers.
- Date: The date that the request was processed in RFC 3339 format.
- Content-Type: The content type of the response.
- Content-Encoding: gzip or deflate.
- X-Request-ID/X-Correlation-ID: Whilst you may not directly request your clients to implement this header it may be something that you add to requests when you call downstream services. When you are trying to debug a service that is running in production it can be incredibly useful to be able to group all the requests by a single transaction ID. A common practice that we will see when we look at logging and monitoring is to store all logs in a common database such as Elastic Search. By setting the standard way of working when building many connected microservices that they pass the correlation ID with each downstream call you will be able to query your logs in Kibana or another log query tool and group them into a single transaction:
X-Request-ID: f058ebd6-02f7-4d3f-942e-904344e8cde
推薦閱讀
- HTML5+CSS3王者歸來
- C及C++程序設計(第4版)
- WildFly:New Features
- Learning Real-time Processing with Spark Streaming
- Docker技術入門與實戰(第3版)
- 大學計算機應用基礎實踐教程
- OpenShift開發指南(原書第2版)
- Reactive Programming With Java 9
- CouchDB and PHP Web Development Beginner’s Guide
- Yocto for Raspberry Pi
- 新印象:解構UI界面設計
- Python Machine Learning Blueprints:Intuitive data projects you can relate to
- Vue.js光速入門及企業項目開發實戰
- Scrapy網絡爬蟲實戰
- Learn Linux Quickly