chore: add docker-compose for local VictoriaLogs instance #280

Merged
david merged 2 commits from chore/2026-09-18/add-victorialogs-docker-compose into main 2026-09-18 21:05:23 +00:00
Collaborator

What

Adds extensions/victorialogs/docker-compose.yml for running a local VictoriaLogs instance, plus a short "Running VictoriaLogs locally" section in the extension README pointing at it.

Why

The extension defaults to http://localhost:9428 but the repo gave you no way to get an instance there. The README's manual smoke test used a bare docker run, which loses all ingested logs on container recreation and doesn't come back after a host restart.

The compose file fixes both:

  • restart: unless-stopped — returns with the Docker engine after a reboot, but an explicit docker compose stop stays stopped (unlike always).
  • Named volume on /victoria-logs-data — the image's default data path is otherwise ephemeral.
  • --retentionPeriod=7d stated explicitly rather than left implicit, so the local retention window is visible.

How tested

Against a real instance on this machine:

  • docker compose config -q — valid
  • docker compose up -d — container healthy, GET /health → 200
  • Ingested two sample lines via /insert/jsonline → 200
  • logs_search with service:checkout returned both lines through the extension

Out of scope notes

The README claims VICTORIALOGS_URL can be set in a .env file, but src/env.ts only reads process.env — unlike the sibling postgres/mongodb extensions, which parse .env via dotenv. A .env entry is silently ignored today. Left alone here; worth its own PR to either fix the README or add dotenv.parse.

## What Adds `extensions/victorialogs/docker-compose.yml` for running a local VictoriaLogs instance, plus a short "Running VictoriaLogs locally" section in the extension README pointing at it. ## Why The extension defaults to `http://localhost:9428` but the repo gave you no way to get an instance there. The README's manual smoke test used a bare `docker run`, which loses all ingested logs on container recreation and doesn't come back after a host restart. The compose file fixes both: - `restart: unless-stopped` — returns with the Docker engine after a reboot, but an explicit `docker compose stop` stays stopped (unlike `always`). - Named volume on `/victoria-logs-data` — the image's default data path is otherwise ephemeral. - `--retentionPeriod=7d` stated explicitly rather than left implicit, so the local retention window is visible. ## How tested Against a real instance on this machine: - `docker compose config -q` — valid - `docker compose up -d` — container healthy, `GET /health` → 200 - Ingested two sample lines via `/insert/jsonline` → 200 - `logs_search` with `service:checkout` returned both lines through the extension ## Out of scope notes The README claims `VICTORIALOGS_URL` can be set in a `.env` file, but `src/env.ts` only reads `process.env` — unlike the sibling `postgres`/`mongodb` extensions, which parse `.env` via `dotenv`. A `.env` entry is silently ignored today. Left alone here; worth its own PR to either fix the README or add `dotenv.parse`.
@ -0,0 +1,20 @@
services:
victorialogs:
image: victoriametrics/victoria-logs:latest
Owner

can we pin the version rather than use latest

can we pin the version rather than use latest
david marked this conversation as resolved
Author
Collaborator

Pushed 45a66fa — pinned the image to victoriametrics/victoria-logs:v1.52.0 instead of :latest, so a rebuild can't silently change the server version the extension is tested against.

v1.52.0 confirmed as latest three ways: GitHub releases/latest, the digest behind the latest Docker tag, and the running container reporting tags-v1.52.0. Worth noting v1.51.1 was published later (2026-08-18 vs 2026-07-16) — it's a patch backport on the 1.51 line, not a newer release, so tag recency alone would have picked the wrong one.

Re-verified after the change: docker compose config -q valid, container recreated on the pinned tag, /health → 200, and logs_search still returned the two sample lines ingested before the recreate — which incidentally confirms the named volume survives container replacement, not just restarts.

The README's standalone docker run in the manual smoke test still uses :latest. Pre-existing and outside this change, so left alone.

Pushed `45a66fa` — pinned the image to `victoriametrics/victoria-logs:v1.52.0` instead of `:latest`, so a rebuild can't silently change the server version the extension is tested against. v1.52.0 confirmed as latest three ways: GitHub `releases/latest`, the digest behind the `latest` Docker tag, and the running container reporting `tags-v1.52.0`. Worth noting `v1.51.1` was *published* later (2026-08-18 vs 2026-07-16) — it's a patch backport on the 1.51 line, not a newer release, so tag recency alone would have picked the wrong one. Re-verified after the change: `docker compose config -q` valid, container recreated on the pinned tag, `/health` → 200, and `logs_search` still returned the two sample lines ingested *before* the recreate — which incidentally confirms the named volume survives container replacement, not just restarts. The README's standalone `docker run` in the manual smoke test still uses `:latest`. Pre-existing and outside this change, so left alone.
david merged commit 7d4de6dc24 into main 2026-09-18 21:05:23 +00:00
david deleted branch chore/2026-09-18/add-victorialogs-docker-compose 2026-09-18 21:05:23 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
david/pi-extensions-and-skills!280
No description provided.