You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***observability:** add debug logging and enhanced metrics ([a1b0a8c](https://github.com/DEVtheOPS/opencode-plugin-otel/commit/a1b0a8cf5263080cf9623355e5161fb88f20e2f1))
@@ -21,37 +20,37 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and
21
20
22
21
### Changed
23
22
24
-
-**BREAKING** — Package renamed to `@devtheops/opencode-plugin-otel`. Update your opencode config from `"opencode-plugin-otel"` to `"@devtheops/opencode-plugin-otel"`.
23
+
***BREAKING** — Package renamed to `@devtheops/opencode-plugin-otel`. Update your opencode config from `"opencode-plugin-otel"` to `"@devtheops/opencode-plugin-otel"`.
25
24
26
25
---
27
26
28
27
## [0.1.1] — 2026-03-11
29
28
30
29
### Fixed
31
30
32
-
- Release workflow now uses npm trusted publishing (OIDC) with Node 22.14.0 and creates a GitHub release with changelog notes and npm package link.
31
+
* Release workflow now uses npm trusted publishing (OIDC) with Node 22.14.0 and creates a GitHub release with changelog notes and npm package link.
33
32
34
33
---
35
34
36
35
## [0.1.0] — 2026-03-11
37
36
38
37
### Added
39
38
40
-
-**Release workflow** — `.github/workflows/release.yml` publishes to npm automatically when a `v*` tag is pushed, gated by typecheck and tests.
41
-
-**`OPENCODE_OTLP_HEADERS`** — new env var for comma-separated `key=value` OTLP auth headers (e.g. `x-honeycomb-team=abc,x-tenant=org`). Copied to `OTEL_EXPORTER_OTLP_HEADERS` before the SDK initialises.
42
-
-**`OPENCODE_RESOURCE_ATTRIBUTES`** — new env var for comma-separated `key=value` OTel resource attributes (e.g. `service.version=1.2.3,deployment.environment=production`). Copied to `OTEL_RESOURCE_ATTRIBUTES` before the SDK initialises.
43
-
- JSDoc on all exported functions, types, and constants.
44
-
- Regression tests covering `OTEL_*` passthrough behaviour — pre-existing values are preserved when `OPENCODE_*` vars are unset; `OPENCODE_*` vars overwrite when set.
45
-
- README table of contents, usage examples for headers and resource attributes, and a security note advising that `OPENCODE_OTLP_HEADERS` may contain sensitive tokens and should not be committed to version control.
39
+
***Release workflow** — `.github/workflows/release.yml` publishes to npm automatically when a `v*` tag is pushed, gated by typecheck and tests.
40
+
***`OPENCODE_OTLP_HEADERS`** — new env var for comma-separated `key=value` OTLP auth headers (e.g. `x-honeycomb-team=abc,x-tenant=org`). Copied to `OTEL_EXPORTER_OTLP_HEADERS` before the SDK initialises.
41
+
***`OPENCODE_RESOURCE_ATTRIBUTES`** — new env var for comma-separated `key=value` OTel resource attributes (e.g. `service.version=1.2.3,deployment.environment=production`). Copied to `OTEL_RESOURCE_ATTRIBUTES` before the SDK initialises.
42
+
* JSDoc on all exported functions, types, and constants.
43
+
* Regression tests covering `OTEL_*` passthrough behaviour — pre-existing values are preserved when `OPENCODE_*` vars are unset; `OPENCODE_*` vars overwrite when set.
44
+
* README table of contents, usage examples for headers and resource attributes, and a security note advising that `OPENCODE_OTLP_HEADERS` may contain sensitive tokens and should not be committed to version control.
46
45
47
46
### Changed
48
47
49
-
-`package.json``main`/`module` now point directly at `src/index.ts`; root `index.ts` re-export removed.
50
-
-`files` field added to `package.json` — published package contains only `src/`, reducing install size.
51
-
- All user-facing env vars are now consistently `OPENCODE_`-prefixed. `loadConfig` copies `OPENCODE_OTLP_HEADERS` → `OTEL_EXPORTER_OTLP_HEADERS` and `OPENCODE_RESOURCE_ATTRIBUTES` → `OTEL_RESOURCE_ATTRIBUTES` so the OTel SDK picks them up natively.
52
-
-`parseEnvInt` now rejects partial numeric strings such as `"1.5"` or `"5000ms"`, returning the fallback instead of silently truncating.
48
+
*`package.json``main`/`module` now point directly at `src/index.ts`; root `index.ts` re-export removed.
49
+
*`files` field added to `package.json` — published package contains only `src/`, reducing install size.
50
+
* All user-facing env vars are now consistently `OPENCODE_`-prefixed. `loadConfig` copies `OPENCODE_OTLP_HEADERS` → `OTEL_EXPORTER_OTLP_HEADERS` and `OPENCODE_RESOURCE_ATTRIBUTES` → `OTEL_RESOURCE_ATTRIBUTES` so the OTel SDK picks them up natively.
51
+
*`parseEnvInt` now rejects partial numeric strings such as `"1.5"` or `"5000ms"`, returning the fallback instead of silently truncating.
53
52
54
53
### Removed
55
54
56
-
-`parseHeaders` removed from `src/otel.ts` — the OTel SDK reads `OTEL_EXPORTER_OTLP_HEADERS` natively once `loadConfig` copies the value across.
57
-
- Manual `release:patch` / `release:minor` / `release:major` npm scripts removed in favour of the tag-based CI workflow.
55
+
*`parseHeaders` removed from `src/otel.ts` — the OTel SDK reads `OTEL_EXPORTER_OTLP_HEADERS` natively once `loadConfig` copies the value across.
56
+
* Manual `release:patch` / `release:minor` / `release:major` npm scripts removed in favour of the tag-based CI workflow.
@@ -72,9 +80,18 @@ All configuration is via environment variables. Set them in your shell profile (
72
80
|`OPENCODE_OTLP_METRICS_INTERVAL`|`60000`| Metrics export interval in milliseconds |
73
81
|`OPENCODE_OTLP_LOGS_INTERVAL`|`5000`| Logs export interval in milliseconds |
74
82
|`OPENCODE_METRIC_PREFIX`|`opencode.`| Prefix for all metric names (e.g. set to `claude_code.` for Claude Code dashboard compatibility) |
75
-
|`OPENCODE_OTLP_HEADERS`|_(unset)_| Comma-separated `key=value` headers added to all OTLP exports. Example: `api-key=abc123,x-tenant=my-org`. **Keep out of version control — may contain sensitive auth tokens.**|
83
+
|`OPENCODE_DISABLE_METRICS`|_(unset)_| Comma-separated list of metric name suffixes to disable (e.g. `cache.count,session.duration`) |
84
+
|`OPENCODE_OTLP_HEADERS`|_(unset)_| Comma-separated `key=value` headers added to all OTLP exports. **Keep out of version control — may contain sensitive auth tokens.**|
76
85
|`OPENCODE_RESOURCE_ATTRIBUTES`|_(unset)_| Comma-separated `key=value` pairs merged into the OTel resource. Example: `service.version=1.2.3,deployment.environment=production`|
> **Security note:**`OPENCODE_OTLP_HEADERS` typically contains auth tokens. Set it in your shell profile (`~/.zshrc`, `~/.bashrc`) or a secrets manager — never commit it to version control or print it in CI logs.
89
106
90
-
### Quick start
107
+
### Disabling specific metrics
108
+
109
+
Use `OPENCODE_DISABLE_METRICS` to suppress individual metrics. The value is a comma-separated list of metric name suffixes (without the prefix).
110
+
111
+
Disabling a metric only stops the counter/histogram from being incremented — the corresponding log events are still emitted.
The following metrics are specific to opencode and have no equivalent in Claude Code's built-in monitoring. If you are using a Claude Code dashboard and want to avoid cluttering it with opencode-only metrics, you can disable them:
0 commit comments