diff options
Diffstat (limited to 'Documentation/rest-api.txt')
-rw-r--r-- | Documentation/rest-api.txt | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Documentation/rest-api.txt b/Documentation/rest-api.txt index 0957d32c52..8f6a47b233 100644 --- a/Documentation/rest-api.txt +++ b/Documentation/rest-api.txt @@ -191,6 +191,53 @@ Preconditions] section. "`422 Unprocessable Entity`" is returned if the ID of a resource that is specified in the request body cannot be resolved. +[[tracing]] +=== Request Tracing +For each REST endpoint tracing can be enabled by setting the +`trace=<trace-id>` request parameter. It is recommended to use the ID +of the issue that is being investigated as trace ID. + +.Example Request +---- + GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?trace=issue/123&q=J +---- + +It is also possible to omit the trace ID and get a unique trace ID +generated. + +.Example Request +---- + GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?trace&q=J +---- + +Alternatively request tracing can also be enabled by setting the +`X-Gerrit-Trace` header: + +.Example Request +---- + GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J + X-Gerrit-Trace: issue/123 +---- + +Enabling tracing results in additional logs with debug information that +are written to the `error_log`. All logs that correspond to the traced +request are associated with the trace ID. The trace ID is returned with +the REST response in the `X-Gerrit-Trace` header. + +.Example Response +---- +HTTP/1.1 200 OK + Content-Disposition: attachment + Content-Type: application/json; charset=UTF-8 + X-Gerrit-Trace: 1533885943749-8257c498 + + )]}' + ... <json> ... +---- + +Given the trace ID an administrator can find the corresponding logs and +investigate issues more easily. + GERRIT ------ Part of link:index.html[Gerrit Code Review] |