Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Need to get an simple method to calculate exact apigee latency and target latency for an api call.

How to get the complete apigee latency for an api call and the target latency for the same call within apigee to use them to send it to our splunk logging.

Solved Solved
0 5 247
1 ACCEPTED SOLUTION

Hi @dpkt !

1. As far as I remember, cloud console provides some reports that reflect the latencies.

Latency analysis dashboard

2. beyond that, you can use the following variables, some of them are the same that the built-in metrics use.

https://cloud.google.com/apigee/docs/api-platform/reference/variables-reference

  2.1. client.received.* and client.sent.* flow variables
  2.2 target.received.* and target.sent.* flow variables

By getting the values of these variables, you will be able to calculate your own latency figures.

Please be aware of the followings

1. target.* variables are not always populated, even if the the target-request-flows are reached. This can happen when 5xx response is generated, eg. the Apigee couldn't connect to the target server etc. You should check these scenarios thoroughly.

2. You can overcome the aforementioned issue by creating some custom variables in which you save the value of the actual timestamp, by using variable system.time.*

> If you save this value in the very last step in the request-flow, you would have an approximate timestamp of the target.sent.* variable / aka. the apigee request flow has finished, even if the request was not forwarded formally to the target server.

> by saving it into another variable in the very first point at the default/response flow, you can get the approximate timestamp of the target.received.* variable / aka. the timestamp when apigee response flow has started.

3. some variables are specific, and can be accessed only in the postClientFlow

For further info, please review the Flow variables reference, or some earlier discussion in this topic

https://www.googlecloudcommunity.com/gc/Apigee/How-to-calculate-processing-time-in-apigee/m-p/431155

Please let me know in case you have more questions.
Cheers,
Marcelo

View solution in original post

5 REPLIES 5

Hi @dpkt, thank you for posting your question. To help others assist you more effectively, it might be helpful to provide additional details about your setup or the context of your question. This can give other members a clearer understanding and enable them to provide more accurate assistance.

We’ll keep an eye on the conversation and encourage others in the community to share their insights and solutions with you. 😉

Hey @AlexET,

Let me rewrite my question.
I need to calculate to the apigee latency (time taken by apigee proxy) and the target latency (time taken by target) for an api call and need to assign those values to a flow variable. How can i achieve that?

Hi @dpkt !

1. As far as I remember, cloud console provides some reports that reflect the latencies.

Latency analysis dashboard

2. beyond that, you can use the following variables, some of them are the same that the built-in metrics use.

https://cloud.google.com/apigee/docs/api-platform/reference/variables-reference

  2.1. client.received.* and client.sent.* flow variables
  2.2 target.received.* and target.sent.* flow variables

By getting the values of these variables, you will be able to calculate your own latency figures.

Please be aware of the followings

1. target.* variables are not always populated, even if the the target-request-flows are reached. This can happen when 5xx response is generated, eg. the Apigee couldn't connect to the target server etc. You should check these scenarios thoroughly.

2. You can overcome the aforementioned issue by creating some custom variables in which you save the value of the actual timestamp, by using variable system.time.*

> If you save this value in the very last step in the request-flow, you would have an approximate timestamp of the target.sent.* variable / aka. the apigee request flow has finished, even if the request was not forwarded formally to the target server.

> by saving it into another variable in the very first point at the default/response flow, you can get the approximate timestamp of the target.received.* variable / aka. the timestamp when apigee response flow has started.

3. some variables are specific, and can be accessed only in the postClientFlow

For further info, please review the Flow variables reference, or some earlier discussion in this topic

https://www.googlecloudcommunity.com/gc/Apigee/How-to-calculate-processing-time-in-apigee/m-p/431155

Please let me know in case you have more questions.
Cheers,
Marcelo

Hi @MarciSoos, thank you so much for taking the time to provide such a detailed and thoughtful response to this question. Contributions like yours are what make this community so special, and we truly appreciate your engagement. 😉

Thanks @MarciSoos@AlexET.