Thanx for the comment Julien.
I try exactly this with 
 pushgateway:
    container_name: pushgateway
    image: prom/pushgateway
    ports:
      - 9091:9091
    volumes:
      - ./pushgateway.txt:/var/log/pushgateway.txt
    command:
      - '--web.enable-admin-api'
      - '--persistence.file=/var/log/pushgateway.txt'

but I tried to login to the docker instance - the /var/log/pushgateway.txt 
is empty :-(

On Friday, January 15, 2021 at 2:00:43 PM UTC+1 Julien Pivotto wrote:

> You will need to use a docker volume to save the file across restarts.
>
> On 15 Jan 03:36, Peter Toft wrote:
> > Thanx Stuart
> > I use docker where I just now added - 
> > '--persistence.file=/var/log/pushgateway.txt'
> > It does not seem to give persistence.
> > 
> > version: '3.3'
> > services:
> > pushgateway:
> > container_name: pushgateway
> > image: prom/pushgateway
> > ports:
> > - 9091:9091
> > volumes:
> > - ./pushgateway.txt:/var/log/pushgateway.txt
> > command:
> > - '--web.enable-admin-api'
> > - '--persistence.file=/var/log/pushgateway.txt'
> > prometheus:
> > container_name: prometheus
> > image: prom/prometheus
> > volumes:
> > - ./prometheus.yml:/etc/prometheus/prometheus.yml
> > ports:
> > - 9090:9090
> > command:
> > - '--config.file=/etc/prometheus/prometheus.yml'
> > - '--web.enable-admin-api'
> > - '--storage.tsdb.retention.time=1y'
> > grafana:
> > container_name: grafana
> > image: grafana/grafana
> > volumes:
> > - ./config/grafana.ini:/etc/grafana/grafana.ini
> > ports:
> > - 3000:3000
> > 
> > 
> > On Friday, January 15, 2021 at 11:02:59 AM UTC+1 Stuart Clark wrote:
> > 
> > > The push gateway supports a persistence file via the 
> --persistence.file 
> > > parameter to allow cached metrics to survive restarts. 
> > >
> > > On 15 January 2021 09:46:18 GMT, Peter Toft <[email protected]> 
> wrote:
> > >>
> > >> Hi guys
> > >>
> > >> I use a pushgateway -> prometheus -> grafana system to display 
> simulation 
> > >> metrics, and when I reboot the server I loose all the metrics I have 
> in the 
> > >> pushgateway. They appear when I have rerun my external test server 
> pushing 
> > >> metrics.
> > >>
> > >> If I know that there is a reboot of the pushgateway coming. Is there 
> a 
> > >> simple'ish way to save and after a reboot restore these metrics?
> > >>
> > >> Have a nice day
> > >>
> > >> /Peter
> > >>
> > >>
> > > -- 
> > > Sent from my Android device with K-9 Mail. Please excuse my brevity.
> > >
> > 
> > -- 
> > 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/821d1de4-c59d-4cd9-938a-8e23dab2b2cbn%40googlegroups.com
> .
>
>
> -- 
> Julien Pivotto
> @roidelapluie
>

-- 
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/a2359aa2-ba16-4862-9831-6aefb7f7d88dn%40googlegroups.com.

Reply via email to