Analytics data not being displayed on dev portal

Hi @Arun Kumar, @Anil Sagar,

I have installed a new AIO instance of on prem edge(4.17.05) on one box and dev portal on another box. I have created an app developer account and have called a few APIs using the credentials of that app. Now when I want to see data against that developer app in edge I am able to see that but the same data does not appear when I want to see it from dev portal UI. I referred below link for help -

https://community.apigee.com/questions/25396/dev-portal-analytics-nots-showing-any-report-or-da.html

I can see in the Reports -> Recent log message section that the API call being made from portal to edge and returns 200 ok but it does not return any data along with it. I am not sure what is the issue here.

Any help will be great help.!

Regards,

Santosh

Solved Solved
0 7 623
1 ACCEPTED SOLUTION

Hi,

I worked with apigee support on this and found that the organization name we have given is in uppercase and when apigee stores analytics details for a particular developer in the database it uses the org name(to which the developer belongs) in lowercase. So a few interconnected things cause a problem here as explained below.

1. Assume that we have our org name as 'SAMPLEORG' and we have created a developer called 'android_developer'.

2. When we configure developer portal then we need to give org name as is since it is case sensitive.

3. While storing analytics for this developer postgres stores developer name in a typical format like - orgname@@@<system generated developerId. And here the org name is stored in lowercase e.g. - sampleorg@@@AAAbxjryeiFc

Now when developer portal makes a call to retrieve analytics data for this developer, it refers to the org name configured in uppercase and sends the developer id as SAMPLEORG@@@AAAbxjreiFc and that gives a 200 response with no data since there is not data for this developer.

This is a bug in the on prem version 4.17.05 and as per apigee's reponse, it will be fixed in next release. Temporary work around is to avoid using uppercase org names and if you have already created org with uppercase then you should hardcode the org name in the script in dev portal that fetches analytics from edge as show below -

File Name - /opt/apigee/apigee-drupal-contrib/libraries/mgmt-api-php-sdk/Apigee/ManagementAPI/DeveloperAppAnalytics.php

Line to be replaced -

$params['filter'] = "(developer eq '$orgname@@@$devId')";

replace the org name variable with actual org name in lowercase.

$params['filter'] = "(developer eq 'sampleorg@@@$devId')";

Thank you @NICOLA for all the help to get this resolved.

Regards,

Santosh

View solution in original post

7 REPLIES 7

Hi @Anil Sagar, @Arun Kumar

Can you please help here.

Thanks,

Santosh

Not applicable

@santosh_ghalsasi I was unable to reproduce the issue on my local 4.17.05 devportal install. I suspect that devportal is querying the wrong environment and hence displaying no results. Could you please navigate to Configration -> Devportal -> Application Settings -> Expand App Performance Settings and select the expected environment and save the settings. Please save the settings even if it appears that the expected environment has been selected. Clear cache and see if this helps.

If you continue to see the issue, could you report back with the error you see and the query that you see in recent logs.

Hi @Arun Kumar ,

Thank you for the reply. I tried the steps you suggested and still getting same error. in the logs I observed that the API call that is being made to edge to retrieve the data is as below -

GET /v1/o/<org>/environments/<env>/stats/apps?timeRange=08%2F13%2F2017%2009%3A15~08%2F18%2F2017%2009%3A15&timeUnit=day&sortby=error_count&sort=ASC&_optimized=js&select=error_count&filter=%28developer%20eq%20%27<developer_name>%27%29&developer_app=<app_name>

But I see that the developer name is not being populated correctly here. Instead there is a string like org name + some junk text getting populated in the filter section of the call. This is causing the issue I believe. Do we have any option to correct this?

Thanks,

Santosh

Hi @Anil Sagar , @Chris Novak, @Daniel Johnson,

Can you please help here.

Thanks,

Santosh

It worked as in my case, it was wrong env which was being sent.

Hi,

I worked with apigee support on this and found that the organization name we have given is in uppercase and when apigee stores analytics details for a particular developer in the database it uses the org name(to which the developer belongs) in lowercase. So a few interconnected things cause a problem here as explained below.

1. Assume that we have our org name as 'SAMPLEORG' and we have created a developer called 'android_developer'.

2. When we configure developer portal then we need to give org name as is since it is case sensitive.

3. While storing analytics for this developer postgres stores developer name in a typical format like - orgname@@@<system generated developerId. And here the org name is stored in lowercase e.g. - sampleorg@@@AAAbxjryeiFc

Now when developer portal makes a call to retrieve analytics data for this developer, it refers to the org name configured in uppercase and sends the developer id as SAMPLEORG@@@AAAbxjreiFc and that gives a 200 response with no data since there is not data for this developer.

This is a bug in the on prem version 4.17.05 and as per apigee's reponse, it will be fixed in next release. Temporary work around is to avoid using uppercase org names and if you have already created org with uppercase then you should hardcode the org name in the script in dev portal that fetches analytics from edge as show below -

File Name - /opt/apigee/apigee-drupal-contrib/libraries/mgmt-api-php-sdk/Apigee/ManagementAPI/DeveloperAppAnalytics.php

Line to be replaced -

$params['filter'] = "(developer eq '$orgname@@@$devId')";

replace the org name variable with actual org name in lowercase.

$params['filter'] = "(developer eq 'sampleorg@@@$devId')";

Thank you @NICOLA for all the help to get this resolved.

Regards,

Santosh

Thank you @santosh_ghalsasi for posting the answer in the community. Its definitely helpful for others. Way to go !!