Skip to content

Instantly share code, notes, and snippets.

@itskenny0
Created August 7, 2022 13:53
Show Gist options
  • Save itskenny0/94696538354ba6653d209475cdfec782 to your computer and use it in GitHub Desktop.
Save itskenny0/94696538354ba6653d209475cdfec782 to your computer and use it in GitHub Desktop.
Delete metric in Graphite docker setup
#!/bin/bash
STAT=$1
SUB=$(echo $STAT | sed 's/\./\//g' | sed 's/$/.wsp/')
CONTAINER=$(docker ps -aq --filter name=graphite)
if [[ -z $STAT ]]; then
echo "Usage: ./deletemetric.sh stats_counters.test.metric.something"
exit 1
fi
echo "delcounters $STAT" | nc -w1 127.0.0.1 8126 # delete metric from statsd
docker exec -it $CONTAINER rm /opt/graphite/storage/whisper/$SUB # delete metric from whisper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment