Sometimes it is required to correlate request and response in the gateway messages. This is required if you try to debug, monitor and analyze the messages. But this feature is not supported APIM out of the box. But still, you can use the APIM extension point to extract required information to implement custom monitoring mechanism. Also, note that this CorrelationID is introduced to the event since APIM 2.2.0.
We can list down following use cases,
correlationID is a UUID which is APIM introduced to the synapse context and it is unique to the complete API request path. Which mean a request come to gateway can identify with UUID and it not get changed and will be consistent whether it is faulty or throttled out. So it is easy to identify a request with its response path.
More importantly, which can be used to identify the message attributes like headers and payload. But this is not possible to analyze with Analytics since those are not publisher to the analyzer. In such cases, it is better to analyze with gateway itself using tools available in the synapse, like message ID, transaction ID or wire logs.
In order to analyze further with the analyzer, correlationID is published to the analyzer. it is included into the all gateway to analyzer events. Unfortunately, this feature is not used any out of the box dashboards. But this is very useful if you have an idea to implement custom dashboards with a cumulative analytics event.
Here the sample request analytics event gateway publishes to the analyzer. correlationID is include in the meta_clientType attribute as a JSON. And all other event used the same format to include correlationID.
meta_clientType: {"keyType":"SANDBOX","correlationID":"97e758f7-0ac0-4cbc-aa0a-84a4fe9f96f1"}, consumerKey:ivhMcN6YdASfwFIpfhvQjps2jbMa, context:/pizzashack/1.0.0, api_version:admin--PizzaShackAPI:v1.0.0, api:PizzaShackAPI, resourcePath:/menu, resourceTemplate:/menu, method:GET, version:1.0.0, request:1, requestTime:1526717879778, userId:admin@carbon.super, tenantDomain:carbon.super, hostName:192.168.56.1, apiPublisher:admin, applicationName:DefaultApplication, applicationId:1, userAgent:curl/7.47.0, tier:Unlimited, throttledOut:false, clientIp:192.168.56.1, applicationOwner:admin
Add Comment
Comments (0)