How to edit prometheus.yml

I have the prometheus snap installed.

root@juju-ffb995-8:/# snap list
Name        Version        Rev    Tracking       Publisher   Notes
core        16-2.54.4      12834  latest/stable  canonical✓  core
core18      20220309       2344   latest/stable  canonical✓  base
core20      20220318       1405   latest/stable  canonical✓  base
lxd         4.0.9-8e2046b  22753  4.0/stable/…   canonical✓  -
prometheus  2.28.1         53     2/stable       canonical✓  -
snapd       2.54.4         15177  latest/stable  canonical✓  snapd

I need to edit the ./var/snap/prometheus/current/prometheus.yml

But its read only.

How do I update this file in a snap and make the changes persistent over updates of the snap?

perhaps @jacekn can help here ?

files in /var/snap/<snapname>/current are normally writable and get copied there by an install hook or startup wrapper …

1 Like

It makes my life somewhat complicated since I don’t know how to change my configuration for prometheus at the moment. I feel crippled. =/

@ogra - it was my error. The file was marked ReadOnly, but a override from my editor seemed to accept the edit. So, I was in the end able to edit it.


1 Like