apinf / platform

Apinf - Open source API management platform with multi proxy and protocol support
https://apinf.com/
European Union Public License 1.1
74 stars 33 forks source link

API Umbrella 0.14.0 : Dashboard analytics not shown after successful API call #2450

Closed saralavanip closed 7 years ago

saralavanip commented 7 years ago

Purpose: Testing 'API Umbrella 0.14.0' on nightly.apinf.io

Steps

1.Visit https://nightly.apinf.io (v 0.42.0)
2.Login as admin
3.Add new API
4.Connect API to proxy: 'API Umbrella 0.14.0' 5.Get API key
6.Call API
7.Check analytics

Findings

Analytics not shown after successful API call, shows user info text "Fetching latest data..."

Screenshot

call_api_new_proxy

bajiat commented 7 years ago

@brylie Task is to investigate. Let's re-estimate and perhaps re-assign based on your investigation.

brylie commented 7 years ago

In trying to reproduce this issue, I encountered an error when trying to log in to our API Umbrella instance:

Secure Connection Failed

An error occurred during a connection to metatavu-restapi-proxy1.apinf.io:80. SSL received a record that exceeded the maximum permissible length. Error code: SSL_ERROR_RX_RECORD_TOO_LONG

    The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
    Please contact the website owners to inform them of this problem.

peek 2017-05-17 10-41

I would like to log in to https://nightly.apinf.io:3004/, so that I can verify that the API created on APInf is also created on API Umbrella 0.14.x deployment.

cc: @shaliko @bajiat

shaliko commented 7 years ago

@saralavanip Issue fixed.

The issue was that I used own GitHub OAuth app credentials for setup second api-umbrella (0.14.0). Thanks @brylie for help me fix it.

brylie commented 7 years ago

After gaining access to the Nightly API Umbrella 0.14, I see there are two configured API Backends:

screenshot_20170517_114119

I added the Analytics Test backend. Next, I will make some calls to that endpint to see if analytics are recorded.

brylie commented 7 years ago

Request works

Making a request to the Analytics Test endpoint works properly, returning the Google search page that is configured as the backend:

screenshot_20170517_114434

Analytics work

API Umbrella records analytic(s) for the request(s) to the /analytics-test/ endpoint:

screenshot_20170517_114711

brylie commented 7 years ago

Dashboard errors

The APInf dashboard view for the Analytics Test endpoint behaves as described in the issue, stopping during the Fetching data phase.

screenshot_20170517_115046

Console errors

Several messages appear in the browser console.

getElasticSearchData method

Exception in delivering result of invoking 'getElasticSearchData': TypeError: Cannot read property 'hits' of undefined

Elasticsearch

details: undefined
error:  "[query_phase_execution_exception] Result window is too large, from + size must be less than or equal to: [10000] but was [50000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter."
errorType: "Meteor.Error"
message: "[[query_phase_execution_exception] Result window is too large, from + size must be less than or equal to: [10000] but was [50000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.]"
reason: undefined

For readability:

"[query_phase_execution_exception] Result window is too large, from + size must be less than or equal to: [10000] but was [50000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.

brylie commented 7 years ago

This seems to be related to our hard-coded query limit.

We have work-in-progress to refactor the Dashboard code, including removing the 50,000 result limit:

A stop-gap solution would be to remove the hard-coded limit while refactoring the Dashboard.

cc: @bajiat @frenchbread @marla-singer

bajiat commented 7 years ago

Closing, since we are re-making the dashboard without a query limit.

marla-singer commented 7 years ago

@bajiat @brylie Verified it in a new Dashboard and it works as expected joxi_screenshot_1504862215531