Skip to content

fix(laboratory): emit missing canary metrics for Verify + Receive Session Proposal alerts#5709

Open
svenvoskamp wants to merge 3 commits into
mainfrom
svenvoskamp/verify-alerts-firing
Open

fix(laboratory): emit missing canary metrics for Verify + Receive Session Proposal alerts#5709
svenvoskamp wants to merge 3 commits into
mainfrom
svenvoskamp/verify-alerts-firing

Conversation

@svenvoskamp

@svenvoskamp svenvoskamp commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Problem

Two groups of Grafana canary alerts have been firing continuously — both on No Data, not real regressions. Verified against the monitoring AWS account (namespace prod_Canary_Web3Modal, eu-central-1).

1. AppKit Verify (Happy + Unhappy Scam) — 4 alerts

HappyPath.verify.* / UnhappyPath.verify-scam.* have 0 datapoints over 90 days. The verify tests in verify.spec.ts are @canary-tagged with metric annotations, but the file never registered an afterEach calling afterEachCanary(), so results were never uploaded (only canary.spec.ts / siwe-email.spec.ts had it).

2. AppKit Receive Session Proposal Timing (> 7000ms) — 4 alerts

The alert queries HappyPath.sign.timing.pairingReceiveSessionProposal, which also has 0 datapoints — while receiveSessionProposal is healthy (~1.8s, never >7s). pairingReceiveSessionProposal was only recorded when pairingCreatedTime was set, captured by scraping a WalletConnect set … core/pairing/pairing console log that no longer fires. So it was never published and the alert fired on No-Data.

Fixes

  1. verify.spec.ts — add afterEachafterEachCanary for the two @canary verify fixtures, mirroring canary.spec.ts. Non-canary tests sharing the fixtures are skipped by the tag guard.
  2. w3m-wallet-fixture.ts — capture pairingCreatedTime deterministically when the wallet starts processing the URI, and push pairingReceiveSessionProposal unconditionally. Metric name unchanged, so the existing Grafana alert gets data with no dashboard change.

Result

Once deployed and the canary runs, all 8 alerts get real data and evaluate genuine pass/fail / latency instead of No-Data. No Grafana provisioning change required.

🤖 Generated with Claude Code

The verify canary tests in verify.spec.ts are tagged @canary with metric
annotations (HappyPath.verify, UnhappyPath.verify-scam) but never registered
an afterEach hook to upload their results, so HappyPath.verify.* and
UnhappyPath.verify-scam.* were never published to CloudWatch. Their Grafana
alerts therefore fired continuously on No-Data.

Add afterEach hooks calling afterEachCanary for the two @canary-tagged verify
fixtures, mirroring canary.spec.ts. Non-canary tests sharing these fixtures are
skipped by afterEachCanary's tag guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: be93fb3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
appkit-demo Ready Ready Preview, Comment Jul 10, 2026 9:24am
appkit-gallery Ready Ready Preview, Comment Jul 10, 2026 9:24am
appkit-headless-sample-app Ready Ready Preview, Comment Jul 10, 2026 9:24am
appkit-laboratory Ready Ready Preview, Comment Jul 10, 2026 9:24am
9 Skipped Deployments
Project Deployment Actions Updated (UTC)
appkit-basic-example Ignored Ignored Jul 10, 2026 9:24am
appkit-basic-sign-client-example Ignored Ignored Jul 10, 2026 9:24am
appkit-basic-up-example Ignored Ignored Jul 10, 2026 9:24am
appkit-ethers5-bera Ignored Ignored Jul 10, 2026 9:24am
appkit-nansen-demo Ignored Ignored Jul 10, 2026 9:24am
appkit-wagmi-cdn-example Ignored Ignored Jul 10, 2026 9:24am
ethereum-provider-wagmi-example Ignored Ignored Jul 10, 2026 9:24am
next-wagmi-solana-bitcoin-example Ignored Ignored Jul 10, 2026 9:24am
vue-wagmi-example Ignored Ignored Jul 10, 2026 9:24am

Request Review

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Visual Regression Test Results ✅ Passed

⚠️ 20 visual change(s) detected

Chromatic Build: https://www.chromatic.com/build?appId=6493191bf4b10fed8ca7353f&number=956
Storybook Preview: https://6493191bf4b10fed8ca7353f-ktbdmyoodh.chromatic.com/

👉 Please review the visual changes in Chromatic and accept or reject them.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Check

All bundles are within size limits

📊 View detailed bundle sizes

> @reown/appkit-monorepo@1.7.1 size /home/runner/work/appkit/appkit


> size-limit

@reown/appkit - Main Entry
Size limit:   80 kB
Size:         75.84 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 374 ms   on Snapdragon 410
Total time:   1.9 s
@reown/appkit/react
Size limit:   236 kB
Size:         235.08 kB with all dependencies, minified and gzipped
Loading time: 4.6 s     on slow 3G
Running time: 970 ms    on Snapdragon 410
Total time:   5.6 s
@reown/appkit/vue
Size limit:   80 kB
Size:         75.84 kB with all dependencies, minified and gzipped
Loading time: 1.5 s    on slow 3G
Running time: 628 ms   on Snapdragon 410
Total time:   2.2 s
@reown/appkit-scaffold-ui
Size limit:   220 kB
Size:         214.38 kB with all dependencies, minified and gzipped
Loading time: 4.2 s     on slow 3G
Running time: 775 ms    on Snapdragon 410
Total time:   5 s
@reown/appkit-ui
Size limit:   500 kB
Size:         13.16 kB with all dependencies, minified and gzipped
Loading time: 258 ms   on slow 3G
Running time: 55 ms    on Snapdragon 410
Total time:   312 ms

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.57% 40062 / 50987
🔵 Statements 78.57% 40062 / 50987
🔵 Functions 76.04% 4279 / 5627
🔵 Branches 86.69% 9780 / 11281
File CoverageNo changed files found.
Generated in workflow #17174 for commit be93fb3 by the Vitest Coverage Report Action

…iably emit

The "AppKit Receive Session Proposal Timing > 7000ms" Grafana alerts (all 4
regions) were firing on No-Data, not on real latency. Their query targets
HappyPath.sign.timing.pairingReceiveSessionProposal, which the canary only
recorded when pairingCreatedTime was set — and that was captured by scraping a
WalletConnect "set core/pairing/pairing" console log that no longer fires. So
the metric was never published (0 datapoints in CloudWatch), while the
unconditional receiveSessionProposal metric stayed healthy (~1.8s).

Capture pairingCreatedTime deterministically when the wallet begins processing
the connection URI instead of depending on SDK console output, and push the
metric unconditionally. The metric name is unchanged, so the existing Grafana
alert starts receiving data with no dashboard change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@svenvoskamp svenvoskamp changed the title fix(laboratory): emit verify canary metrics to CloudWatch fix(laboratory): emit missing canary metrics for Verify + Receive Session Proposal alerts Jul 10, 2026
@svenvoskamp

Copy link
Copy Markdown
Contributor Author

Why these alerts fired, and what this PR changes

Both alert groups were firing on No Data — not on a real Verify failure or a real latency regression. Verified directly against the monitoring AWS account (namespace prod_Canary_Web3Modal, eu-central-1).

Summary

Alert group Metric queried Data in CloudWatch Real cause Alert age
Verify Happy / Unhappy Scam (4) HappyPath.verify.*, UnhappyPath.verify-scam.* 0 datapoints, ever (90d, all regions) Metric never uploaded (missing afterEachCanary hook) New (~1 day)
Receive Session Proposal Timing (4) HappyPath.sign.timing.pairingReceiveSessionProposal 0 datapoints Metric stopped emitting (broken console-log dependency) Old (~15 days)

Health check for contrast — metrics that are emitted and healthy:

Metric Status
HappyPath.sign.success ✅ ~96/day, healthy
HappyPath.sign.timing.receiveSessionProposal ✅ ~1.8s avg, max ~2.7s (never near 7s)
HappyPath.verify.* / UnhappyPath.verify-scam.* ❌ absent
HappyPath.sign.timing.pairingReceiveSessionProposal ❌ absent

1. AppKit Verify (Happy + Unhappy Scam)

  • Issue: the 4 alerts query HappyPath.verify.* / UnhappyPath.verify-scam.*, which have zero datapoints ever. They detect No-Data, not a failing Verify feature.
  • Why it happened: canary results are only uploaded by an afterEachafterEachCanary() hook. verify.spec.ts tagged its tests @canary and gave them metric names, but never registered that hook (only canary.spec.ts / siwe-email.spec.ts did). Results were silently discarded.
  • Why it wasn't firing before: the alert rules are new. The metric was always missing, but a No-Data alert can't fire until it exists. These rules were provisioned ~1 day ago (matches recent Grafana provisioning activity) and went straight to Firing.
  • Fix (verify.spec.ts): add afterEachafterEachCanary for the two @canary verify fixtures, mirroring canary.spec.ts. Non-canary tests sharing the fixtures are skipped by the @canary-tag guard.

2. AppKit Receive Session Proposal Timing (> 7000ms)

  • Issue: the alert queries HappyPath.sign.timing.pairingReceiveSessionProposal, which returns 0 rows, while the similarly-named receiveSessionProposal is healthy (~1.8s). The 7000ms threshold was never actually being evaluated.
  • Why it happened: in w3m-wallet-fixture.ts, pairingReceiveSessionProposal was only recorded when pairingCreatedTime was set — and that was captured by scraping the wallet console for a WalletConnect set … core/pairing/pairing log. That log stopped firing (SDK log change), so pairingCreatedTime stayed null and the metric was never pushed.
// before — only recorded if a console log happened to fire
walletPage.page.on('console', msg => {
  if (msg.text().includes('set') && msg.text().includes('core/pairing/pairing')) {
    pairingCreatedTime = new Date()
  }
})
...
if (pairingCreatedTime) {            // never true anymore
  timingRecords.push({ item: 'pairingReceiveSessionProposal', ... })
}
  • Why it wasn't firing before: opposite of the Verify case — the alert is old and the metric broke. Before ~15 days ago the log fired, the metric published healthy (< 7000ms) values, and the alert was green. When the log dependency broke, the metric went silent → No-Data → Firing (~15 days, matching the metric's disappearance).
  • Fix (w3m-wallet-fixture.ts): capture pairingCreatedTime deterministically when the wallet starts processing the URI, and push the metric unconditionally — no SDK log dependency, so it can't silently break again. Metric name unchanged, so the existing Grafana alert gets data with no dashboard change.
// after — deterministic, always recorded
const pairingCreatedTime = new Date()
...
timingRecords.push({
  item: 'pairingReceiveSessionProposal',
  timeMs: proposalReceived.getTime() - pairingCreatedTime.getTime()
})

Common thread

Both are No-Data firings from opposite directions: Verify = metric never emitted + new alert; Receive Session Proposal = metric used to emit but broke + old alert. Neither is a real product/latency issue. After this deploys and the canary runs, all 8 alerts get real data and evaluate genuine pass/fail / latency.

Caveat: the Verify side is fully confirmed from CloudWatch (0 datapoints vs. healthy comparators). The "broke ~15 days ago" timing for pairingReceiveSessionProposal is inferred from the 15-day firing streak + current absence; I didn't pull a 90-day history for that specific metric.

Convert the consecutive line comments to a capitalized starred block comment
(multiline-comment-style / capitalized-comments).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 10, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

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