Skip to content

Commit 13db7b4

Browse files
docs
1 parent 6a0b451 commit 13db7b4

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

doc/README-ClickHouse-Grafana.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@ This avoids VRL type-system complexity and keeps the Vector config minimal.
2323

2424
## Start the stack
2525

26+
Before bootstrapping with Docker Compose, create the host stack directory yourself. This prevents Docker from creating it as `root`.
27+
28+
```zsh
29+
mkdir -p /tmp/stacks
30+
chmod 775 /tmp/stacks
31+
```
32+
33+
If you prefer a different path, set `JCT_STACKS_DIR` and use the same path in your JCT file processor config (`processor.stackFolderName`):
34+
35+
```zsh
36+
export JCT_STACKS_DIR=/path/you/can/write
37+
mkdir -p "$JCT_STACKS_DIR"
38+
chmod 775 "$JCT_STACKS_DIR"
39+
```
40+
2641
```zsh
2742
cd /home/msauer/dev/workspace-private/java-code-tracer
2843
docker compose -f docker-compose-clickhouse.yml up -d
@@ -86,7 +101,7 @@ docker volume rm java-code-tracer_clickhouse-data java-code-tracer_grafana-data
86101

87102
## Run your app with JCT (file processor)
88103

89-
Use a file-based config such as `doc/config-sample-application-file.yaml` and write to `/tmp/stacks`.
104+
Use a file-based config such as `doc/config-sample-application-file.yaml` and write to the same host path mounted into Vector (default: `/tmp/stacks`, or `JCT_STACKS_DIR` if set).
90105

91106
Important: make sure `processor.fullQualifiedClass` is set to `de.marcelsauer.profiler.processor.file.AsyncFileWritingStackProcessor`. This ClickHouse setup polls/tails log files from `/tmp/stacks`; UDP/TCP processors will not produce files for Vector to ingest.
92107

@@ -190,7 +205,8 @@ SELECT count(*) FROM default.jct_events;
190205

191206
**Vector exits on startup:**
192207
- Check logs: `docker compose -f docker-compose-clickhouse.yml logs vector`
193-
- Confirm `/tmp/stacks` contains `jct_*.log` files.
208+
- Confirm the mounted stack directory exists and contains `jct_*.log` files (`/tmp/stacks` by default, or `JCT_STACKS_DIR`).
209+
- If Compose reports bind-mount errors, create the host folder manually and ensure your app user can write there.
194210

195211
**ClickHouse authentication errors (403/516):**
196212
- Ensure `doc/clickhouse/config/users.d/default-user.xml` is present and mounted.

docker-compose-clickhouse.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ services:
2323
condition: service_healthy
2424
volumes:
2525
- ./doc/vector/vector.toml:/etc/vector/vector.toml:ro
26-
- /tmp/stacks:/var/log/jct_stacks:ro
26+
- type: bind
27+
source: ${JCT_STACKS_DIR:-/tmp/stacks}
28+
target: /var/log/jct_stacks
29+
read_only: true
30+
bind:
31+
create_host_path: false
2732
command: ["--config", "/etc/vector/vector.toml"]
2833

2934
grafana:

0 commit comments

Comments
 (0)