@emeryld/obs-stack 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/bin/obs-stack.js +4 -2
- package/docker-compose.yml +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ A Docker Compose bundle that wires Grafana, Tempo, Loki, and an OpenTelemetry Co
|
|
|
17
17
|
```bash
|
|
18
18
|
pnpm --filter @emeryld/obs-stack obs-stack up
|
|
19
19
|
```
|
|
20
|
+
The CLI sets `OBS_STACK_DIR` to the `packages/obs-stack` directory so every `docker compose` run sees the Grafana provisioning and config files no matter where you invoke the command. If you manage the stack by calling `docker compose` directly, either run the command from `packages/obs-stack` or set `OBS_STACK_DIR` (for example `OBS_STACK_DIR=packages/obs-stack docker compose up`) so the bind mounts keep pointing at `grafana/provisioning/dashboards/files`.
|
|
20
21
|
5. Inspect the endpoints reported by the CLI:
|
|
21
22
|
```bash
|
|
22
23
|
pnpm --filter @emeryld/obs-stack obs-stack urls
|
|
@@ -124,7 +125,7 @@ Edit the JSON in `grafana/provisioning/dashboards/files/` (or export updates fro
|
|
|
124
125
|
## Troubleshooting
|
|
125
126
|
|
|
126
127
|
- **Ports already in use**: edit `packages/obs-stack/.env` (or your local override), then run `pnpm --filter @emeryld/obs-stack obs-stack reset` to recreate the stack with the new settings.
|
|
127
|
-
- **Grafana dashboards missing**: ensure the `
|
|
128
|
+
- **Grafana dashboards missing**: ensure the `OBS_STACK_DIR` environment variable points at `packages/obs-stack` (the CLI sets it automatically) so Grafana sees `grafana/provisioning/dashboards/files`. Running `docker compose` without `OBS_STACK_DIR` from another directory binds an empty host path and Grafana keeps logging `stat /etc/grafana/provisioning/dashboards/files: no such file or directory`; once the variable points at the stack, restart with `obs-stack reset`.
|
|
128
129
|
- **Collector fails to start**: make sure the collector can resolve `tempo` and `loki`. The CLI always runs Compose inside the package directory so no host networking is required.
|
|
129
130
|
- **`docker compose` not on PATH**: install Docker Desktop (Mac/Windows) or Docker Engine with the Compose plugin (Linux) so both `docker` and `docker compose` can run.
|
|
130
131
|
|
package/bin/obs-stack.js
CHANGED
|
@@ -57,12 +57,14 @@ function ensureDocker() {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
const COMPOSE_ENV = { ...process.env, OBS_STACK_DIR: ROOT };
|
|
61
|
+
|
|
60
62
|
function spawnCompose(args, options = {}) {
|
|
61
63
|
ensureDocker();
|
|
62
64
|
const child = spawn('docker', ['compose', '-f', COMPOSE_FILE, ...args], {
|
|
63
65
|
cwd: ROOT,
|
|
64
66
|
stdio: options.stdio ?? 'inherit',
|
|
65
|
-
env:
|
|
67
|
+
env: COMPOSE_ENV
|
|
66
68
|
});
|
|
67
69
|
return child;
|
|
68
70
|
}
|
|
@@ -82,7 +84,7 @@ function streamCompose(args) {
|
|
|
82
84
|
const child = spawn('docker', ['compose', '-f', COMPOSE_FILE, ...args], {
|
|
83
85
|
cwd: ROOT,
|
|
84
86
|
stdio: 'inherit',
|
|
85
|
-
env:
|
|
87
|
+
env: COMPOSE_ENV
|
|
86
88
|
});
|
|
87
89
|
child.on('error', (error) => {
|
|
88
90
|
fail(`docker compose failed: ${error.message}`);
|
package/docker-compose.yml
CHANGED
|
@@ -9,7 +9,7 @@ services:
|
|
|
9
9
|
GF_AUTH_ANONYMOUS_ENABLED: "true"
|
|
10
10
|
volumes:
|
|
11
11
|
- grafana-data:/var/lib/grafana
|
|
12
|
-
-
|
|
12
|
+
- ${OBS_STACK_DIR:-.}/grafana/provisioning:/etc/grafana/provisioning
|
|
13
13
|
depends_on:
|
|
14
14
|
- loki
|
|
15
15
|
- tempo
|
|
@@ -23,7 +23,7 @@ services:
|
|
|
23
23
|
command:
|
|
24
24
|
- "-config.file=/etc/tempo/local-config.yaml"
|
|
25
25
|
volumes:
|
|
26
|
-
-
|
|
26
|
+
- ${OBS_STACK_DIR:-.}/configs/tempo.yaml:/etc/tempo/local-config.yaml:ro
|
|
27
27
|
- tempo-data:/var/tempo
|
|
28
28
|
restart: unless-stopped
|
|
29
29
|
|
|
@@ -35,7 +35,7 @@ services:
|
|
|
35
35
|
command:
|
|
36
36
|
- "-config.file=/etc/loki/local-config.yaml"
|
|
37
37
|
volumes:
|
|
38
|
-
-
|
|
38
|
+
- ${OBS_STACK_DIR:-.}/configs/loki.yaml:/etc/loki/local-config.yaml:ro
|
|
39
39
|
- loki-data:/var/loki
|
|
40
40
|
restart: unless-stopped
|
|
41
41
|
|
|
@@ -48,7 +48,7 @@ services:
|
|
|
48
48
|
command:
|
|
49
49
|
- "--config=/etc/otel-collector/otel-collector.yaml"
|
|
50
50
|
volumes:
|
|
51
|
-
-
|
|
51
|
+
- ${OBS_STACK_DIR:-.}/configs/otel-collector.yaml:/etc/otel-collector/otel-collector.yaml:ro
|
|
52
52
|
depends_on:
|
|
53
53
|
- tempo
|
|
54
54
|
- loki
|