0
votes

I use independent wso2 API manager 1.10.0 and wso2 DAS 3.0.0 on AWS ec2 to gather statistics of my API usage and I use postgresql to be external RDBMS to store summary data.

APIM configurations on Admin-Dashboard

Event Receiver Configurations :

tcp://DAS-IP:7611

Data Analyzer Configurations :

https://DAS-IP:9443

Statistics Summary Datasource :

My-postgresql-url

APIM configuration in api-manager.xml

Disable rest client and enable RDBMS client

DAS configuration

Set datasource WSO2AM_STATS_DB in master-datasources.xml

Scenario

  1. Login to APIM publisher

  2. Deploy sample API

  3. Go to APIM store

  4. Subscribe sample API

  5. Go to APIM publisher

  6. Click statistics > API usage

  7. Only show example statistics page.

APIM Logs

[2016-04-22 06:12:47,787]  INFO - EmbeddedRegistryService Configured Registry in 0ms

[2016-04-22 06:12:48,015]  INFO - CarbonAuthenticationUtil '[email protected] [-1234]' logged in at [2016-04-22 06:12:48,015+0000]

[2016-04-22 06:12:48,360]  INFO - CarbonAuthenticationUtil '[email protected] [-1234]' logged in at [2016-04-22 06:12:48,359+0000]

[2016-04-22 06:12:48,605]  INFO - CarbonAuthenticationUtil '[email protected] [-1234]' logged in at [2016-04-22 06:12:48,605+0000]

[2016-04-22 06:12:48,664]  INFO - CarbonAuthenticationUtil '[email protected] [-1234]' logged in at [2016-04-22 06:12:48,664+0000]

[2016-04-22 06:12:48,920]  INFO - CarbonAuthenticationUtil '[email protected] [-1234]' logged in at [2016-04-22 06:12:48,920+0000]

[2016-04-22 06:12:49,296]  INFO - API Initializing API: admin--CalculatorAPI:v1.0

[2016-04-22 06:13:05,384]  INFO - **ReceiverGroup Resending the failed published data...**

DAS Logs

[2016-04-22 04:09:00,218]  INFO {org.wso2.carbon.databridge.core.DataBridge} -  user admin connected

[2016-04-22 04:09:32,439]  INFO {org.wso2.carbon.databridge.core.DataBridge} -  user admin connected

[2016-04-22 04:09:47,474]  INFO {org.wso2.carbon.databridge.core.DataBridge} -  user admin connected

[2016-04-22 04:33:10,239]  INFO {org.wso2.carbon.databridge.core.DataBridge} -  user admin connected

[2016-04-22 04:35:28,672]  INFO {org.wso2.carbon.databridge.core.DataBridge} -  user admin connected

[2016-04-22 06:05:18,848]  INFO {org.wso2.carbon.databridge.core.DataBridge} -  user admin connected

[2016-04-22 06:12:53,017]  INFO {org.wso2.carbon.databridge.core.DataBridge} -  user admin connected

[2016-04-22 06:13:09,173]  INFO {org.wso2.carbon.databridge.core.DataBridge} -  user admin connected

DAS WSO2_STATS_DB status

From DAS dashboard > configure > data sources,I've checked the status of all DB is active and tested connection is healthy.


I don't know if WSO2AM_STATS_DB doesn't support postgresql or my configuration gets something wrong.

thanks

1
Apparently data has been received by DAS, could you check DAS tables and make sure stats have been persisted?Tharik Kanaka
WSO2AM_STATS_DB supports for postgresql. Have you check the content of that database?Abimaran Kugathasan
To Tharik Kanaka and Abmaran Kugathasan: I check the WSO2-STATS-DB has 8 tables , but no any content there. API_DESTINATION_SUMMARY API_FAULT_SUMMARY API_REQUEST_SUMMARY API_Resource_USAGE_SUMMARY API_RESPONSE_SUMMARY API_VERSION_USAGE_SUMMARY API_THROTTLED_OUT_SUMMARY API_LAST_ACCESS_TIME_SUMMARY羊湯姆
I modified the mysql.sql in APIM_HOME>dbscripts>STAT>sql>mysql.sql to be postgresql.sql , and import successfully.羊湯姆
I've checked DAS Data exploer, I can see all tables I created for WSO2_STATS_DB, but still no content there.羊湯姆

1 Answers

1
votes

I raised a public jira for the APIM Stat scripts folder does not have the PostgreSQL script.

APIM does not publish subscription events to the DAS. Subscription details are kept in the WSO2AM_DB database and we used AM_SUBSCRIBER and AM_SUBSCRIPTION table for that purpose.

Hope you followed this documentation.