Apigee Metrics Analytics - did not capture proxies with traffic

We have Apigee OPDK 4.51.x .

I was looking for querying the deployed proxies, which don't have traffic for  50 days . Got to know two links below.

https://cloud.google.com/apigee/docs/api-platform/analytics/analytics-referenceAnalytics metrics, di...

Above link lists Traffic message_count under Metrics section ( Following are the API metrics you can retrieve in custom reports and management API calls.)

https://cloud.google.com/apigee/docs/api-platform/analytics/use-analytics-api-measure-api-program-pe...

This is Apigee-X link using Metrics API feature and gives listed query to get such information.

curl -v "https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/stats/?select=sum(message_count)&timeRange=03/01/2018%2000:00~03/31/2018%2023:59" \
  -H "Authorization: Bearer $TOKEN

 

curl  https://apigee.googleapis.com/v1/organizations/$ORG/environments/$ENV/stats/apiproxy?"select=sum(message_count)&timeRange=06/20/2018%2000:00~06/21/2018%2023:59" \
  -H "Authorization: Bearer $TOKEN"

 

Using above queries when fired using POSTMAN to apigee OPDK (4.51.x) did gave different result, than what i expected.

Meaning multiple proxies, which were used in a week time ( & to reverify, such client proxies, showed up in Performance Tab with Metric (Traffic) enabled on Edge UI ) . Indicating traffic for proxies in  the graph, hence should be listed by above query result, but it did not list (around approximately 10 proxies, was missing) .

As above query does not list the proxies (which was used in week time) hence, I am not sure, what's the alternative  query or if above query to be modified ? hence it will  query and indicate all proxies in usage, which is my filter criteria to know remaining proxies were not used.

How to make sure, above query lists every proxy which has traffic ?

@dino 

0 2 156
2 REPLIES 2

 

I believe this question is similar to Metrics Analytics API query with one proxy - Google Cloud Community

As mentioned in the other post, you can use 'filters'.
Also, make sure the 'timeRange' field includes the date range for which you need the metrics for.  

Note: If a proxy does not have any traffic during that timeRange, it will NOT be found in the metrics response, and hence in the UI too. Shortly, in order to show up on the UI / metrics API response, the proxy should have atleast one request during that timeRange. 

Reference Edge:  https://docs.apigee.com/api-platform/analytics/analytics-reference#filters
Reference ApigeeX: https://cloud.google.com/apigee/docs/api-platform/analytics/analytics-reference#filters

Thank you for using Apigee!

@iambaskar  Thanks for reply. query for this post was

1) If we use Apigee OPDK and use Google Apigee-X API query and document as a reference (for Metrics API), hopefully that should be fine ? because i was thinking API Management call with Metrics API feature should be supported to ApigeeOPDK/Apigee SaaS/Apigee Hybrid, even its detailed out with curl command in Apigee X document only ? Reason is all these product  uses postgres for analytics and Management API calls is generic and this query should support any Apigee product irrespective..

2) Is there a limit on the result set of the above query, looks like it retrieves only 1000 max results (if I don't set the limit and offset in the query, it returns only 1000 proxies ..

If we have more than 1000 proxies coming into results than we will have to put the limit (to total number of proxies in env ? like eg 3000, hence to cover all proxies results)  please confirm my understanding

@dino