How do I graph events in Graphite?

Asked by Omry Yadan

how can I graph events (service restart, new package version deployed etc)?
I`m thinking about a vertical line, is there some common practice to do this?

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
cbrinley
Solved:
Last query:
Last reply:
Revision history for this message
Best cbrinley (cbrinley) said :
#1

There may be other approaches using the Event API, but here is one
suggestion. Send a value of 1 or some other non-zero value to graphite when
the event of interest has occurred. Then when you plot that event metric ID
(i.e. service.restart) over other data you can apply the " Draw non-zero As
Infinite " function to that event metric. This is located under "special"
in the apply functions menu. This has the effect of creating
a vertical line whenever that "restart" event has occurred.

On Mon, Feb 13, 2012 at 12:41 PM, Omry Yadan <
<email address hidden>> wrote:

> New question #187677 on Graphite:
> https://answers.launchpad.net/graphite/+question/187677
>
> how can I graph events (service restart, new package version deployed etc)?
> I`m thinking about a vertical line, is there some common practice to do
> this?
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~graphite-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~graphite-dev
> More help : https://help.launchpad.net/ListHelp
>

--

Chris Brinley
Cleartrial

e: <email address hidden>
p: 312-460-3038
m: 219-789-2811

Revision history for this message
Omry Yadan (omry) said :
#2

Hi Chris,
Thanks for your answer.
I have considered something like this, but its not ideal if I want to log package version as well (a whisper file for each package version per server is very expensive).
I sounds like the event interface would be a better fit.
how do I use it? I was not able to find any documentation about it.

Revision history for this message
cbrinley (cbrinley) said :
#3

Well,
I'm no expert here. But here is an attempt :)
I should mention this still looks experimental so usual caveats apply.

if you log to graphite and go to url /admin/events/event you can add an
event manually from there.
Also here is some doc on using it in a graph:
http://readthedocs.org/docs/graphite/en/latest/functions.html?highlight=events

As far as dynamically adding events via rest interface looks like the
following variables are supported:
what=guessing this is title or something similar
tags= believe this is just a comma separated list of adjectives.
when = looks like this should be epoch time
data = can't tell from code , maybe arbitrary data

looks like you'll need to send a POST request to graphite/events with those
parameters.

Chris D, this looks like something you may have been working on? Maybe you
can add color here or correct where i have gone off the deep end.

Regards,

On Tue, Feb 14, 2012 at 4:10 AM, Omry Yadan <
<email address hidden>> wrote:

> Question #187677 on Graphite changed:
> https://answers.launchpad.net/graphite/+question/187677
>
> Status: Answered => Open
>
> Omry Yadan is still having a problem:
> Hi Chris,
> Thanks for your answer.
> I have considered something like this, but its not ideal if I want to log
> package version as well (a whisper file for each package version per server
> is very expensive).
> I sounds like the event interface would be a better fit.
> how do I use it? I was not able to find any documentation about it.
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~graphite-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~graphite-dev
> More help : https://help.launchpad.net/ListHelp
>

--

Chris Brinley
Cleartrial

e: <email address hidden>
p: 312-460-3038
m: 219-789-2811

Revision history for this message
Omry Yadan (omry) said :
#4

Cool stuff! :)

Now, if I add an event saying:
installed package X version Y
is there a way to get the version (or anything else) to draw on the graph next to the infinite line?

For service restarts, a like in a particular color would suffice, but for installed versions, it would be really useful to include package name and version that information on the graph next to the actual line.

Revision history for this message
cbrinley (cbrinley) said :
#5

If i understand your question correctly sounds like you want something on
the graph it's self like a flag or label by the line directly. To my
knowledge this is not currently available. Someone correct me if that has
changed. There is however the below option which may practically get you
to what your after.
you can change the label in the legend area of the graph via the "alias"
function. so it would look like this in the URL syntax:
&target=alias(drawAsInfinite(events("*")),"out to lunch")

In the UI this function is located under functions > special > "Set Legend
Name"

Hope that helps.

On Wed, Feb 15, 2012 at 4:35 AM, Omry Yadan <
<email address hidden>> wrote:

> Question #187677 on Graphite changed:
> https://answers.launchpad.net/graphite/+question/187677
>
> Omry Yadan posted a new comment:
> Cool stuff! :)
>
> Now, if I add an event saying:
> installed package X version Y
> is there a way to get the version (or anything else) to draw on the graph
> next to the infinite line?
>
> For service restarts, a like in a particular color would suffice, but
> for installed versions, it would be really useful to include package
> name and version that information on the graph next to the actual line.
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~graphite-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~graphite-dev
> More help : https://help.launchpad.net/ListHelp
>

--

Chris Brinley
Cleartrial

e: <email address hidden>
p: 312-460-3038
m: 219-789-2811

Revision history for this message
Omry Yadan (omry) said :
#6

Hi Chris,
you got what I`m after correctly, but I don't think your proposed solution cuts it:
for example, if I record package installation events, I may get a few events like
Installed package-v1
Installed package-v2
..
and so on.
this information is recorded within the event (tag, data, or whatever) and is dynamic.
not something I can hard code during the creation of the graph.
in addition, this information is (in this case) different per vertical line, so it makes no sense to use alias here.

if its not implented, maybe it should be a feature request. :)

Revision history for this message
cbrinley (cbrinley) said :
#7

yea to my knowledge nothing that will dynamically apply a label to events
currently exists. I'd agree it would be a nice feature to dynamically plot
events. For now we can leave this question open. Not sure if bugs or
blueprints or some other mechanism is being used to request new features.

On Mon, Feb 20, 2012 at 10:55 AM, Omry Yadan <
<email address hidden>> wrote:

> Question #187677 on Graphite changed:
> https://answers.launchpad.net/graphite/+question/187677
>
> Omry Yadan posted a new comment:
> Hi Chris,
> you got what I`m after correctly, but I don't think your proposed solution
> cuts it:
> for example, if I record package installation events, I may get a few
> events like
> Installed package-v1
> Installed package-v2
> ..
> and so on.
> this information is recorded within the event (tag, data, or whatever) and
> is dynamic.
> not something I can hard code during the creation of the graph.
> in addition, this information is (in this case) different per vertical
> line, so it makes no sense to use alias here.
>
> if its not implented, maybe it should be a feature request. :)
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~graphite-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~graphite-dev
> More help : https://help.launchpad.net/ListHelp
>

--

Chris Brinley
Cleartrial

e: <email address hidden>
p: 312-460-3038
m: 219-789-2811

Revision history for this message
Omry Yadan (omry) said :
#8

alright, thanks,

Revision history for this message
Launchpad Janitor (janitor) said :
#9

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Omry Yadan (omry) said :
#10

hmm, maybe change its state so it will not close?

Revision history for this message
Neil Harkins (nharkins) said :
#11

just made a pull request with a new function
which i believe does what is requested here:
https://github.com/graphite-project/graphite-web/pull/493

Revision history for this message
Omry Yadan (omry) said :
#12

Thanks.
I am no longer use graphite, I hope someone else will also find it useful :)

On 11/11/2013 11:16 PM, Neil Harkins wrote:
> Your question #187677 on Graphite changed:
> https://answers.launchpad.net/graphite/+question/187677
>
> Neil Harkins posted a new comment:
> just made a pull request with a new function
> which i believe does what is requested here:
> https://github.com/graphite-project/graphite-web/pull/493
>

Revision history for this message
Omry Yadan (omry) said :
#13

Thanks cbrinley, that solved my question.