Graphite Derivative shows no data
<p>Using graphite/Grafana to record the sizes of all collections in a mongodb instance. I wrote a simple (WIP) python script to do so:</p>

<pre><code>#!/usr/bin/python

from pymongo import MongoClient
import socket
import time

statsd_ip = '127.0.0.1'
statsd_port = 8125

# create a udp socket 
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

client = MongoClient(host='12.34.56.78', port=12345)
db = client.my_DB

# get collection list each runtime
collections = db.collection_names()

sizes = {}

# main
while (1):
    # get collection size per name
    for collection in collections:
        sizes[collection] = db.command('collstats', collection)['size']

    # write to statsd
    for size in sizes:
        MESSAGE = "collection_%s:%d|c" % (size, sizes[size])
        sock.sendto(MESSAGE, (statsd_ip, statsd_port))

    time.sleep(60)
</code></pre>

<p>This properly shows all of my collection sizes in grafana. However, I want to get a rate of change on these sizes, so I build the following graphite query in grafana:</p>

<pre><code>derivative(statsd.myHost.collection_myCollection)
</code></pre>

<p>And the graph shows up totally blank. Any ideas?</p>

<p>FOLLOW-UP: When selecting a time range greater than 24h, all data similarly disappears from the graph. Can't for the life of me figure out that one.</p>