...
...
When the client sends an HTTP request to the ESB, a correlation ID for the request can be passed using the correlation header that is configured in the ESB. By default, the correlation header is 'activity_id'. If you want to change the default correlation header, wee see the topic on configuring correlation logs. If the client does not pass a correlation ID in the request, the ESB will generate an internal value and assign it to the request. The correlation ID assigned to the incoming request is assigned to all the log entries that are related to the same request.
Shown below is the POST request that is sent using the CURL client in the quick start guide (using the CURL client). Note that the correlation ID is set in this request.
Code Block |
---|
curl -X POST --data @request.json http://localhost:8280/healthcare/categories/surgery/reserve -H "Content-Type:application/json" -H "activityid:correlationID" |
Accessing the correlation logs
If you know the correlation ID of the HTTP request that you want to analyze, you can isolate the relevant logs as explained below.
...
Localtabgroup |
---|
Localtab |
---|
| Code Block |
---|
Time Stamp|Correlation ID|Thread name|Duration|Call type|Connection name|Method type|Connection URL|HTTP state |
|
Localtab |
---|
| Code Block |
---|
2018-1011-2630 1715:3427:4027,464|de461a83-fc74-4660-93ed-1b609ecfac23269|correlationID|HTTP-Listener I/O dispatcher-35|5357|HTTP|http-incoming-317|GETPOST|/apihealthcare/querydoctorcategories/surgery/reserve|ROUND-TRIP LATENCY |
|
|
The detail recorded in a log entry is described below.
Time Stamp | The time at which the log is created. Code Block |
---|
| 2018-1011-2630 1715:3427:4027,464269 |
|
---|
Correlation ID | Each log contains a correlation ID, which is unique to the HTTP request. A client can send the correlation ID in the header of the HTTP request. If this correlation ID is missing in the incoming request, the ESB will generate one for the request. The HTTP header that carries the correlation ID is configured in the ESB. Code Block |
---|
| de461a83-fc74-4660-93ed-1b609ecfac23correlationID |
|
---|
Thread name | The identifier of the thread. Code Block |
---|
| HTTP-Listener I/O dispatcher-35 |
|
---|
Duration | The duration (given in milliseconds) depends on the type of log entry: - If the state in the log entry is ROUND-TRIP LATENCY, the duration corresponds to the time gap between the REQUEST_HEAD state and the ROUND-TRIP LATENCY state. That is, the total time of the round triptotal time duration since the incoming message was received by by the ESB until the response message is sent back to the client.
- If the state in the log entry is BACKEND LATENCY, the duration corresponds to the total time taken by the backend to process the message.
- For all other log entries, the duration corresponds to the time gap between the current log entry and the immediately previous log entry. That is, the time taken for the HTTP request to move from one state to another.
|
---|
Call type | There are two possible call types: - HTTP call type identifies logs that correspond to either back-end latency or round-trip latency BACKEND LATENCY or ROUND-TRIP LATENCY states. That is, in the case of an individual request, one log will be recorded to identify back-end latency, and another log for round-trip latency. Since these two logs relate to HTTP calls between the ESB and external clients, these logs they are categorized using the HTTP call type.
- HTTP State Transition call type identifies logs that correspond to the state transitions in the HTTP transport related to a particular message.
|
---|
Connection name | This is a name that is generated to identify the connection between the ESB and the external client (back-end or message sender). Code Block |
---|
| http-incoming-317 |
|
---|
Method type | The HTTP method used for the request. |
---|
Connection URL | The connection URL of the external client with which the message is being communicated. For example, if the message is being read from the client, the connection URL corresponds to the client sending the message. However, if the message is being written to the backend, the URL corresponds to the backend client. Code Block |
---|
| /apihealthcare/querydoctorcategories/surgery/reserve |
|
---|
HTTP state | Listed below are the state changes that a message goes through when it flows through the ESB, and when the message flows between the ESB and external clients. Typically, a new log entry is generated for each of the states. However, there can be two separate log entries created for one particular state (except for BACKEND LATENCY and ROUND-TRIP LATENCY) depending on whether the message is being read (from the sender) or written (to the backend). You can identify the two separate log entries from the connection URL explained above. - REQUEST_HEAD: All HTTP headers in the incoming request are being read/ or being written to the backend.
- REQUEST_BODY: The body of the incoming request is being read/ or being written to the backend.
- REQUEST_DONE: The request is completely read (content decoded)/ or is completely written to the backend.
- BACKEND LATENCY: The response message is received by the ESB. This status corresponds to the time total time taken by the backend to process the message.
- RESPONSE_HEAD: All HTTP headers in the response message are being read/ or being written to the client.
- RESPONSE_BODY: The body of the response message is being read/ or being written to the client.
- RESPONSE_DONE: The response is completely read/ or completely written to the client.
- ROUND-TRIP LATENCY: The response message is completely written to the client. This status corresponds to the total time taken by the HTTP request to compete the round trip (from the point of receiving the HTTP request from a client until the response message is sent back to the client).
|
---|