Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow owner to select the API they are viewing the analytics for #999

Closed
5 tasks done
bajiat opened this issue Jun 1, 2016 · 32 comments
Closed
5 tasks done

Allow owner to select the API they are viewing the analytics for #999

bajiat opened this issue Jun 1, 2016 · 32 comments
Assignees
Milestone

Comments

@bajiat
Copy link
Contributor

bajiat commented Jun 1, 2016

The main user of the dashboard is an API owner who checks the dashboard for performance and to get insight into API usage. When API owner is viewing the dashboard, they should also be able to define or select an API they see analytics for (from their APIs)

User story

As an API owner
I want to determine which API I want to see the analytics for
so that I can gain insight on single API usage

Design

  • Selected API
    apinfanalyticsselectedapi
  • API selection
    apinfanalyticsapiselection

Definition of done

  • User has a method for selecting a single API on dashboard page
  • Based on the user selection, dashboard charts (and table) get updated
  • User can easily select another API for viewing the analytics
  • User interface clearly indicates what API you are looking at (vs. looking at all APIs)
  • Optionally, user can switch back to all APIs owned by this particular owner

Resources

@Nazarah
Copy link
Contributor

Nazarah commented Jun 14, 2016

Is there any case that user wants to see multiple APIs? for comparison purpose?

@bajiat
Copy link
Contributor Author

bajiat commented Jun 20, 2016

See Brylie's support request and Nick's answer to it: NREL/api-umbrella#252

@brylie
Copy link
Contributor

brylie commented Jul 4, 2016

@frenchbread will you be taking this task forward?

@brylie brylie modified the milestones: Sprint 26, Sprint 25 Jul 4, 2016
@frenchbread
Copy link
Contributor

frenchbread commented Jul 4, 2016

Yes.

@brylie
Copy link
Contributor

brylie commented Jul 4, 2016

This is number one priority. High priority and urgent. It blocks several other tasks.

@frenchbread
Copy link
Contributor

Got it.

@frenchbread
Copy link
Contributor

frenchbread commented Jul 4, 2016

Currently the URl for making requests looks like <host>/<prefix>/<api_id>?api_key=<api_key>. Should I make filtering by <api_id> directly?

@brylie
Copy link
Contributor

brylie commented Jul 4, 2016

Generally, an API owner will need to see the API Name. However you link the API Name to the filter is up to you. E.g. if API ID is easiest, go with it, but make sure the end-user has an intuitive way to filter the dashboard.

@frenchbread
Copy link
Contributor

frenchbread commented Jul 4, 2016

Actually now, when sending custom requests (with api backend id in the URL) there are only 404 responses. I'm not sure how did we manage to add API Id to the request URL but it won't work that way I thing because now API Id is represented in URL as a separate page - not as a parameter.

@frenchbread
Copy link
Contributor

One more question: If there is no API selected, should we show anything?
Possible scenarios:

  • Showing "Select API to view analytics for" message with no data
  • Showing analyrics data for all APIs managed by current user
  • Something else (like the entire analytics in ES) - maybe for admin view

@brylie
Copy link
Contributor

brylie commented Jul 4, 2016

I like the second option, showing analytics for multiple/all API Backends.

We can also consider having a multi-select box, so that an Administrator or API Owner can select multiple API Backends. I have added Bootstrap Select to a project recently, and it is easy to use.

@brylie
Copy link
Contributor

brylie commented Jul 4, 2016

One short-term goal here is to try and share most of the Dashboard code/functionality between Administrators and API Owners.

@frenchbread
Copy link
Contributor

Cool. Yea, that is possible. What about using API Id in the URL then?

Actually now, when sending custom requests (with api backend id in the URL) there are only 404 responses. I'm not sure how did we manage to add API Id to the request URL but it won't work that way I thing because now API Id is represented in URL as a separate page - not as a parameter

@brylie
Copy link
Contributor

brylie commented Jul 4, 2016

If API ID works, go for it. We just need to show the end-user the API Name, so they understand what they are seeing.

@frenchbread
Copy link
Contributor

frenchbread commented Jul 4, 2016

It works but response is 404, because API ID is provided not as a query parameter

@frenchbread
Copy link
Contributor

That's what I mean.

No API selected:

screen shot 2016-07-04 at 16 38 40

API selected:

screen shot 2016-07-04 at 16 38 55

In scope of this issue it works though.

@brylie
Copy link
Contributor

brylie commented Jul 5, 2016

As per the discussion with Nick (@GUI) and your observations, using the the API ID won't work for analytics queries. It was suggested that we filter by the 'path' or 'frontend_prefix'.

How are you filtering the API?

@brylie
Copy link
Contributor

brylie commented Jul 5, 2016

The UI looks good by the way.

@Nazarah
Copy link
Contributor

Nazarah commented Jul 5, 2016

I have a suggestion. Can we only show the 3XX, 4XX and 5XX requests in the HTTP status code chart with bigger bars. Currently they look small. Also I was thinking that is it necessary to keep the 2XX status bar there? because we are already will be showing success rate if API calls in overview information. SO the HTTP Status code chart should focus on issues other than 2XX.
If you wish to keep interactiveness of all the chart with each other, I'd suggest to increase the unit size for measuring 3XX, 4XX and 4XX so their corresponding bars appear bigger.

@brylie
Copy link
Contributor

brylie commented Jul 5, 2016

One challenge about making the 3, 4, and 5xx bars larger with respect to the 2xx bars, is that there are sometimes 'orders of magnitude' fewer requests with 3xx, 4xx, or 5xx codes. E.g. there may be:

  • 1,000 requests with 2xx status code
  • 100 requests with 4xx status codes
  • 10 requests with 5xx status code
  • 1 request with 3xx status code

This type of situation is where a logarithmic scale becomes useful.

Picture of a logarithmic scale

@frenchbread can we configure the HTTP Status Codes chart to use a logarithmic scale (d3.js) for the request counts axis?

@frenchbread
Copy link
Contributor

I'm filtering charts by API Id now. It works, but I can switch to frontend_prefix if needed.

@frenchbread
Copy link
Contributor

I think we can configure the HTTP Status Codes chart to use a logarithmic scale but is separate issue.

@brylie
Copy link
Contributor

brylie commented Jul 5, 2016

@Nazarah would you please open an enhancement for the HTTP Status Codes chart? I can add details about the logarithmic axis, if you will add your initial reasoning.

@brylie
Copy link
Contributor

brylie commented Jul 5, 2016

@frenchbread where are you getting the API ID from? If we cannot query Elastic by API ID, then perhaps frontend_prefix is more consistent with what the user would see. How difficult would it be to use frontend_prefix?

@frenchbread
Copy link
Contributor

frenchbread commented Jul 5, 2016

@brylie If you look at the screenshots above, in the table there is a row with request_path value. API ID is populated there.

It won't be more difficult to use frontend_prefix for filtering.

@brylie
Copy link
Contributor

brylie commented Jul 5, 2016

OK, so does the API ID in the screenshot (/soundcloud/{{ API ID }}/ ) come from the Apinf database or API Umbrella?

@frenchbread
Copy link
Contributor

Yes, and that's why when I send sample requests they return 404.

@brylie
Copy link
Contributor

brylie commented Jul 5, 2016

OK, just use the frontend_prefix. Lets forget about the API ID for now.

@frenchbread
Copy link
Contributor

Updated filtering to use front-end prefix instead of API id.

@brylie
Copy link
Contributor

brylie commented Jul 5, 2016

Cool beans. Let me know when this is ready for review.

@frenchbread
Copy link
Contributor

OK, I'm now going to add filtering for "default selection" - combined analytics for all APIs owned by a user.

@brylie
Copy link
Contributor

brylie commented Jul 6, 2016

@frenchbread good idea 😄

@55 55 closed this as completed in #1282 Jul 8, 2016
@55 55 removed the in progress label Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants