Merge lp:~lucio.torre/graphite/add-events into lp:~graphite-dev/graphite/main

Proposed by Lucio Torre
Status: Merged
Approved by: chrismd
Approved revision: 310
Merge reported by: chrismd
Merged at revision: not available
Proposed branch: lp:~lucio.torre/graphite/add-events
Merge into: lp:~graphite-dev/graphite/main
Diff against target: 931 lines (+549/-38)
17 files modified
docs/install.rst (+2/-0)
docs/who-is-using.rst (+1/-0)
requirements.txt (+1/-0)
setup.py (+4/-1)
webapp/content/js/jquery.graphite.js (+152/-27)
webapp/graphite/browser/urls.py (+1/-1)
webapp/graphite/events/models.py (+49/-0)
webapp/graphite/events/urls.py (+21/-0)
webapp/graphite/events/views.py (+77/-0)
webapp/graphite/graphlot/views.py (+4/-1)
webapp/graphite/render/functions.py (+154/-2)
webapp/graphite/settings.py (+2/-0)
webapp/graphite/templates/browserHeader.html (+1/-0)
webapp/graphite/templates/event.html (+30/-0)
webapp/graphite/templates/events.html (+42/-0)
webapp/graphite/templates/graphlot.html (+6/-5)
webapp/graphite/urls.py (+2/-1)
To merge this branch: bzr merge lp:~lucio.torre/graphite/add-events
Reviewer Review Type Date Requested Status
chrismd Approve
Sidnei da Silva (community) Approve
Review via email: mp+69142@code.launchpad.net

Description of the change

Add events to graphite.

Events are instantaneous occurrences that we want to track and correlate with our current metrics. Sample events are rollouts, reboots, errors, etc.

Events store the following information: summary, date, tags and "extra data", where you can store whatever you might need. This can all be edited from the admin: http://ubuntuone.com/p/16CJ/

You can add events from the command line using curl:
$ curl -X POST http://localhost:8000/events/ -d '{"what": "Something Interesting"}'

So its very easy to integrate with other tools.

You can see the list of events from: http://localhost:8000/events/ and get to the event details by clicking on its line. (eg, http://localhost:8000/events/4)

Then, using the graphlot ui you can overlay events into a graph by selecting tags that would filter the events or just '*' to select all.

Events get overlayed in the graph, you get a tooltip with the summary when hovering over it and when you click on it you go to the details page.

In order to make developing/testing this easier, there are also some new functions that generate data, so you can see a plot for whatever date you want without having real data.

See: http://ubuntuone.com/p/16CY/

To post a comment you must log in.
lp:~lucio.torre/graphite/add-events updated
306. By Lucio Torre

merged with trunk

307. By Lucio Torre

removed dirt.

Revision history for this message
Sidnei da Silva (sidnei) wrote :

Looks pretty ok to me. A few comments, but none of them blockers:

[1] arrays_equal has a few issues the way it's implemented, but should work given how it's used. There's a really nice array comparison implementation here: http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256BFB0077DFFD

[2] I'm worried about the use of 'autoescape off' here, since basically you could inject some javascript through post_event handler and have it rendered unsanitized into the template, but Lucio pointed out there's more templates already using 'autoescape off' in the tree. Probably deserves some checking all around. It doesn't seem like removing it from those newly introduced templates would break them though.

review: Approve
Revision history for this message
Aman Gupta (tmm1) wrote :

I really like the new test functions. Can you add some docs for http://readthedocs.org/docs/graphite/en/latest/functions.html

Also we should document the new dependency on django.tagging in requirements.txt and in the docs somewhere.

Revision history for this message
Aman Gupta (tmm1) wrote :

As discussed on IRC, it would be nice to expose these new events to the server-side graphing api as well. Probably as a new function: events(tag, tag, ...), which could query the Events model and generate a TimeSeries to graph.

Revision history for this message
Lucio Torre (lucio.torre) wrote :

updated js array comparison to include the one in the link
removed the autoescape for all event related templates
documented test functions
added django-tagging to requirements
added events(*tags) function for use with drawAsInfinite
fixed bug on events tooltips.

lp:~lucio.torre/graphite/add-events updated
308. By Lucio Torre

merged with trunk

309. By Lucio Torre

fixes, documentation and new events functions

310. By Lucio Torre

more doc

Revision history for this message
chrismd (chrismd) wrote :

Looks great, unfortunately I could not merge it into trunk because we haven't upgraded the repo to 2a format yet. The diff however applied cleanly as a patch, which I just committed to trunk.

review: Approve
Revision history for this message
DiegoV (diego-varese) wrote :

Looks like your code does not work with a MySQL backend:

https://bugs.launchpad.net/graphite/+bug/1068861

Revision history for this message
Dieter P (dieter-plaetinck) wrote :

IMHO managing annotated events has nothing do with time series data; I feel like trying to bolt that logic onto graphite is a bit awkward and requires a lot of code additions/changes precisely because this is a different problem domain.
Based on that realization I wrote a small tool for annotated event management (with similar input/output API's as graphite): http://dieter.plaetinck.be/anthracite-event-database-enrich-monitoring-dashboards-visual-numerical-analysis-events-business-impact.html

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches