3

I need to delete selected values from a graphite whisper data set. It is possible to overwrite a single value just by sending a new value, or to delete the whole set by deleting the .wsp file, but what I need to do is delete just one (or several) selected values, ie reset them to the same state as if they had not been written (undefined, graphite returns nulls). Overwriting doesn't do that.

How to do it? (Programmatically is ok)

See also:

Community
  • 1
  • 1
Alex I
  • 19,689
  • 9
  • 86
  • 158

1 Answers1

1

Graphite (whisper) usually ships with whisper-update utility You can use it to modify the content of a wsp file:

whisper-update.py [options] path timestamp:value [timestamp:value]*

If the timestamp you want to modify is recent (as defined by carbon), you may want to wait or shutdown your carbon-cache daemons.

kamaradclimber
  • 2,479
  • 1
  • 26
  • 45
  • 2
    This will replace an existing value, but I believe it cannot clear a value (set it to null, or the same state as if it had never been written). – Alex I Sep 30 '14 at 05:04
  • 1
    indeed you can set to 0, I'll have a look to see if you can set to null – kamaradclimber Sep 30 '14 at 09:31
  • I found no way to set a value to `null` using this method. Internally the given string is passed to `float()` to generate the value which then is written to the data base. You _can_, however, pass the string `nan` (not a number) which the float data type can represent. In my tests with `whisper-update.py` this worked, and in the end the DB held the value `nan` which in most contexts (Grafana, etc.) was handled like a `null`. – Alfe Nov 07 '19 at 10:35