Skip to content

fix/observability: Prometheus read only root volume - #1479

Open
marcleblanc2 wants to merge 1 commit into
mainfrom
marc/prometheus-read-only-root-filesystem
Open

marcleblanc2 wants to merge 1 commit into
mainfrom
marc/prometheus-read-only-root-filesystem

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Some customers need a read-only root filesystem on every container, and still need Alertmanager to work

The prometheus service couldn't be read_only, because Alertmanager wrote to the root filesystem

Solution

Add read_only: true to the prometheus service

sourcegraph/sourcegraph#18737 moves Alertmanager's files onto the /prometheus data volume.

Do not merge this PR until the pinned prometheus image includes it.

Test plan

Ran this branch with the image Buildkite built from sourcegraph/sourcegraph#18737:

  • prometheus starts read-only, with no read-only or permission errors
  • observability.alerts and observability.silenceAlerts reach Alertmanager, and a webhook receives the notifications
  • Upgrading from main with the released prometheus:8.1.4690 to this branch works on the same volume
  • docker compose stop takes 0.5 seconds, so the default 10 second grace period is enough
  • Control: the released prometheus:8.1.4690 fails with open /sg_config_prometheus/alertmanager.yml: read-only file system
  • The rest of the results are in sourcegraph/sourcegraph#18737

Linked PRs

Merge in this order, because the two deploy PRs need a prometheus image with the fix:

  1. Image fix: sourcegraph/sourcegraph#18737
  2. Helm: fix/observability: Prometheus read only root volume deploy-sourcegraph-helm#1000
  3. Docker Compose: fix/observability: Prometheus read only root volume #1479

Amp threads

@github-actions

Copy link
Copy Markdown

@marcleblanc2 marcleblanc2 changed the title docker-compose: Run prometheus with a read-only root filesystem fix/observability: Prometheus read only root volume Nov 11, 2026
@marcleblanc2
marcleblanc2 marked this pull request as ready for review November 11, 2026 03:59
@marcleblanc2
marcleblanc2 requested a review from a team November 11, 2026 03:59
The prometheus image now keeps Alertmanager's configuration and state on
the /prometheus data volume, so nothing writes to the root filesystem.

Needs sourcegraph/sourcegraph#18737 in the pinned image.

Amp-Thread-ID: https://ampcode.com/threads/T-01a13cfb-9756-7111-8b29-381a841065e1
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2
marcleblanc2 force-pushed the marc/prometheus-read-only-root-filesystem branch from 533bfae to 1d28bde Compare November 13, 2026 05:56
@marcleblanc2
marcleblanc2 added this pull request to stack #1505 November 13, 2026 05:56
@marcleblanc2
marcleblanc2 enabled stacked auto-merge (squash) November 13, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant