chronograf icon indicating copy to clipboard operation
chronograf copied to clipboard

As a user I can see a status page

Open nhaugo opened this issue 9 years ago • 18 comments

The status page should have:

  • [ ] a bar graph each bar being the number of alerts triggered per day
  • [ ] a list of alerts that triggered
  • [ ] a list populated by an rss feed
  • [ ] two or three graphs

nhaugo avatar May 30 '17 16:05 nhaugo

Use react grid layout for this page

alexpaxton avatar May 30 '17 23:05 alexpaxton

status-page-v1

Notes

  • As mentioned above, use react grid layout
    • Trying to re-use as much as possible
    • Cells should use the existing headers from dashboards
    • Up for discussion: Should cells be resizable and/or draggable?
  • Bar Chart Cell
    • 30 bars divided evenly across the graph (which is why it is full width)
    • Perhaps in the cell context menu, options for different time ranges?
    • TBD how to build the bar graph, might use an existing framework or just hack something together using canvas (math seems simpleish)
    • Gradient scales from x = 0 to the maximum x value, that way the hot spots look hot
  • Newsfeed Cell
    • Takes 1 or more RSS feeds
    • Format each post to be consistent
    • Will eventually have integration with support tickets (users can see updates on their tickets)
    • Needs a little more definition for the initial version of this
  • Getting Started Cell
    • Links to Chronograf Docs
    • Should source content from a markdown file

alexpaxton avatar Jun 01 '17 17:06 alexpaxton

  1. Should the bar graph refresh at a regular interval, like graphs in a dashboard?
  2. Should the other status cells refresh at a regular interval? Or might they subscribe in real-time, such as the Recent Alerts? Will some be static, such as the Guide?
  3. Should a user should able to change the timeRange of their bar graph? And the recent alerts?
  4. For Newsfeed, is there an existing RSS link, or where is that data coming from?
  5. Do we imagine more status cell types going forward?
  6. Will the user be able to Edit or otherwise modify the data (such as a cell query) in any of the cells?
  7. Do we want to be able to view this page in Presentation Mode?
  8. Will Recent Alerts be calculated by the client retrieving all alerts and then slicing, or do we want to write this logic (if it exists, I haven't found it so far) on the server?

jaredscheib avatar Jun 05 '17 20:06 jaredscheib

Basic page and layout is in place: screen shot 2017-06-05 at 7 13 33 pm

jaredscheib avatar Jun 06 '17 00:06 jaredscheib

I haven't used any components from /dashboards because they bring a lot of excess ideas, or LayoutRenderer because that is current written for graphs only, and this page introduces the idea of a Dashboard with subpages. LayoutRenderer could be refactored to accommodate non-graphs, but it also contains a number of other ideas that aren't relevant to non-graphs.

The working branch can be seen at https://github.com/influxdata/chronograf/tree/feature/status_page-1556.

Note on use of Redux here: My thinking so far is to not use Redux for this page, since we will likely want it to refresh frequently, and never show old data. There also isn't any editing in the spec thus far. Alternately, the StatusPage could check redux data for staleness, where Redux would store a timestamp of retrieval of data, and the StatusPage could not display anything older than a certain period of time ago. I'm split on whether to perform AJAX calls from this page, or whether to use Redux actions, even though I've previously been a strong advocate of never doing AJAX in a function. Then again, we do want to use errorThrown, which alone is reason to use Redux. So be it.

jaredscheib avatar Jun 06 '17 00:06 jaredscheib

  • Should the bar graph refresh at a regular interval, like graphs in a dashboard? Yes

  • Should the other status cells refresh at a regular interval? Or might they subscribe in real-time, such as the Recent Alerts? Will some be static, such as the Guide?

Refresh

  • Should a user should able to change the timeRange of their bar graph? And the recent alerts?

Not right now, it should be 30 days for now

  • For Newsfeed, is there an existing RSS link, or where is that data coming from?

TBD I was thinking about using this https://jsonfeed.org/version/1

  • Do we imagine more status cell types going forward?

Best to think of the cells as any graph and this is a dashboard with a default setup

  • Will the user be able to Edit or otherwise modify the data (such as a cell query) in any of the cells? Do we want to be able to view this page in Presentation Mode?

Yes, plan on an rss feed url as a command line option

  • Will Recent Alerts be calculated by the client retrieving all alerts and then slicing, or do we want to write this logic (if it exists, I haven't found it so far) on the server?

Not sure I understand, the alerts should be scoped to the last 30 days, then if a bar is selected the selected day. Assume the user is on a given time frame and we will select the alerts for that time frame.

nhaugo avatar Jun 06 '17 01:06 nhaugo

• For the list initial load should query alerts time > now - 30d limit 30 • At the bottom of the alerts list add a get more • Scroll through results as the keep coming

nhaugo avatar Jun 06 '17 16:06 nhaugo

@alexpaxton what does "Cells should use the existing headers from dashboards" mean

nhaugo avatar Jun 06 '17 16:06 nhaugo

Add title bar controls for refresh and datasource

nhaugo avatar Jun 06 '17 16:06 nhaugo

@nhaugo same "title bar" markup and styles. Includes the context menu (little arrow on the right) in case we add options to a cell, also to ensure the names of cells appear consistent with graph cells

alexpaxton avatar Jun 06 '17 22:06 alexpaxton

And what do you want the url to be for this page, /sources/:id/status or /sources/:id/dashboards/status? In other words, might this be considered a dashboard with a special id?

jaredscheib avatar Jun 07 '17 00:06 jaredscheib

Current status / notes / questions:

  • A query for the last 30 days can take upwards of 10 seconds to load, depending on one's internet connection. Currently I've got a Line Graph at the top of the screen, until a Bar Graph is ready.

  • What do we want the Recent Alerts to display if there are no recent alerts? See the following: screen shot 2017-06-08 at 2 48 29 am

  • Currently in the branch, I've taken a preliminary step toward "widgetizing" the <AlertsApp> container. It'd be great if @alexpaxton could take a look at this and see how we might use styles to accommodate accordingly, as you can see below it only gets us so far. I'm currently just using a simple conditional in the AlertsApp container to either render it as a page or not, but I would suggest that we may want to adopt a pattern of using a HOC called FullPage (or something to that effect) that takes what would otherwise default to a (possibly responsive) widget that fills whatever space it's in, without much borders/padding, and styles it for Full Page. This would be useful to replace a lot of the styles (with <div>s) boilerplate that we have in most all of our containers and possibly some components, and allow us to use the various pages as either smaller widgets or full pages throughout the app, and would preempt the need to use janky conditionals that require redundancy, as can be seen in what I'm currently doing. screen shot 2017-06-08 at 2 49 25 am

jaredscheib avatar Jun 08 '17 07:06 jaredscheib

Next steps for development:

  • [x] Allow more Alerts to be loaded (upon Get More)
  • [x] Fix styling for Alerts widget
    • [ ] Possibly create HOC to be able to widgetize any app/page
  • [x] Newsfeed (JSON RSS)
    • Schema for JSON news feed needs to be decided before continuing JSONFeedReader dev
      • @nhaugo will take care of this
    • ~~Need a proxy endpoint (and respective link) to get JSON feed, or some other solution, per below comment~~ (external link will be passed through from Chronograf server)
    • [x] Implement ENV var for external JSON feed url
    • [x] Get JSON feed data from URL and display on Status Page
    • sample resources: https://daringfireball.net/feeds/json, https://jsonfeed.org/version/1
  • ~~Implement markdown-based guide~~
  • [ ] Review & possibly refactor how cells + LayoutRenderer are coordinating
    • [ ] If we want this data persisted in the future, coordinate with @goller on how to persist data, including whether cells should be used for non-graphs (widgets), and if not, what other endpoint this data might come from, and what the shape of those data will be (currently I'm achieving widgets via a new isWidget prop on the cells in my fixture data, and the ones that don't have that property are assumed to be graphs with queries, but this is understandably problematic given the possible importance of enforcing a strict schema and API for cells)
  • [x] Need BarGraph component
  • [ ] Complete TODOs in NewsFeed (interval polling + conditional update logic) to make it similar to <AutoRefresh> and consider refactoring it slightly into an HOC called IntervalPoller that would wrap JSONFeedReader or other components

jaredscheib avatar Jun 08 '17 08:06 jaredscheib

I think this can be a special case for the url, seems confusing to smash it into dashboards

The query should be fast, it should be something like SELECT sum("value") AS "sum_value" FROM "chronograf"."autogen"."alerts" WHERE time > now() - 720h GROUP BY time(1d)

Recent alerts can say something like there are no alerts please see getting started on how to set them up I will get better verbiage in the future but that should work for now

nhaugo avatar Jun 08 '17 15:06 nhaugo

And @goller, for the news feed, do you imagine that we might add a proxy /status, or possibly /status/jsonfeed API endpoint that gives a JSON feed response object? And then add that API route to the sources/links object? This would accommodate an ENV variable config. And might such a response, or possibly one from /status/gettingstarted (or the like) return a markdown file as a string for the Getting Started section?

jaredscheib avatar Jun 09 '17 03:06 jaredscheib

Current status:

  • Alerts widget has been styled (thanks @alexpaxton!)
  • Basic JSON NewsFeed has been implemented:
    • <NewsFeed> + <JSONFeedReader> are displaying local fixture data (from https://daringfireball.net/feeds/json)
  • Added next steps in above checklist

Here's what it looks like currently: screen shot 2017-06-09 at 1 50 31 am

jaredscheib avatar Jun 09 '17 06:06 jaredscheib

Current Status:

  • Made the Recent Alerts cell a bit larger as to avoid table crunch
  • Changed design of newsfeed a little
    • Slightly more compact
  • Fleshed out Getting Started with static content
    • Initially figured using a markdown parser would be good
    • Realized we might not be changing this content very often
    • Static content = 99% of the way there, now

screen shot 2017-06-09 at 4 51 29 pm

alexpaxton avatar Jun 09 '17 23:06 alexpaxton

Remaining steps for consideration have been added to the PR WIP Notes at #1608

jaredscheib avatar Jun 14 '17 03:06 jaredscheib