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

API Proxies Dashboard -Classic Edge UI - how to get Traffic details using API Mangmnt call

Hi,

We are using 4.51.00 OPDK -Classic Edge UI.

Require to record "Traffic" details using API/Management API call.

We are using  4.51.00 OPDK -Classic Edge UI dashboard under "API Proxies" dashboard.

Do we have any API management call to get such details ? could not find in docs to record "Traffic" 

Note: This is not the "Traffic Composition" under the Analytics, but referring to "Traffic column displayed, under Classic Edge UI from "API Proxies" dashboard.

FYI.. other columns shown under Classic Edge UI dashboard in "API Proxies" dashboard.

are "Environments" "Message TRend per hour "Avg Time" "Error Rate" & "Modified" 

Traffic is displayed before  "Modified"  column in the Classic Edge UI under "API Proxies" dashboard

 @dino or @anilsagar  

 

 

 

0 1 253
1 REPLY 1

I think you need to check out the /stats APIs. You can query analytics by proxy.

That "traffic" data available in the classic UI, is driven from the analytics data stream. It's just a different presentation of the data that is also presented in the analytics screens.

The /stats API is pretty extensive, with lots of parameters and options. For sure, consult the reference documentation for the API. But in my experience, it was difficult to translate the reference documentation into how specifically to invoke the API to get the data that you want. One thing that may be helpful in this regard, in guiding you on exactly how to invoke the /stats API to get proxy-specific traffic trends, is the browser devtools. Open the browser developer tools before visiting that tab or column. I cannot remember the Classic UI specifically, so I'm not clear on the visual metaphor. But anyway when you visit that traffic page or whatever it is, the browser itself will send out a call, not directly to the management API, but to the UI Server which then relays the call to the management API. By looking in the network tab of the browser dev tools, you should be able to see the parameters on the call that is sent to the UI server. Those are the same parameters, probably, that you need to send to the /stats API that is accessible from the management server. I say "probably" because the interface between the UI browser-side code and the UI server is not a documented interface for the Apigee product. But in my experience there is a close correspondence between the calls the UI sends to the UI server, and the calls you yourself can send to the management server.

Keep in mind that while the browser devtools will show (pretty much) the /stats API call for a single API proxy, ... if you want to gather data for a set of API proxies, you may be able to change the API call that you send to the mgmt server to request data for a set of proxies, all at once. So use the devtools inspection to give you a starting place. But be sure to check the documentation and experiment to find out what else is possible.

/stats for Apigee Edge

/stats for Apigee X/hybrid

As an example for Apigee Edge, here's a representation for how I can query the stats API to get latency data.

 

:org = my-org-name
:env = my-env
:stat = percentile(total_response_time,95),percentile(total_response_time,99)
:timerange = 07/11/2021%2000:00~07/21/2021%2000:00
:timeunit = day

# this will retreive p95 and p99 latency metrics in aggregated form for target and proxy, by day

GET :mgmtserver/v1/o/:org/e/:env/stats/apiproxy?select=:stat&timeRange=:timerange&timeUnit=:timeunit&limit=1024&_optimized=js&t=agg_percentile
Authorization: Bearer :edge-token

 

It's possible for you to restrict that call and ask for data for a subset of proxies if you like.