Troubleshoot Analytics

This section describes the steps to troubleshoot issues you run into viewing the Analytics Dashboard.
This section describes the steps to troubleshoot issues you run into viewing the Analytics Dashboard.
To ascertain that Real-Time analytics is functioning correctly, click the Monitor tab on the CA API Portal dashboard. The Real-time analytics page must show the navigation pane, Create a new Dashboard button, and the Latency, Errors, Apps, APIs, and Dashboard graphs.
To troubleshoot Portal Analytics issues, administrator has to ensure that the analytics server is up and running. If the Analytics Dashboard is not visible, it could be because of the following possible issues:
Symptom:
Clicking the Monitor tab on the CA API Portal Dashboard displays the following error:
Unable to fetch analytics data. Please contact Portal Administrator.
Solution:
The JARVIS_URL or the JARVIS_MIDDLEWARE_URL variables are configured incorrectly in the 
portal.config 
file.
Symptom:
 
Blank screen appears after launching analytics form CA API Portal Dashboard.
Solution:
 
The issue may be due to one of the following failures:
  • Jarvis Product Onboarding
  • Jarvis Tenant Onboarding
  • LDDS Product Onboarding
  • LDDS Tenant Onboarding
To determine the issue, perform the following steps:
  1. Run the following command to verify that the entire Portal stack is up and running.
    docker ps
    Check all the containers are up and running. There should be 21 containers in all 12 Portal containers, and 9 Jarvis and LDDS containers. 
  2. Ensure that the following Jarvis containers are up and running, and all the corresponding ports are exposed.
    docker_elasticsearch_1 0.0.0.0:9200->9200/tcp 9300/tcp docker_apis_1 0.0.0.0:8080→8080/tcp docker_ldds_1 0.0.0.0:18080→8080/tcp
  3. Run the following commands to verify if the analytics container or TPS container is printing any errors in the logs:
    docker service logs portal_analytics-server
  4. Run the the following curl commands on your local host to determine where the issue is, and then check the corresponding endpoints. For example, if Jarvis tenant is not onboarded correctly, verify the corresponding endpoints and restart the Portal stack.
    1. To fetch the analytics data, run the following curl command that returns the total count of analytics record:
      curl <ES_URL>/ca_<portal name>_api_metrics_1.1/_count?pretty
      The sample response must be as follows:
      { "count": 5, "_shards": { "total": 1, "successful": 1, "failed": 0 } }
    2. To fetch the Jarvis product that is onboarded on Jarvis, run the following curl command:
      curl <JARVIS_URL>/onboarding/products%28product_id%3D%27ca_<portal name>%27%29
      The sample response must be as follows:
      { "product_id": "ca_<portal name>", "product_name": "APIM Portal Analytics" }
    3.  To fetch the Jarvis product that is onboarded on JARVIS_MIDDLEWARE_URL, run the following curl command:
      curl <JARVIS_MIDDLEWARE_URL>/LDDS-rest/onboarding/product/ca_<portal name>
      The sample response must be as follows:
      { "id": 1, "productCode": "ca_<portal name>", "jarvisUrl": "http://apis:8080", "googleMapKey": "", "docTypeFilter": "(api_[0-9].[0-9]|application|tenant|organization|account_plan)" }
    4. To fetch Jarvis tenants that are associated with Jarvis product in Jarvis, run the following curl command:
      curl <JARVIS_URL>/onboarding/tenants%28product_id%3D%27ca_<portal name>%27%29
      The sample response must be as follows:
      { "tenants": [ { "tenant_id": "d790dc77-fad8-11e6-9a60-0242ac11000f", "product_id": "ca_<portal name>", "tenant_details": { "tenantName": "apim", "portalName": "CA Technologies Developer Network", "retention_period": 365 } }, { "tenant_id": "apim", "product_id": "ca_<portal name>", "tenant_details": { "retention_period": 365 } } ] }
    5. To fetch Jarvis tenants that are associated with Jarvis product in JARVIS_MIDDLEWARE_URL, run the following curl command:
      curl <JARVIS_MIDDLEWARE_URL>/LDDS-rest/onboarding/product/ca_<portal name>/tenant
      The sample response is as follows:
      [ { "id": 28, "productId": 0, "tenantCode": "d790dc77-fad8-11e6-9a60-0242ac11000f", "ana": "ingress", "productAdminRoleName": "PA", "adminRoleName": "TA", "userRoleName": "OA", "adminUserGroup": { "id": 0, "tenantId": 28, "name": "TA", "privilege": "{\"viewlet\": {\"public\": {\"edit\": true, \"view\": true, \"delete\": true}, \"private\": {\"edit\": true, \"view\": true, \"delete\": true}}, \"dashboard\": {\"public\": {\"edit\": true, \"view\": true, \"delete\": true}, \"private\": {\"edit\": true, \"view\": true, \"delete\": true}},\"masthead\":{\"product\":{\"edit\":false,\"view\":true},\"tenant\":{\"edit\":true,\"view\":true}}}", "default": false }, "userGroup": { "id": 0, "tenantId": 28, "name": "OA", "privilege": "{\"viewlet\": {\"public\": {\"edit\": false, \"view\": true, \"delete\": false}, \"private\": {\"edit\": true, \"view\": true, \"delete\": true}}, \"dashboard\": {\"public\": {\"edit\": false, \"view\": true, \"delete\": false}, \"private\": {\"edit\": true, \"view\": true, \"delete\": true}},\"masthead\":{\"product\":{\"edit\":false,\"view\":true},\"tenant\":{\"edit\":false,\"view\":true}}}", "default": true }, "productAdminUserGroup": { "id": 0, "tenantId": 28, "name": "PA", "privilege": "{\"viewlet\": {\"public\": {\"edit\": true, \"view\": true, \"delete\": true}, \"private\": {\"edit\": true, \"view\": true, \"delete\": true}}, \"dashboard\": {\"public\": {\"edit\": true, \"view\": true, \"delete\": true}, \"private\": {\"edit\": true, \"view\": true, \"delete\": true}},\"masthead\":{\"product\":{\"edit\":true,\"view\":true},\"tenant\":{\"edit\":true,\"view\":true}}}", "default": false } } ]
      Note:
      We assume that you have not over written the JARVIS_PRODUCT_ID environment variable. If yes, replace ‘ca_<portal name>’ in the curl request with the overridden value. Also, ensure that the local docker has a RAM allocation of minimum 8 GB.
Symptom
:
Navigation bar is visible, but the analytics Dashboard is not visible on CA API Portal.
Solution:
All the onboardings are correct but the Canned dashboard onboarding did not happen correctly. Restart the entire Portal stack.