graphite-dev team mailing list archive
-
graphite-dev team
-
Mailing list archive
-
Message #03329
Re: [Question #212833]: dtrace metric with graphite
Question #212833 on Graphite changed:
https://answers.launchpad.net/graphite/+question/212833
Status: Open => Answered
Daniel Lawrence proposed the following answer:
If the metric is literally "DTRACE", No
not graphite accept a float as the metric type not a string.
If you want to use Dtrace to generate metrics that then get sent to
graphite, Yes
#!/bin/bash
# Example DTrace/Graphite Integration
# Ben Rockwood
export HOSTNAME=`hostname`
export GRAPHITE_SERVER="10.0.0.22";
/usr/sbin/dtrace -n '
#pragma D option destructive
#pragma D option quiet
BEGIN
{
mycounter = 0;
}
syscall::read:entry
{
mycounter++;
}
tick-1sec
{
system("echo \"dtrace.$HOSTNAME.syscall.read.entry %d %d\" | nc $GRAPHITE_SERVER 2003 ",
mycounter, walltimestamp / 1000000000);
mycounter = 0;
}
'
More info:
http://cuddletech.com/blog/?p=617
http://cuddletech.com/blog/?p=669
--
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.