ropensci / unconf14

Repo to brainstorm ideas (unconference style) for the rOpenSci hackathon.
28 stars 3 forks source link

API status dashboard #3

Open sckott opened 10 years ago

sckott commented 10 years ago

We work with a lot of APIs. Would be nice for developers and users to quickly get an overview of what APIs are up and down, and response times. e.g., every 30 sec rolling window, last hour, last week.

I've made a few of these, but none that great. They'll be a lot of talent in the room to make something more awesomer.

ramnathv commented 10 years ago

It should be pretty straightforward to hook up this bootstrap template with slidify and rCharts to create a nice custom dashboard for all the APIs. I will add more notes to this as i figure out ideas to implement this.

sckott commented 10 years ago

That dashboard looks great @ramnathv

sckott commented 10 years ago

It would be nice to dogfood our own code by doing this in R, but then it all runs slow relative to if we simply pinged the APIs in javascript, Ruby, etc. Perhaps it can be fast enough in R though.

ramnathv commented 10 years ago

The key question to ask is whether the dashboard is for users to be updated about API availability, or are you also going to use it as a continuous testing mechanism.

sckott commented 10 years ago

My first thought was dashboard for API availability, but I suppose it could be used as a way to test. Most of our pkgs have Travis-CI integration, but of course are only tested on new commits/PRs/branches.

mfenner commented 10 years ago

I would like to help with this, and we are planning something similar with the PLOS ALM software. This is an open source API, and there already more than have a dozen sites running the software. My thinking was to use Javascript with Github Pages and Jekyll rather than R.

Maybe we can also come up with some recommendations/best practices for a standard API status response. This would make it easier to build a status page, but could also be included as a function in the R package. The alm software gives this API status response:

{
  "error": null,
  "data": {
    "articles_count": 195,
    "articles_recent_count": 1,
    "sources_disabled_count": 2,
    "alerts_last_day_count": 1,
    "delayed_jobs_active_count": 7,
    "responses_count": 0,
    "events_count": 27695,
    "requests_count": 7,
    "users_count": 1,
    "version": "2.12.1",
    "couchdb_size": 29909090,
    "mysql_size": 294912,
    "update_date": "2014-02-21T21:08:36Z"
  }
}

I like the following fields in a standard API response:

mfenner commented 10 years ago

Dashing is a really nice dashboard that almost works out of the box.

ramnathv commented 10 years ago

Excellent point @mfenner. I think there are two objectives here. One is to ensure that the API is working and two, that the R package is interfacing correctly. Your suggestion will solve the former, and clearly help easier investigation of underlying issues, by disaggregating the API status from the package.

ramnathv commented 10 years ago

Twilio open-sourced their API status tracker, called Stashboard, which seems easy to work with.

sckott commented 10 years ago

@mfenner I have made a mock up using Dashing here: http://rodash.herokuapp.com/roapi_graph (it's not very good) - But I don't think it's particularly flexible (or at least I haven't played with it enough). It would be nice to build in storage of API ping (up/down) and maybe response speed stats so we can show current (last 30 min) and historical data (last week, last month).

@ramnathv thanks for the Stashboard link

mfenner commented 10 years ago

@ramnathv I didn't know about Stashboard, thanks for the link. Stashboard or something similar might be better if you just want to show basic information (API up/down, etc.) in table form, whereas something like dashing is good for a more visual dashboard with more than the basic information.

@sckott I have spent some time with dashing and found it reasonably flexible. But you have to use Ruby (and Sinatra). Maybe we discover other API dashboard "frameworks" that are a better fit. If not then I am happy to help out with dashing.

ramnathv commented 10 years ago

@mfenner I agree that dashing would be nicer to show a visual dashboard of API metrics. I would love to learn more about how to use Ruby to achieve this. I attempted a port of dashing to R, which you can see here: dashifyr

mfenner commented 10 years ago

@ramnathv Sinatra (the Ruby web framework behind dashing) is great to build simple web apps, but can also do complex things (e.g. the CrossRef Metadata Search). I'm happy to discuss more at the hackathon.

For my own Article-Level Metrics project I've built a simple API status dashboard over the weekend using Javascript and Github Pages: http://articlemetrics.github.io/status/. Using d3.js is probably overkill at this stage, but this will allow me to enhance it over time. As this is Github Pages, there is no easy way to store status information, so it gives the API status in realtime. Feel free to adapt for rOpenSci if you find this useful.