Created
August 7, 2022 13:53
-
-
Save itskenny0/94696538354ba6653d209475cdfec782 to your computer and use it in GitHub Desktop.
Delete metric in Graphite docker setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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