Commit b512028
authored
Add telemetry event for SSH tunnel connections (#4881)
## Changes
Add a `SshTunnelEvent` telemetry event that fires once per `ssh connect`
/ `ssh proxy` / IDE-mode invocation in
`experimental/ssh/internal/client/client.go`.
Captured fields:
- `compute_type` — dedicated cluster or serverless
- `accelerator_type` — GPU accelerator for serverless (empty for
dedicated)
- `ide_type` — IDE that initiated the connection (e.g. `vscode`,
`cursor`), empty for raw SSH / proxy
- `client_mode` — `SSH_CLIENT`, `PROXY`, or `IDE`
- `is_reconnect` — true when invoked with `ServerMetadata` (a follow-up
connection re-using an existing server)
- `auto_start_cluster` — whether `--auto-start-cluster` was set
- `server_start_time_ms` — time spent inside `ensureSSHServerIsRunning`;
0 on reconnect
- `is_success` — set to true only after the connection is fully
established
New files:
- `libs/telemetry/protos/ssh_tunnel.go` — event struct and the
`SshTunnelComputeType` / `SshTunnelClientMode` string-enum types,
following the same pattern as `BundleMode` in `enum.go`.
- Wires the event into `DatabricksCliLog` in
`libs/telemetry/protos/frontend_log.go`.
Emission is done from a `defer` registered before the first early-return
path inside `Run`, so the event fires on every exit (cluster-state
failure, binary-upload failure, metadata-parse failure, success) rather
than only the original two explicit call sites.
## Why
We have no visibility into how the experimental SSH tunnel feature is
being used. We want to answer basic questions before promoting it out of
experimental:
- Dedicated vs serverless split
- IDE breakdown (raw SSH client vs proxy vs IDE-initiated, and which
IDEs)
- Success rate and where failures cluster
- How long server startup takes on serverless (cold start signal)
The `defer` pattern is deliberate: an event emitted only on the happy
path would under-report failures and bias all of the above metrics.
## Tests
- `task test-exp-ssh` passes on linux/macos/windows (all green in CI).
- `task lint` clean.
- Verified locally that the event is recorded on the in-memory telemetry
logger for both dedicated and serverless invocations, including failure
paths (cluster-state check failure, binary upload failure).
No new test files: this repo has no existing tests asserting on
telemetry event payloads — `BundleInitEvent` and `BundleDeployEvent` are
emitted untested as well (`bundle/phases/telemetry.go`,
`libs/template/writer.go`). Adding a fixture-based test only for
`SshTunnelEvent` would be inconsistent with the rest of the codebase;
that work should land as a separate PR if we want it.
No `NEXT_CHANGELOG.md` entry: the feature is under `experimental/` and
the change is internal telemetry, not a user-visible behavior change.1 parent 2f4a983 commit b512028
3 files changed
Lines changed: 91 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
265 | 267 | | |
266 | 268 | | |
267 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
268 | 277 | | |
269 | 278 | | |
270 | 279 | | |
| |||
311 | 320 | | |
312 | 321 | | |
313 | 322 | | |
| 323 | + | |
314 | 324 | | |
315 | 325 | | |
316 | 326 | | |
| |||
319 | 329 | | |
320 | 330 | | |
321 | 331 | | |
| 332 | + | |
322 | 333 | | |
323 | 334 | | |
324 | 335 | | |
| |||
355 | 366 | | |
356 | 367 | | |
357 | 368 | | |
| 369 | + | |
| 370 | + | |
358 | 371 | | |
359 | 372 | | |
360 | 373 | | |
| |||
728 | 741 | | |
729 | 742 | | |
730 | 743 | | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments