@emeryld/obs-stack 0.2.0 → 0.2.1

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 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 now runs `docker compose` from the workspace root so that the compose file's workspace-relative bindings (for example, `./packages/obs-stack/grafana/provisioning`) always point at the versioned files. If you run `docker compose` yourself, do it from the workspace root or add `--project-directory packages/obs-stack` so Grafana can read `grafana/provisioning/dashboards/files` instead of logging `stat /etc/grafana/provisioning/dashboards/files: no such file or directory`.
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 `grafana/provisioning` folder is mounted (the CLI runs from the package root) and restart Grafana via `obs-stack reset`.
128
+ - **Grafana dashboards missing**: make sure the CLI (or any manual `docker compose` command) starts from the workspace root so the `./packages/obs-stack/grafana/provisioning` bind mounts the expected files. Running Compose from another directory mounts an empty folder and Grafana will keep printing `stat /etc/grafana/provisioning/dashboards/files: no such file or directory`; after you fix the working directory, restart the stack 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
@@ -6,6 +6,7 @@ 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, '..', '..');
9
10
  const ROOT_ENV_PATH = path.join(ROOT, '.env');
10
11
 
11
12
  function loadEnvFile(envPath, options = {}) {
@@ -59,8 +60,8 @@ function ensureDocker() {
59
60
 
60
61
  function spawnCompose(args, options = {}) {
61
62
  ensureDocker();
62
- const child = spawn('docker', ['compose', '-f', COMPOSE_FILE, ...args], {
63
- cwd: ROOT,
63
+ const child = spawn('docker', ['compose', '--project-directory', WORKSPACE_ROOT, '-f', COMPOSE_FILE, ...args], {
64
+ cwd: WORKSPACE_ROOT,
64
65
  stdio: options.stdio ?? 'inherit',
65
66
  env: process.env
66
67
  });
@@ -79,8 +80,8 @@ function runCompose(args) {
79
80
 
80
81
  function streamCompose(args) {
81
82
  ensureDocker();
82
- const child = spawn('docker', ['compose', '-f', COMPOSE_FILE, ...args], {
83
- cwd: ROOT,
83
+ const child = spawn('docker', ['compose', '--project-directory', WORKSPACE_ROOT, '-f', COMPOSE_FILE, ...args], {
84
+ cwd: WORKSPACE_ROOT,
84
85
  stdio: 'inherit',
85
86
  env: process.env
86
87
  });
@@ -9,7 +9,7 @@ services:
9
9
  GF_AUTH_ANONYMOUS_ENABLED: "true"
10
10
  volumes:
11
11
  - grafana-data:/var/lib/grafana
12
- - ./grafana/provisioning:/etc/grafana/provisioning
12
+ - ./packages/obs-stack/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
- - ./configs/tempo.yaml:/etc/tempo/local-config.yaml:ro
26
+ - ./packages/obs-stack/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
- - ./configs/loki.yaml:/etc/loki/local-config.yaml:ro
38
+ - ./packages/obs-stack/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
- - ./configs/otel-collector.yaml:/etc/otel-collector/otel-collector.yaml:ro
51
+ - ./packages/obs-stack/configs/otel-collector.yaml:/etc/otel-collector/otel-collector.yaml:ro
52
52
  depends_on:
53
53
  - tempo
54
54
  - loki
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeryld/obs-stack",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Docker Compose-based Grafana + Tempo + Loki + OpenTelemetry Collector stack",
5
5
  "type": "commonjs",
6
6
  "bin": {