Skip to content

Commit 73763c1

Browse files
betegonclaude
andcommitted
feat(telemetry): track TTY vs non-TTY invocations via metric
Emits a `cli.invocation` counter metric with an `is_tty` attribute on every CLI call. This lets us measure what percentage of usage comes from agents and CI vs interactive terminals in the Sentry Metrics dashboard. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 23cb92c commit 73763c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/telemetry.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,11 @@ export function initSentry(enabled: boolean): Sentry.BunClient | undefined {
342342
// Tag whether targeting self-hosted Sentry (not SaaS)
343343
Sentry.setTag("is_self_hosted", !isSentrySaasUrl(getSentryBaseUrl()));
344344

345+
// Track TTY vs non-TTY invocations to measure agent/CI usage percentage
346+
Sentry.metrics.count("cli.invocation", 1, {
347+
attributes: { is_tty: !!process.stdout.isTTY },
348+
});
349+
345350
// Wire up consola → Sentry log forwarding now that the client is active
346351
attachSentryReporter();
347352

0 commit comments

Comments
 (0)