Skip to content

Commit 243aeb7

Browse files
authored
Merge pull request #314 from microsoft/client-request-id
Adding descriptions for x-ms-*-request-id headers
2 parents 3ccd6ff + aaf84b8 commit 243aeb7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

azure/Guidelines.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ Array | One of a) a comma-separated list of values (preferred), or b) separ
176176

177177
The table below lists the headers most used by Azure services:
178178

179+
179180
Header Key | Applies to | Example
180181
------------------- | ---------- | -------------
181182
_authorization_ | Request | Bearer eyJ0...Xd6j (Support Azure Active Directory)
@@ -197,6 +198,7 @@ _x-ms-error-code_ | Response | (see [Handling Errors](#Handling-Errors))
197198
_azure-deprecating_ | Response | (see [Deprecating Behavior](#Deprecating-Behavior))
198199
retry-after | Response | 180 (see [RFC 7231, Section 7.1.3](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.3))
199200

201+
200202
:white_check_mark: **DO** support all headers shown in _italics_
201203

202204
:white_check_mark: **DO** specify headers using kebab-casing
@@ -1051,6 +1053,13 @@ Client libraries are required to send telemetry and distributed tracing informat
10511053
- [Azure SDK Distributed tracing policy](https://azure.github.io/azure-sdk/general_azurecore.html#distributed-tracing-policy)
10521054
- [Open Telemetry](https://opentelemetry.io/)
10531055

1056+
In addition to distributed tracing, Azure also uses a set of common correlation headers:
1057+
1058+
|Name |Applies to|Description|
1059+
|-----------------------------|----------|-----------|
1060+
|x-ms-client-request-id |Both |Optional. Caller-specified value identifying the request, in the form of a GUID with no decoration such as curly braces (e.g. `x-ms-client-request-id: 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0`). If the caller provides this header the service **must** include this in their log entries to facilitate correlation of log entries for a single request. Because this header can be client-generated, it should not be assumed to be unique by the service implementation.
1061+
|x-ms-request-id |Response |Required. Service generated correlation id identifying the request, in the form of a GUID with no decoration such as curly braces. In contrast to the the `x-ms-client-request-id`, the service **must** ensure that this value is globally unique. Services should log this value with their traces to facilitate correlation of log entries for a single request.
1062+
10541063
## Final thoughts
10551064
These guidelines describe the upfront design considerations, technology building blocks, and common patterns that Azure teams encounter when building an API for their service. There is a great deal of information in them that can be difficult to follow. Fortunately, at Microsoft, there is a team committed to ensuring your success.
10561065

0 commit comments

Comments
 (0)