Error occured while getting API in WSO2 APIM with BAM - wso2

I'm new to WSO2 products and I was trying to set up the API statistics by configuring APIM with BAM as said in this documentation for publishing the stats https://docs.wso2.com/display/AM170/Publishing+API+Runtime+Statistics#PublishingAPIRuntimeStatistics-point3.
However every time I try to configure the statistics, start BAM, and re-start APIM I always get an error on the APIM console "Error occured while getting API's".
What does this mean?
Does it mean I have to configure first APIM and BAM before I can make an API and check it's statistics?
I don't get it why following the manual results into something like an error. Is there something wrong with my configuration?

here are few ways to debug whats going wrong. How API-M and BAM integration works is that
API -> publish stats to BAM
BAM stores the stats in Cassandra
BAM uses Hive scripts to analyse the data and write the results to a RDBMS mentioned in master-datasources.xml
I would recommend you to check the number 2. by checking if stats are published to BAM. You can do this by login into the management console of BAM and going to the Analytic section and adding the following script
select * from APIRequestData;
Execute this script and see if any data is returned. If no data is returned then data is not correctly published from API-M to BAM. If data is available here then there is an issue in reading the data from RDBMS to API-M.

I recommend you check the master-datasources.xml file which you edited during configuration. There may be an issue there, if the API Manager cannot connect to its' own database. The datasources given in step 2 of the guide you used are in addition to the existing datasources. If this isn't it, then please provide a stack dump or more detailed error messages. Cheers.

Related

WSO2 API Analytics: From where the data gets into WSO2AM_STATS_DB

I am fairly new with WSO2 products and currently checking on the ApiM and Analytics products.
I am able to configure the WSO2 APIM and Analytics products successfully with SQL database and now able to get the stats as well.
In further exploring, I want to know from where the data gets inserted into various tables inside WSO2AM_STATS_DB.
If its through events, then can some one please throw light on the same.
Thanks
Yes it is though a collection of Siddhi Apps running in APIM Analytics which is based on Stream Processor. You can find corresponding siddhi apps under /wso2/worker/deployment/siddhi-files. Below are the files
APIM_ACCESS_SUMMARY.siddhi
APIM_FAULT_SUMMARY.siddhi
APIM_REQUEST_PROCESSOR.siddhi
APIM_WORKFLOW.siddhi
These are written using Siddhi and here is the link to siddhi query guide if you need to understand.

Disable analzer in WSO2 API Manager

So quick question regarding WSO2 API manager and BAM from what I can tell Bam saves the basic requests to the API manager to the DB and the Publisher then reads from the DB when displaying the stats. At what point in the analyzer part of BAM in action ie Casandra and Hadoop. Or does that just get used if I write my own hive queries?
Thanks
When you integrate WSO2 BAM with API Manager for Analytics following happens.
API Manager publishers data using thrift for BAM.
There are hive scripts which is included in the toolbox. There are scheduled and when they are running summarized data will be inserted into the databases.

WSO2 APIM Analytics Not Showing Any stats

We have setup WSO2 API manager and also APIM Analytics following the below link (https://docs.wso2.com/display/AM200/Configuring+APIM+Analytics)
but we are not able to see any analytical data in publisher or store.
We see the message "Data Publishing Enabled. Generate some traffic to see statistics". However, even after generating the traffic, nothing appears. We also checked in the database and don't see any records added to the database tables.
Can anyone help in getting this issue resolved. Thanks
If you have enabled stat publishing correctly, you should see the following info log in wso2 API Manager side.
INFO {org.wso2.carbon.databridge.core.DataBridge} - user admin
connected {org.wso2.carbon.databridge.core.DataBridge}
You can also check if the data has published to the APIM Analytics node. Do the following.
Log into APIM Analytics management console - https://localhost:9444/carbon
Click on Data Explorer in Main menu.
Select table as 'ORG_WSO2_APIMGT_STATISTICS_PERMINUTEREQUEST'.
You should see data in these tables, if the data has been published.
Basically, Analytics node will summarize the data and save the summarized data in the external database. When showing the data in the publisher and store, it will retrieve those data from the database.
If you are using mysql or any other database apart from h2, you need to point to the same stat database in APIM and Analytics nodes.

WSO2 Governance Service Audit

Is there a way to show entire Audit Log associated to one service in the Service Detail layout instead of having to go search activities & figuring out changes?
Thanks.
As i know, It is not supported yet. You need to search in log file using the service name and found out them. Actually for analysis logs and audit, WSO2 may recommend the BAM server where you want to publish server's audit and log data

WSO2: Greg and ESB with shared registry issue

I follow the guide Governance Partition in a Remote Registry found in WSO2 Documentaton. It seems to work fine but I am facing a strange problem. Let me explain my setup first.
Governance registry instalation
Installed GREG 4.5.3
Set the offset to 1 in order to GREG console mgmt runs on port 9444 (carbon.xml)
Create mysql database "wso2greg_reg" (for local/config/governance registry)
Updated datasource WSO2_CARBON_DB to point to wso2greg_reg database (master-datasources.xml)
Enabled clustering (axis2.xml)
Run GREG server with -Dsetup option in order to create all tables
Enterprise Service Bus instalation
Installed ESB 4.6.0
Set the offset to 2 in order to ESB console mgmt runs on port 9445 (carbon.xml)
Create mysql database "wso2esb_reg" (for local/config registry)
Updated datasource WSO2_CARBON_DB to point to wso2esb_reg database (master-datasources.xml)
Added datasource WSO2_GREG_DB to point to wso2greg_reg database (master-datasources.xml)
Enabled clustering (axis2.xml)
Set registry.xml to mount governance registry using wso2greg_reg database
Run ESB server with -Dsetup option in order to create all tables
My problem is happening when I start the two servers, dependening on which was the first server started I have diferent problems on the console managmenet of the secondly started server.
First case:
I start GREG first and ESB in second. When navigating to ESB Console MGMT, I am unable to add a new Pass Through Proxy, the respetive form is not showing and exceptions are logged to the ESB logs (see logs).
Second case:
I start ESB first and GREG in second. When navigating to GREG Console MGMT, the metadata menu is empty and exceptions are loged to the GREG logs (see logs)
Can someone point me to what I am doing wrong?
You need to create only one mysql database. It is this database that is used in the master-datasources.xml config for both G-Reg and ESB instances. What happens is, the mysql database is used as the central database.
Pls try this out and check if you still encounter the issues mentioned.
Cheers,
Gillian