opencode-otel-plugin 0.5.0 → 0.5.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 +8 -3
- package/dist/index.js +11 -11
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
4
|
|
|
5
|
-
OpenTelemetry instrumentation plugin for [OpenCode](https://opencode.ai). Automatically traces every AI coding session — LLM calls, tool executions, file edits, and context compactions — and exports them via OTLP/HTTP to any OpenTelemetry-compatible backend.
|
|
5
|
+
OpenTelemetry instrumentation plugin for [OpenCode](https://opencode.ai). Automatically traces every AI coding session — LLM calls, tool executions, file edits, and context compactions — and exports them via OTLP/HTTP (protobuf) to any OpenTelemetry-compatible backend.
|
|
6
6
|
|
|
7
7
|
## Quick Start
|
|
8
8
|
|
|
@@ -68,6 +68,7 @@ All configuration uses standard [OpenTelemetry environment variables](https://op
|
|
|
68
68
|
|---|---|---|
|
|
69
69
|
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP/HTTP base URL | `http://localhost:4318` |
|
|
70
70
|
| `OTEL_EXPORTER_OTLP_HEADERS` | Auth headers (`key=value`, comma-separated) | — |
|
|
71
|
+
| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | Metric temporality (`cumulative`, `delta`, `lowmemory`) | `cumulative` |
|
|
71
72
|
|
|
72
73
|
### Backend Examples
|
|
73
74
|
|
|
@@ -97,11 +98,13 @@ export OTEL_EXPORTER_OTLP_HEADERS="x-honeycomb-team=<your-api-key>"
|
|
|
97
98
|
```bash
|
|
98
99
|
export OTEL_EXPORTER_OTLP_ENDPOINT="https://{your-environment-id}.live.dynatrace.com/api/v2/otlp"
|
|
99
100
|
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Api-Token {your-api-token}"
|
|
100
|
-
export
|
|
101
|
+
export OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE="delta"
|
|
101
102
|
```
|
|
102
103
|
|
|
103
104
|
Create an API token in Dynatrace with `openTelemetryTrace.ingest` and `metrics.ingest` scopes.
|
|
104
105
|
|
|
106
|
+
> **Note:** Dynatrace requires delta temporality for metrics — cumulative metrics are silently dropped. The `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta` setting is mandatory.
|
|
107
|
+
|
|
105
108
|
</details>
|
|
106
109
|
|
|
107
110
|
<details>
|
|
@@ -190,6 +193,8 @@ Created on `tool.execute.before`, ended on `tool.execute.after`. Includes flatte
|
|
|
190
193
|
| `gen_ai.tool.output.title` | string | Tool output title (set on completion) |
|
|
191
194
|
| `gen_ai.tool.output.metadata.*` | string | Flattened tool output metadata (max 32 keys, depth 3, strings truncated to 256 chars) |
|
|
192
195
|
| `code.language` | string | Detected programming language (edit, write, and apply_patch tools only; derived from file extension) |
|
|
196
|
+
| `opencode.file.additions` | number | Lines added (edit, write, and apply_patch tools only; omitted when zero) |
|
|
197
|
+
| `opencode.file.deletions` | number | Lines removed (edit, write, and apply_patch tools only; omitted when zero) |
|
|
193
198
|
|
|
194
199
|
#### `session_compaction` — Context Compaction Span
|
|
195
200
|
|
|
@@ -317,7 +322,7 @@ This plugin follows [OpenTelemetry GenAI Semantic Conventions](https://opentelem
|
|
|
317
322
|
git clone https://github.com/felixti/opencode-otel-plugin.git
|
|
318
323
|
cd opencode-otel-plugin
|
|
319
324
|
bun install
|
|
320
|
-
bun test #
|
|
325
|
+
bun test # 67 tests, 113 assertions
|
|
321
326
|
bun run typecheck # tsc --noEmit
|
|
322
327
|
bun run build # dist/index.js + dist/index.d.ts
|
|
323
328
|
```
|