need help with a logging policy for timestamps -CLOUD

Not applicable

I'm trying to get the response + request for the total time it takes for each request. i'm using this for a message logging policy on a cloud instance of Apigee Edge. I used a javascript policy to get the variables for timestamps but I keep getting "null" failures

here is my code



var isoSystemTimeStamp = new Date(context.getVariable("client.received.start.timestamp")).toISOString(); context.setVariable("loggingIsoSystemTimeStamp", isoSystemTimeStamp);
Solved Solved
0 3 304
1 ACCEPTED SOLUTION

Not applicable

found it

apigee.metrics.policy.JavaScriptSetTotalRequestTime.timeTaken


thanks @Maruti Chand for the push

View solution in original post

3 REPLIES 3

Not applicable

Hi @Ben Rodriguez, That should work.
Do you see client.received.start.timestamp in the Analytics data recorded?
Where did you attach your policy?

I was testing this against my oauth policy and it itsn't working. i placed it at the end of the request.

Not applicable

found it

apigee.metrics.policy.JavaScriptSetTotalRequestTime.timeTaken


thanks @Maruti Chand for the push