dtrace metric with graphite

Asked by breakfazz

Is it possible to send metric like "DTRACE" to graphite and showing graph?

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Daniel Lawrence (dannyla) said :
#1

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

Revision history for this message
breakfazz (aldy-gilang94) said :
#2

i have been try it,it send to graphite and it save to /opt/graphite/storage/whisper/dtrace/hostname/syscall/read/entry.wsp

but when i running it on graphite,nothing show graph or tree, it just blank data.

Why? How to resolve it? Need help....

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#3

Set LOG_UPDATES = True in carbon.conf

Look at the logfiles for messages. Every time you run the script, do you see "invalid line received from client"?
That means you're sending data in the wrong format. Message format is described here:
http://graphite.readthedocs.org/en/latest/feeding-carbon.html#the-plaintext-protocol

Try running whisper_fetch.py /opt/graphite/storage/whisper/dtrace/hostname/syscall/read/entry.wsp
Do you see data or 'None,None,None,None,None..." ?

Revision history for this message
breakfazz (aldy-gilang94) said :
#4

i see data with scale until 1.0, but not showing graph with line blue,,,

Revision history for this message
breakfazz (aldy-gilang94) said :
#5

Sorry for previous, i try running whisper_fetch.py /opt/graphite/storage/whisper/dtrace/hostname/syscall/read/entry.wsp, then i see none,none,none.

Why its show none?

Thank for reply

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#6

Did you look at your update.log files? Are you seeing this metric come in? It should appear in the updates.log file.

Please check this as well:

whisper-info.py /opt/graphite/storage/whisper/dtrace/hostname/syscall/read/entry.wsp

What are the results?

Right now it looks like either
a.) The messages aren't reaching your carbon server
b.) The messages are malformed and can't be processed by carbon
c.) Your retention rates (in storage-schemas.conf) have an xFilesFactor above 0.0 and sparse data is being converted to a None value during a roll-up operation.

Revision history for this message
breakfazz (aldy-gilang94) said :
#7

there isn't updates.log on /opt/graphite/storage/log/carbon-cache-a/

the result of whisper-info.py /opt/graphite/storage/whisper/dtrace/hostname/syscall/read/entry.wsp is show none,none,none

how to fix them all?

sorry for many questions.

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#8

1.) Did you set LOG_UPDATES = True in carbon.conf and restart carbon?
2.) That's not the output of whisper-info.py You provided the output of
whisper-fetch.py
 On Nov 1, 2012 8:41 PM, "breakfazz" <email address hidden>
wrote:

> Question #212833 on Graphite changed:
> https://answers.launchpad.net/graphite/+question/212833
>
> Status: Needs information => Open
>
> breakfazz gave more information on the question:
> there isn't updates.log on /opt/graphite/storage/log/carbon-cache-a/
>
> the result of whisper-info.py
> /opt/graphite/storage/whisper/dtrace/hostname/syscall/read/entry.wsp is
> show none,none,none
>
> how to fix them all?
>
> sorry for many questions.
>
> --
> 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
>

Revision history for this message
Phantom0308 (ghost-phantom33) said :
#10

What the function of "update.log"?

Can you help with this problem?

Provide an answer of your own, or ask breakfazz for more information if necessary.

To post a message you must log in.