Skip to content

feat: name the class of a failed device connection in its usage event - #2172

Merged
yansfil merged 1 commit into
mainfrom
feat/device-failure-reason
Nov 6, 2026
Merged

yansfil merged 1 commit into
mainfrom
feat/device-failure-reason

Conversation

@yansfil

@yansfil yansfil commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Related: #2170 (이 PR의 base, 먼저 머지)

Summary

기기 연결 실패 이벤트가 install/download 단계만 알려 줘서, 기기를 한 번도 연결하지 못한 설치본 17대가 왜 실패했는지 PostHog로 알 수 없었습니다.
이제 실패 이벤트에 failure 속성을 붙입니다: 기기 행이 이미 쓰는 SSH 분류(ssh_unreachable, ssh_sign_in_refused, ssh_host_key_changed 등 13가지)나 실패한 단계(no_transport, helper_lost, kit_refused, kit_failed 등).
닫힌 목록만 보내고 오류 원문은 보내지 않습니다: 원문에는 호스트 이름, 주소, 경로가 들어 있어 로컬 로그에만 남습니다.

스크린샷 없음: 화면이 아닌 사용 통계 전송만 바뀝니다.

Review

  • 판단해 주세요: 개인정보 안내에 적힌 전송 항목에 failure(닫힌 분류)가 하나 늘어납니다. 안내 문서를 고쳐야 하는지.
  • 판단해 주세요: failed_step은 PostHog의 기존 대시보드를 위해 남겼고, 이제 failure에서 계산됩니다(download만 download, 나머지는 install).
  • 조심해서 볼 파일: herdr-core/src/product_analytics.rs - 전송 어휘의 유일한 주인. SSH 분류는 SshProblem을 match로 하나씩 적어서, 분류가 늘면 컴파일이 막힙니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/device_analytics.rs, hosts.rs, devices.rs, kit.rs - 실패 경로마다 분류를 붙였습니다. 이유가 다르면 #2170의 "같은 결과는 한 번만" 비교에서도 다른 결과로 셉니다.

Evidence

  • 확인한 것: a_device_failure_names_its_class_and_never_its_text(전송 속성), 꺼진 기기 재시도 테스트가 ssh_unreachable 실패 한 건만 보냄, SSH 설정에 없는 별칭 등록은 no_transport, 키트 실패는 kit_failed. herdr-core device/analytics 테스트 312개와 hided analytics 테스트 2개 통과, fmt-check, clippy -D warnings(herdr-core, hided) 통과.
  • 확인하지 못한 것: 실제 PostHog 수신은 확인하지 않았습니다. 배포 후 failure별 분포를 보면 됩니다.
Verification record
  • base: 5c0530a87 (fix: send a device connection outcome only when it changes #2170 head), head: 2f3a3ae82
  • scripts/verify-cargo.sh nextest -p herdr-core --lib -E 'test(/device/) | test(/analytics/)': 312 passed
  • scripts/verify-cargo.sh nextest -p hided -E 'test(/analytics/)': 2 passed
  • scripts/verify-cargo.sh fmt-check, clippy -p herdr-core -p hided --all-targets -- -D warnings: pass

A failed hide_device_connected said only install or download, so the
17 installations that never connected a device could not be told
apart. The event now adds failure, a closed class: the device row's
ssh classification (ssh_unreachable, ssh_sign_in_refused, ...) or the
step that failed (no_transport, helper_lost, kit_failed, ...). The
error's text stays in the local log, since it carries host names,
addresses and paths.
Base automatically changed from fix/device-analytics-retries to main November 6, 2026 15:13
@yansfil
yansfil enabled auto-merge November 6, 2026 15:14
@yansfil
yansfil disabled auto-merge November 6, 2026 15:17
@yansfil
yansfil added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 6ef970d Nov 6, 2026
64 checks passed
@yansfil
yansfil deleted the feat/device-failure-reason branch November 6, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant