@emeryld/obs-stack 0.2.1 → 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 -2
- package/bin/obs-stack.js +8 -7
- package/docker-compose.yml +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +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
|
|
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`.
|
|
21
21
|
5. Inspect the endpoints reported by the CLI:
|
|
22
22
|
```bash
|
|
23
23
|
pnpm --filter @emeryld/obs-stack obs-stack urls
|
|
@@ -125,7 +125,7 @@ Edit the JSON in `grafana/provisioning/dashboards/files/` (or export updates fro
|
|
|
125
125
|
## Troubleshooting
|
|
126
126
|
|
|
127
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.
|
|
128
|
-
- **Grafana dashboards missing**:
|
|
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`.
|
|
129
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.
|
|
130
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.
|
|
131
131
|
|
package/bin/obs-stack.js
CHANGED
|
@@ -6,7 +6,6 @@ const dotenv = require('dotenv');
|
|
|
6
6
|
const startObsStackMenu = require('./obs-stack-menu');
|
|
7
7
|
|
|
8
8
|
const ROOT = path.resolve(__dirname, '..');
|
|
9
|
-
const WORKSPACE_ROOT = path.resolve(ROOT, '..', '..');
|
|
10
9
|
const ROOT_ENV_PATH = path.join(ROOT, '.env');
|
|
11
10
|
|
|
12
11
|
function loadEnvFile(envPath, options = {}) {
|
|
@@ -58,12 +57,14 @@ function ensureDocker() {
|
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
|
|
60
|
+
const COMPOSE_ENV = { ...process.env, OBS_STACK_DIR: ROOT };
|
|
61
|
+
|
|
61
62
|
function spawnCompose(args, options = {}) {
|
|
62
63
|
ensureDocker();
|
|
63
|
-
const child = spawn('docker', ['compose', '
|
|
64
|
-
cwd:
|
|
64
|
+
const child = spawn('docker', ['compose', '-f', COMPOSE_FILE, ...args], {
|
|
65
|
+
cwd: ROOT,
|
|
65
66
|
stdio: options.stdio ?? 'inherit',
|
|
66
|
-
env:
|
|
67
|
+
env: COMPOSE_ENV
|
|
67
68
|
});
|
|
68
69
|
return child;
|
|
69
70
|
}
|
|
@@ -80,10 +81,10 @@ function runCompose(args) {
|
|
|
80
81
|
|
|
81
82
|
function streamCompose(args) {
|
|
82
83
|
ensureDocker();
|
|
83
|
-
const child = spawn('docker', ['compose', '
|
|
84
|
-
cwd:
|
|
84
|
+
const child = spawn('docker', ['compose', '-f', COMPOSE_FILE, ...args], {
|
|
85
|
+
cwd: ROOT,
|
|
85
86
|
stdio: 'inherit',
|
|
86
|
-
env:
|
|
87
|
+
env: COMPOSE_ENV
|
|
87
88
|
});
|
|
88
89
|
child.on('error', (error) => {
|
|
89
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
|