why is my data not reporting?

Asked by TTimo

I have the example-client.py working fine, I see a system entry in the data tree and I can obtain graphs of the system load.

But I can't get data pushed in from my own stuff (python code as well, based on twisted), or even by opening a telnet and typing the server.category.my_data [value] [time] commands directly.

I looked at the data with packet captures, and I see the TCP initialized, data through and closed, the lines look just fine, for instance:

system.test 46 1240963695

I am running out of ideas at this point. I don't have any entries in schema, but that doesn't seem to be a problem for example-client.py. The data I am trying to report is a counter, I report each increment with a full TCP negociation, message, close. It is a bit irregular though, there is a new entry every few minutes more or less.

The /usr/local/graphite/storage tree is owned by www-data as per the documentation (apache user).

Question information

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

Are you terminating your lines with a \n?

Revision history for this message
TTimo (ttimo) said :
#2

yes

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

I would check for errors in the carbon logs.

To see if carbon had a problem receiving the data look in $GRAPHITE_ROOT/carbon/log/agent.log.

To see if carbon had a problem writing the data to disk look in $GRAPHITE_ROOT/carbon/log/persister.log

And if for some reason you find nothing in either of those look in the cache.log in the same directory.

Revision history for this message
TTimo (ttimo) said :
#4

No errors in any of the .log files under /usr/local/graphite/

I found that I can report data from series that already exist, e.g. if I do this in my code:

        line = 'system.loadavg_1min 0.09 %d\n' % ( int( time.time() ) )

then I am getting some data reported.

But if I use a different data name, such as:

        line = 'test.value %d %d\n' % ( self.countEvents, int( time.time() ) )

Then nothing happens. The data series does not appear in the tree.

And no errors get reported to the log files either

Revision history for this message
TTimo (ttimo) said :
#5

I had to change the ownership of /usr/local/graphite/storage back to root, change permissions on the log files so the apache could still write to them, and at that point I can create new data series.

I think the step 4 in the installation documentation needs to be updated?

Revision history for this message
AaronS (purgatoryz) said :
#6

I've had this problem before. info.log in the storage directory ends up as root ownership. It's because if you leave the agent running long enough it rolls the log file, backs it up, and creates a new file.

Make sure you are starting carbon-agent.py as www-data (or whatever the apache user is). I'm a linux barbarian, but I just use "sudo su www-data -c "python ./carbon-agent.py"

Revision history for this message
TTimo (ttimo) said :
#7

I went about this the other way, everything is owned by root now, the agent runs as root, except the log files which www-data can write to. It's likely less secure, but it didn't look like anything was going to work the other way, and there were no errors reported so really nowhere to start.