- #!/bin/sh -xe
- json=`restic stats --json`
- [ ! -z $PROM_GW_URL ] && cat <<EOF | curl --data-binary @- $PROM_GW_URL
- # TYPE restic_repository_total_size_bytes gauge
- # HELP restic_repository_total_size_bytes total size of the repository
- `echo -n 'restic_repository_total_size_bytes ' && \
- echo $json | grep -o '"total_size":[0-9]*' | grep -o '[0-9]*'`
- # TYPE restic_repository_total_files_count gauge
- # HELP restic_repository_total_files_count total count of files in the repository
- `echo -n 'restic_repository_total_files_count ' && \
- echo $json | grep -o '"total_file_count":[0-9]*' | grep -o '[0-9]*'`
- EOF
|