how to get the service callout request sent and response received timestamp?

Not applicable

Hi Everyone,

I wanted to log the timestamp of the request and response which was sent from the service callout policy. I couldn't find the proper system variable reference to use it. I know there are apigee system variables for accessing the client and target, request sent (e.g. target.sent.end.timestamp) and response received (e.g. target.received.end.timestamp).

Similarly is there any apigee system variable for accessing the service callout policy request sent and response received timestamp.

Thanks,

Anand

Solved Solved
2 7 1,384
1 ACCEPTED SOLUTION

You could use the following flow-variable.

apigee.metrics.policy.<policy name>.timeTaken

The value is the time taken by the policy (in your case Service-Callout) in nano-seconds. Al though this won't give you sent/received timestamp, it gives total time time-taken. If you are specifically interested in the start/end time, use JavaScript policies before and after your Service-CallOut policy.

View solution in original post

7 REPLIES 7

You could use the following flow-variable.

apigee.metrics.policy.<policy name>.timeTaken

The value is the time taken by the policy (in your case Service-Callout) in nano-seconds. Al though this won't give you sent/received timestamp, it gives total time time-taken. If you are specifically interested in the start/end time, use JavaScript policies before and after your Service-CallOut policy.

we did try that javascript thing but its not that accurate. I felt like this feature should be available to access the request and response timestamp for service callout policy.?

Ok. I will create a feature-request to provide variables for this. Thanks!

@sudheendra: Thanks! That would be great to have in apigee.

hi @sudheendra: is there any feature providing serviceCallout start and end time stamp? ServiceCallOut TimeTaken currently gives time taken by this policy and not time spent by end service.

Hello @sudheedras,

is the feature-request to provide start/end time variables for service callout complete? could'nt find any variables for SC start/end time in the documentation...
Please advise,

you can use javascript for recording the timestamp and then evaluate.