autotel-terminal 31.0.0 → 33.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel-terminal",
3
- "version": "31.0.0",
3
+ "version": "33.0.0",
4
4
  "description": "Terminal dashboard for autotel traces using react-ink",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,8 +23,7 @@
23
23
  },
24
24
  "files": [
25
25
  "dist",
26
- "README.md",
27
- "skills"
26
+ "README.md"
28
27
  ],
29
28
  "keywords": [
30
29
  "autotel",
@@ -54,7 +53,7 @@
54
53
  "peerDependencies": {
55
54
  "@opentelemetry/api": "^1.9.1",
56
55
  "@opentelemetry/sdk-trace-base": "^2.9.0",
57
- "autotel": "5.0.0"
56
+ "autotel": "6.1.0"
58
57
  },
59
58
  "devDependencies": {
60
59
  "@arethetypeswrong/cli": "^0.18.5",
@@ -71,7 +70,7 @@
71
70
  "typescript": "^6.0.3",
72
71
  "typescript-eslint": "^8.65.0",
73
72
  "vitest": "^4.1.10",
74
- "autotel": "5.0.0"
73
+ "autotel": "6.1.0"
75
74
  },
76
75
  "repository": {
77
76
  "type": "git",
@@ -1,231 +0,0 @@
1
- ---
2
- name: autotel-terminal
3
- description: >
4
- Use this skill when integrating the autotel-terminal dashboard into a Node.js app or running it as a standalone OTLP receiver — covers renderTerminal(), StreamingSpanProcessor, the CLI, and the AI assistant configuration.
5
- ---
6
-
7
- # autotel-terminal
8
-
9
- React-Ink powered terminal dashboard for viewing autotel OpenTelemetry spans in real-time. Two modes: embedded in your Node.js process via `renderTerminal()`, or standalone OTLP receiver via the `autotel-terminal` CLI.
10
-
11
- ## Setup
12
-
13
- ### Embedded mode (in-process)
14
-
15
- ```typescript
16
- import { init, trace } from 'autotel';
17
- import {
18
- renderTerminal,
19
- StreamingSpanProcessor,
20
- createTerminalSpanStream,
21
- } from 'autotel-terminal';
22
-
23
- // Create streaming processor (null = no forwarding, or wrap a BatchSpanProcessor)
24
- const streamingProcessor = new StreamingSpanProcessor(null);
25
-
26
- // Initialize autotel with the streaming processor
27
- init({
28
- service: 'my-app',
29
- endpoint: 'http://localhost:4318',
30
- spanProcessors: [streamingProcessor],
31
- });
32
-
33
- // Create stream and launch dashboard
34
- const stream = createTerminalSpanStream(streamingProcessor);
35
- renderTerminal({ title: 'My App Traces' }, stream);
36
- ```
37
-
38
- ### Standalone CLI (separate terminal)
39
-
40
- ```bash
41
- # Start the OTLP receiver dashboard on port 4319
42
- npx autotel-terminal
43
-
44
- # Run your app pointing at the dashboard
45
- OTEL_EXPORTER_OTLP_PROTOCOL=http/json \
46
- OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4319 \
47
- node app.js
48
- ```
49
-
50
- ## Configuration / Core Patterns
51
-
52
- ### TerminalOptions
53
-
54
- ```typescript
55
- renderTerminal(
56
- {
57
- title: 'My App Traces', // Dashboard title
58
- showStats: true, // Show span count, error rate, avg duration
59
- maxSpans: 200, // Max spans to display (default: 100)
60
- colors: true, // Auto-detected from TTY if omitted
61
- ai: {
62
- // Optional AI assistant config
63
- provider: 'ollama', // 'ollama' | 'openai' | 'openai-compatible'
64
- model: 'granite4', // Model name
65
- apiKey: 'sk-...', // For cloud providers
66
- baseUrl: 'http://...', // Custom endpoint
67
- },
68
- },
69
- stream,
70
- );
71
- ```
72
-
73
- ### StreamingSpanProcessor: wrapping an existing processor
74
-
75
- Wrap a `BatchSpanProcessor` so spans go to both the terminal dashboard and your OTLP backend:
76
-
77
- ```typescript
78
- import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
79
- import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
80
- import {
81
- StreamingSpanProcessor,
82
- createTerminalSpanStream,
83
- } from 'autotel-terminal';
84
-
85
- const exporter = new OTLPTraceExporter({
86
- url: 'http://localhost:4318/v1/traces',
87
- });
88
- const batchProcessor = new BatchSpanProcessor(exporter);
89
- const streamingProcessor = new StreamingSpanProcessor(batchProcessor);
90
-
91
- // Subscribe manually (without renderTerminal)
92
- const unsubscribe = streamingProcessor.subscribe((span) => {
93
- console.log('Span ended:', span.name);
94
- });
95
- // Later: unsubscribe()
96
- ```
97
-
98
- ### Auto-wire shortcut (no stream needed)
99
-
100
- If you call `init()` before `renderTerminal()`, autotel-terminal auto-detects the tracer provider:
101
-
102
- ```typescript
103
- import { init } from 'autotel';
104
- import { renderTerminal } from 'autotel-terminal';
105
-
106
- init({ service: 'my-app' });
107
- renderTerminal(); // No stream arg — auto-wires from current tracer provider
108
- ```
109
-
110
- ### CLI options and environment variables
111
-
112
- ```bash
113
- autotel-terminal \
114
- --port 4319 \ # env: AUTOTEL_TERMINAL_PORT
115
- --host 127.0.0.1 \ # env: AUTOTEL_TERMINAL_HOST
116
- --title "My Dashboard" \ # env: AUTOTEL_TERMINAL_TITLE
117
- --ai-provider ollama \ # env: AI_PROVIDER
118
- --ai-model granite4 \ # env: AI_MODEL
119
- --ai-api-key sk-... \ # env: AI_API_KEY
120
- --ai-base-url http://... # env: AI_BASE_URL
121
- ```
122
-
123
- CLI OTLP endpoints (all accept OTLP JSON format):
124
-
125
- | Endpoint | Signal |
126
- | ------------------ | ----------------------------- |
127
- | `POST /v1/traces` | Spans streamed into the TUI |
128
- | `POST /v1/logs` | Logs shown in logs view (`l`) |
129
- | `POST /v1/metrics` | Acknowledged and counted |
130
- | `GET /healthz` | Health check |
131
-
132
- ### AI assistant
133
-
134
- Auto-detects Ollama (if running locally) or OpenAI (if `OPENAI_API_KEY` is set). Press `a` in the dashboard to toggle the AI panel. The assistant can answer questions about the spans currently visible in the dashboard.
135
-
136
- ### Dashboard keyboard controls
137
-
138
- | Key | Action |
139
- | -------- | -------------------------------------- |
140
- | `↑/↓` | Navigate |
141
- | `Enter` | Open selected trace (span tree) |
142
- | `Esc` | Back / exit search |
143
- | `t` | Toggle trace view / span list |
144
- | `l` | Toggle logs view |
145
- | `v` | Toggle service summary |
146
- | `E` | Toggle errors view |
147
- | `/` | Search by span name |
148
- | `e` | Toggle error-only filter |
149
- | `p` | Pause / resume live updates |
150
- | `r` | Record snapshot |
151
- | `c` | Clear all spans |
152
- | `J` | Export selected trace as JSON (stdout) |
153
- | `?` | Show help overlay |
154
- | `Ctrl+C` | Exit |
155
-
156
- ## Common Mistakes
157
-
158
- ### HIGH: Calling renderTerminal() before init()
159
-
160
- Wrong:
161
-
162
- ```typescript
163
- renderTerminal({}, stream); // stream is empty, no provider wired
164
- init({ service: 'my-app', spanProcessors: [streamingProcessor] });
165
- ```
166
-
167
- Correct:
168
-
169
- ```typescript
170
- init({ service: 'my-app', spanProcessors: [streamingProcessor] });
171
- const stream = createTerminalSpanStream(streamingProcessor);
172
- renderTerminal({ title: 'My App' }, stream);
173
- ```
174
-
175
- Explanation: `init()` must run first so the `StreamingSpanProcessor` is registered with the tracer provider before any spans are created.
176
-
177
- ### HIGH: Not adding StreamingSpanProcessor to init()
178
-
179
- Wrong:
180
-
181
- ```typescript
182
- const streamingProcessor = new StreamingSpanProcessor(null);
183
- init({ service: 'my-app' }); // streamingProcessor not included
184
- const stream = createTerminalSpanStream(streamingProcessor);
185
- renderTerminal({}, stream); // Dashboard shows nothing
186
- ```
187
-
188
- Correct:
189
-
190
- ```typescript
191
- const streamingProcessor = new StreamingSpanProcessor(null);
192
- init({ service: 'my-app', spanProcessors: [streamingProcessor] });
193
- ```
194
-
195
- Explanation: `StreamingSpanProcessor` must be in the `spanProcessors` list passed to `init()`. It is not registered automatically.
196
-
197
- ### MEDIUM: Using standard OTLP port 4318 for the CLI
198
-
199
- Wrong:
200
-
201
- ```bash
202
- npx autotel-terminal --port 4318
203
- # Now conflicts with any real OTLP collector also on 4318
204
- ```
205
-
206
- Correct:
207
-
208
- ```bash
209
- npx autotel-terminal # Default is 4319, avoids the standard port
210
- ```
211
-
212
- Explanation: The CLI defaults to port 4319 deliberately so it does not clash with an existing OTLP collector on 4318.
213
-
214
- ### MEDIUM: Passing full protocol path to OTEL_EXPORTER_OTLP_ENDPOINT
215
-
216
- Wrong:
217
-
218
- ```bash
219
- OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4319/v1/traces
220
- ```
221
-
222
- Correct:
223
-
224
- ```bash
225
- OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4319
226
- # The SDK appends /v1/traces automatically
227
- ```
228
-
229
- ## Version
230
-
231
- Targets autotel-terminal v17.0.8. Requires `autotel` (peer), `@opentelemetry/api ^1.9.0`, `@opentelemetry/sdk-trace-base ^2.6.0`. Node.js 22+. Uses Ink v6 / React 19 internally.