refactor(metrics): slim ops telemetry API#2913
Open
alex-connolly wants to merge 2 commits into
Open
Conversation
Replace the GDPR-heavy metrics client with configure + track only, map to the existing sdk-analytics v1 wire format, and remove metrics from checkout, orderbook, config, and minting-backend. Co-authored-by: Cursor <cursoragent@cursor.com>
Regenerate the lockfile so frozen CI installs match package.json after dropping @imtbl/metrics from config, checkout, orderbook, and minting-backend. Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Audience Bundle Size — @imtbl/audience
Budget: 24.00 KB gzipped (warn at 20.00 KB) |
✅ Pixel Bundle Size — @imtbl/pixel
Budget: 10.00 KB gzipped (warn at 8.00 KB) |
|
View your CI Pipeline Execution ↗ for commit cf53571
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
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
Slims the TypeScript client API of
@imtbl/metricsfor GDPR-safer ops telemetry, while keeping the existing/v1/sdk/metrics(sdk-analytics v1) backend contract unchanged.TypeScript interface (breaking)
Before (broad analytics-style surface):
After (ops-only):
Call sites that used free-form property bags, flow step chains, or identity must migrate to the slim
trackshape (or stop tracking).Backend interface (unchanged)
Clients still
POST https://api.immutable.com/v1/sdk/metricswith a base64-encoded v1 envelope:The new client maps slim events into that shape:
track('passport', 'login')passport.logintrack(…, { durationMs })module.namedurationMstrack(…, { error })module.trackError_nameisTrackError, optionalerrorName/errorCoderidis still required by the backend hash check; the client now generates an opaque per-session id locally (no init/fingerprint round-trip). New Relic / sdk-analytics consumers that key onmodule.name/module.trackError_*keep working.Data we keep / gain / lose
Keep (ops signal)
sdkVersionin details)module.name)durationMs)clientIdviaconfigure→passportClientIdon the wirerid(opaque; not user identity)Lose (intentionally dropped for privacy / scope)
identify, passport id / eth address, traitswalletType,makerAddress,anonymousId, flow step labels, etc.)flowId,flowName, multi-stepaddEventtimelinesGain
Methods / areas still tracked
{ error })passportinitialise,login,loginCallback,logout,getIdToken,getAccessToken,loginWithPKCEFlow,loginWithPKCEFlowCallback,storeTokens,getLogoutUrl,logoutSilentCallback, standalone login/logout helpers,connectEvm,getUserInfo,getLinkedAddresses,linkExternalWalletpassport/walletethRequestAccounts,ethSendTransaction(+ error nameeth_sendTransaction),personalSign/personal_sign,ethSignTypedDataV4/eth_signTypedData,imSignEjectionTransaction, Magic TEE create/sign, session activity (sendSessionActivity,sessionActivityError),confirmationPopupDenied,linkExternalWalletaudiencetransport_send(errors),transport_send_failed,transport_partial_rejected,gpc_consent_overriddendurationMs(init/login/token/zkEVM helpers), plus failure tracks (failedCallFunction, per-fn errors)Methods / areas no longer tracked via
@imtbl/metricscheckout_sdk.buy_initiated/ sell equivalentscommercetrackFlow/trackErrorwrappers (approvals, Squid execute, bridge/sale/add-tokens flows, anonymousId attachment). Host widget events are unchanged; Segment product analytics is out of scope here (see #2914)orderbookmr.bulkListings(+ wallet address / listing count props)config.created_imtbl_config; no longer sets metrics env / publishable keyTest plan
pnpm --filter @imtbl/metrics test && pnpm --filter @imtbl/metrics typecheck && pnpm --filter @imtbl/metrics lintpnpm --filter @imtbl/audience-core testpassport.login(failures aspassport.trackError_login) to/v1/sdk/metricsin the v1 envelope@imtbl/metrics(trackError/trackFlow/identify/configure({ env }))pnpm install --frozen-lockfilesucceeds