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

Graphite reactor - Fixes #8 #27

Closed
wants to merge 2 commits into from

Conversation

obazoud
Copy link
Contributor

@obazoud obazoud commented Feb 9, 2013

No description provided.

@indexzero
Copy link
Member

@obazoud Could you explain how this works a little more to me? I don't know anything about graphite and I'd like to learn.

cc/ @dscape @jhs

@obazoud
Copy link
Contributor Author

obazoud commented Feb 10, 2013

Graphite has 3 individual components

  • Carbon: a daemon that listens incoming data (metric) and store numeric time-series data in whisper files
  • Graphite-web: render graphs in browser
  • Whisper: is a fixed-size database
    Graphite is based on "push" not "pull".

A simple way to send metrics (TCP or UDP):

echo "<metric path> <metric value> <metric timestamp>" | nc $SERVER $PORT
echo "myserver.load.1m 4 `date +%s`" | nc 127.0.0.1 2003
echo "myserver.load.5m 4 `date +%s`" | nc 127.0.0.1 2003
echo "myserver.load.15m 4 `date +%s`" | nc 127.0.0.1 2003

metric path: a metric path that be renderer as a tree

.
└── myserver
    └── load
        └── 1m
        └── 5m
        └── 15m

metric value: an integer or a float
metric timestamp: a UNIX timestamp

Graphite (web) are some very nice features:

  • easy to add few metrics in a graph, create dashboard
  • apply fonction like : percent, average, derivative, integral, nPercentile, timeShift (my favorite:)), ...
  • export data as json
  • export data as image

My reactor is to send metric based on data event to Graphite.

  • A best practice is to prefix metric by environment (or that ever you want) what why I add this option.
  • metric name will be ... and I replace '.' by '_' in host and service

For example with the following event and prefix = "production."

{ host: 'app.server.com',
  service: 'app.server2/health/heartbeat',
  state: 'up',
  time: 1360523052932,
  description: 'No description',
  tags: [],
  metric: 1,
  ttl: 3000 }

metric name will be "production.app_server_com.app_server.health.heartbeat.up"
metric value is 1
metric timestamp is 1360523052932

@indexzero
Copy link
Member

@obazoud Why the string replacement in metric names?

@obazoud
Copy link
Contributor Author

obazoud commented Feb 13, 2013

@indexzero I replace '.' by '_' to have a better layout in, Graphite.
Graphite creates a directory each time it finds a '.'
I create a metric by state.

Without replacement:
graphite2-without-remplacement
With replacement:
graphite-with-replacement

@mwawrusch
Copy link

@obazoud do you mind posting your godot server on a gist, I need to implement a simple godot - graphite bridge and don't want to reinvent the wheel.

@indexzero
Copy link
Member

Cherry-picked. Thanks!

@indexzero indexzero closed this Mar 23, 2013
@obazoud
Copy link
Contributor Author

obazoud commented Mar 23, 2013

@mwawrusch You have an example https://github.com/nodejitsu/godot/blob/master/lib/godot/reactor/graphite.js#L8

You can find a lot of stuff (still in progress) about gobot at https://github.com/organizations/godot-plugins
including Graphite Producer at https://github.com/godot-plugins/godot-graphite

@mwawrusch
Copy link

Awesome, thank you.

On Sat, Mar 23, 2013 at 1:15 PM, Olivier Bazoud notifications@github.comwrote:

@mwawrusch https://github.com/mwawrusch You have an example
https://github.com/nodejitsu/godot/blob/master/lib/godot/reactor/graphite.js#L8

You can find a lot of stuff (still in progress) about gobot at
https://github.com/organizations/godot-plugins
including Graphite Producer at
https://github.com/godot-plugins/godot-graphite


Reply to this email directly or view it on GitHubhttps://github.com//pull/27#issuecomment-15343947
.

Martin Wawrusch
p: +1 310 404 1698

modeista.com - Connect With Style

I blog at http://martinatsunset.com : O API Marketplace, Where Art Thou
Follow me on twitter at @martin_sunset http://twitter.com/martin_sunset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants