Hello,

I deployed prometheus using automation and I used a shell file to run the 
configuration file of prometheus. The contents of the file are mentioned 
below. However currently the default storage retention period is 15d. I 
want this to be changed to 90d. I tried to declare the flag 
--storage.tsdb.retention.time=90d in the prometheus.yml file and also in 
the below mentioned bash file. When I do that application is not coming up. 
If I have to add that flag in the below file, where exactly I need to 
declare that flag and how can I do that. Can anyone please help.


#!/bin/bash

prometheus_binary=/apps/prometheus/prometheus-2.19.0.linux-amd64/prometheus
prometheus_pid=/var/run/prometheus.pid

prometheus_flags=--config.file=/apps/prometheus/prometheus-2.19.0.linux-amd64/prometheus.yml

case "$1" in
    start)
        if [ -f "$prometheus_binary" ]; then
            $prometheus_binary $prometheus_flags> /dev/null 2>&1 &
            echo $! >$prometheus_pid;
            echo $prometheus_flags
        fi
        ;;
    stop)
        PID=$(cat $prometheus_pid);
        kill -9 $PID;
        rm -rf $prometheus_pid
        ;;
    restart)
  if [ -f $prometheus_pid ]; then
    PID=$(cat $prometheus_pid);
          kill -9 $PID;
          $prometheus_binary $prometheus_flags > /dev/null 2>&1 &
          echo $! >$prometheus_pid
  else
    $prometheus_binary -i $prometheus_flags > /dev/null 2>&1 &
                echo $! >$prometheus_pid
  fi
        exit 0
  ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
  exit 1
esac
exit 0

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/a1f92e94-08e6-46e7-9f0f-53fa7aaf6ff4o%40googlegroups.com.

Reply via email to