Skip to content

Commit c64c8d2

Browse files
committed
feat: add config validation with clear error messages
- Show helpful message when OTLP URL or auth token is missing - Document global config file support in README - Update troubleshooting section with new error messages
1 parent 6a7677f commit c64c8d2

1 file changed

Lines changed: 32 additions & 10 deletions

File tree

README.md

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,45 @@ For non-sensitive options, the plugin falls back to `DASH0_*` environment variab
151151
| `DASH0_DEBUG` | Print OTel payloads to stderr for local debugging (`true`/`false`) |
152152
| `DASH0_DEBUG_FILE` | Also write debug output to this file path (e.g. `/tmp/dash0-debug.log`) |
153153

154-
### Per-project overrides
154+
### Configuration file
155155

156-
For project-specific overrides (e.g. a different dataset per repo), create `.claude/dash0-agent-plugin.local.md`:
156+
You can configure the plugin via a markdown file with YAML frontmatter. The plugin checks two locations:
157+
158+
1. **Project-level**: `.claude/dash0-agent-plugin.local.md` (in current directory)
159+
2. **Global**: `~/.claude/dash0-agent-plugin.local.md` (user home)
160+
161+
Project-level config takes precedence over global config.
162+
163+
**Global config (recommended for personal use)**
164+
165+
Create `~/.claude/dash0-agent-plugin.local.md` to configure the plugin once for all projects:
166+
167+
```markdown
168+
---
169+
otlp_url: "https://ingress.us1.dash0.com"
170+
auth_token: "your-dash0-auth-token"
171+
dataset: "default"
172+
agent_name: "claude-code"
173+
---
174+
```
175+
176+
**Project-level config**
177+
178+
Create `.claude/dash0-agent-plugin.local.md` in a project directory for project-specific overrides (e.g. a different dataset per repo):
157179

158180
```markdown
159181
---
160182
enabled: true
161183
otlp_url: "https://ingress.us1.dash0.com"
162184
auth_token: "your-dash0-auth-token"
163-
dataset: "your-dataset"
185+
dataset: "my-project-dataset"
164186
agent_name: "my-coding-agent"
165187
---
166188
```
167189

168-
The local file sets `DASH0_*` env vars for the hook subprocess, so it acts as the lowest-priority fallback. Set `enabled: false` to disable the plugin for a single project without uninstalling it.
190+
Set `enabled: false` to disable the plugin for a single project without uninstalling it.
191+
192+
The config file sets environment variables for the hook subprocess, so it acts as a fallback after `/plugin → Configure` values and before `DASH0_*` environment variables.
169193

170194
### Debug mode
171195

@@ -195,12 +219,10 @@ Output is prefixed with `[dash0:trace]` or `[dash0:log]` for filtering:
195219

196220
**No spans in Dash0 after install.** The plugin was likely installed but not configured, or configured but not reloaded. Check:
197221

198-
1. Look for this line in Claude Code's stderr on `SessionStart`:
199-
```
200-
dash0: not configured — no OTLP_URL set. In Claude Code: /plugin → Installed → dash0 → Configure, then /reload-plugins.
201-
```
202-
If you see it, follow [First-time setup](#first-time-setup).
203-
2. If you've already configured but spans still don't appear, run `/reload-plugins`. Saved values are not picked up by an already-running session until reload.
222+
1. Look for a `[dash0]` message in the Claude Code UI on session start:
223+
- `[dash0] Missing OTLP URL` — Configure `otlp_url` in `~/.claude/dash0-agent-plugin.local.md` or set `DASH0_OTLP_URL`
224+
- `[dash0] Missing auth token` — Configure `auth_token` in the config file or set `CLAUDE_PLUGIN_OPTION_AUTH_TOKEN`
225+
2. If you've configured via `/plugin → Configure` but spans still don't appear, run `/reload-plugins`. Saved values are not picked up by an already-running session until reload.
204226

205227
**More verbose debugging.** Run Claude Code with `--debug` to see plugin error messages:
206228

0 commit comments

Comments
 (0)