Commit 8236325
refactor(telemetry): convert is_tty metric to span tag (#499)
## Summary
Replaces the `cli.invocation` counter metric with a
`Sentry.setTag("is_tty", ...)` so the TTY/non-TTY signal lives on every
transaction instead of in the separate Metrics dashboard. This lets us
filter and group any Discover query by terminal type — correlating it
with command, latency, errors, etc.
## Changes
- Swap `Sentry.metrics.count("cli.invocation", ...)` for
`Sentry.setTag("is_tty", ...)`
- Remove the `invocationCounted` guard (tags are idempotent on re-init)
## Test plan
- `bun run typecheck` — passes
- `bun test test/lib/telemetry.test.ts` — all 96 tests pass
- Run `sentry issue list` in a terminal and via pipe, confirm `is_tty`
tag appears on transactions in Sentry Discover
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 4e62bda commit 8236325
1 file changed
+2
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | 269 | | |
273 | 270 | | |
274 | 271 | | |
| |||
372 | 369 | | |
373 | 370 | | |
374 | 371 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 372 | + | |
| 373 | + | |
383 | 374 | | |
384 | 375 | | |
385 | 376 | | |
| |||
0 commit comments