contrib: add telemetry event schema for wallet connect funnel - #348
Merged
davedumto merged 1 commit intoAug 31, 2026
Merged
Conversation
…-Wallet#290) Defines a typed event schema covering each step of the wallet connect funnel (started, WebAuthn ceremony, backend lookup, session key rotation, succeeded/failed), and a withConnectTelemetry decorator that wraps any WalletConnector to emit those events around connectWallet without modifying the connector interface. Events carry only public identifiers and outcome metadata, never secrets or signatures. A throwing telemetry hook never affects the underlying connect call. closes Vellar-Wallet#290
|
@Elizabethxxx Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@Elizabethxxx is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Defines a consistent telemetry event schema for the wallet connect funnel (start to completion) and a
withConnectTelemetrydecorator that emits those events aroundWalletConnector.connectWallet.closes #290
What's included
ConnectFunnelEventunion covering every step:connect_started,connect_webauthn_ceremony_started,connect_webauthn_ceremony_completed(carries the resolvedkeyId),connect_backend_lookup_started,connect_backend_lookup_completed(carriesfound),connect_session_key_rotated(schema slot for [medium] Rotate session key on passkeykit-connector re-authentication #223's rotation), and exactly one ofconnect_succeeded(accountId, durationMs) orconnect_failed(failedAtStep, errorName, errorMessage, durationMs). Every event carries a sharedconnectionAttemptIdso events from one call can be grouped, plustimestampandnetwork.keyId,accountId) and outcome metadata.withConnectTelemetry(connector, onEvent)wraps anyWalletConnector(src/connector.ts) and emits the funnel throughonEventon everyconnectWallet()call. The hook is best-effort: a throwing handler is caught and never affects the underlying connect call.createWalletandsignTransactionpass through unchanged.connectionAttemptId/networkacross one call's events,connect_succeededpayload correctness,keyIdpropagation,connect_failedpayload andfailedAtStepon a thrown error, telemetry-hook-throws-but-connect-still-resolves, no instrumentation leaking intocreateWallet/signTransaction, and distinctconnectionAttemptIds across concurrent calls.Placement note
The issue asks for "optional event emission hooks at each step in connector.ts". Contributor PRs may only touch
contrib/, so this ships as a decorator around the existingWalletConnectorinterface rather than editingsrc/passkeykit-connector.tsdirectly. Because the decorator can only observe the WebAuthn ceremony and backend lookup as one opaque call from outside, it emits that started/completed pair around the singleconnectWalletcall rather than at the true internal call sites. The README and code comments call this out explicitly: a maintainer merging this can lift the emission points directly intoconnectWalletinsrc/passkeykit-connector.ts(firing at the real ceremony/lookup/rotation call sites), which would be strictly more precise than the wrapper.Test plan
npx vitest run contrib/examples/issue-290-wallet-connect-telemetry— 8/8 passing