Unable to consume Metrics API for developer app

Hi Team,

I am trying to start exploring the Apigee metrics API to integrate with our service to serve the Metrics on our own dashboards. 

When i start executing one of the requests to get data by devapp, using below API

https://apigee.googleapis.com/v1/organizations/<Org Name>/environments/<ENV>/stats/<Developer App Name>?select=sum(message_count)&timeRange=10/01/2022%2000:00~10/07/2022%2000:00&timeUnit=day

getting below error, 

Invalid query parameter - Field <Developer App Name> not present in schema of <Org Name>~<ENV>
 
And this is the first time i am using these APIs, do i need to enable anything to start using metrics API ? 
And my developer app name has a space, can that be any issue ?? (I hope no, as apigee allows having spaces in the app name) 

I am using Apigee X. 

Please help on this to move forward. 
 
Thanks in advance! 
Solved Solved
0 3 456
1 ACCEPTED SOLUTION

The API is for retrieving environment level statistics. It looks as if you are trying to retrieve information about a specific app. It does not work that way.

Take a look at the docs over at:

https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.stats/...

The last segment in the path

 

organizations/{org}/environments/{env}/stats/{dimensions}

 


is for specifying a comma separated list of "dimensions". The dimensions themselves are the names of the fields by with you want to group-by the result (metrics).

Here is a list of dimensions you can use:

https://cloud.google.com/apigee/docs-preview/api-platform/analytics/analytics-reference?hl=en#dimens...

So, in your case, you would not put the ID/name of the app itself. Instead you would use the "developer_app", or "client_id" dimension (field name).

 

View solution in original post

3 REPLIES 3

The API is for retrieving environment level statistics. It looks as if you are trying to retrieve information about a specific app. It does not work that way.

Take a look at the docs over at:

https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.stats/...

The last segment in the path

 

organizations/{org}/environments/{env}/stats/{dimensions}

 


is for specifying a comma separated list of "dimensions". The dimensions themselves are the names of the fields by with you want to group-by the result (metrics).

Here is a list of dimensions you can use:

https://cloud.google.com/apigee/docs-preview/api-platform/analytics/analytics-reference?hl=en#dimens...

So, in your case, you would not put the ID/name of the app itself. Instead you would use the "developer_app", or "client_id" dimension (field name).

 

Thanks much @miguelmendoza for pointing out the missing thing. Its working as expected. 

I have one follow up question on this, so i see all the APIs under metrics API is giving us the aggregate data only. 

We have a requirement to show the data for the individual call metrics, like response time, response code, and some other stuff for each call that our partner developer would be making to our proxy. 

Do we have different APIs to get such data ? 

Have posted my query as a new thread as this original query for this is resolved 

https://www.googlecloudcommunity.com/gc/Apigee/Apigee-API-to-get-historical-logs-with-API-call-metri...