Skip to content

Add wrangler version components to metrics properties#11673

Merged
MattieTK merged 2 commits intomainfrom
mattietk/version-numbers
Dec 18, 2025
Merged

Add wrangler version components to metrics properties#11673
MattieTK merged 2 commits intomainfrom
mattietk/version-numbers

Conversation

@MattieTK
Copy link
Member

As discussed this adds new telemetry options for better sorting in analytics tooling by version number by splitting the version.


  • Tests
    • Tests included/updated
    • Tests not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: Internal only feature
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: Not a patch change

A picture of a cute animal (not mandatory, but encouraged)

(\(\
   ( -.-)
   o_(")(")

@MattieTK MattieTK requested a review from a team as a code owner December 16, 2025 18:34
Copilot AI review requested due to automatic review settings December 16, 2025 18:34
@changeset-bot
Copy link

changeset-bot bot commented Dec 16, 2025

🦋 Changeset detected

Latest commit: 5e96c0a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

This comment was marked as resolved.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 16, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11673

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11673

miniflare

npm i https://pkg.pr.new/miniflare@11673

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11673

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11673

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11673

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11673

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11673

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11673

wrangler

npm i https://pkg.pr.new/wrangler@11673

commit: 5e96c0a

@MattieTK
Copy link
Member Author

Re: copilot, I am assuming here we do not break semver and this this is fine. If we do we might want to tackle NaN responses (though also I'm not too worried about these edge cases in analytics).

@claude
Copy link
Contributor

claude bot commented Dec 17, 2025

Claude finished @MattieTK's task —— View job


Changeset Review

⚠️ Issues found

Version Type Issue (Blocking)

The changeset in .changeset/young-crews-learn.md:2 specifies "wrangler": minor, but this should be "wrangler": patch.

Reasoning:

  • According to .changeset/README.md:22-23, minor versions are for "New features, new CLI commands, new configuration options, deprecations"
  • Patch versions are for "Bug fixes, small improvements, documentation fixes"
  • This change adds internal telemetry properties (wranglerMajorVersion, wranglerMinorVersion, wranglerPatchVersion) that have no user-facing impact
  • Users don't interact with these properties - they're purely for internal analytics sorting
  • This qualifies as a "small improvement" to internal infrastructure, not a new feature

Additional Notes (Non-blocking)

The version parsing logic at packages/wrangler/src/metrics/metrics-dispatcher.ts:62-63 doesn't handle pre-release versions (e.g., 1.2.3-beta.1) or build metadata (e.g., 1.2.3+build.123). This will result in NaN values being sent to analytics for these edge cases. Based on the PR discussion, the team seems accepting of this limitation for analytics purposes, but it's worth documenting.


@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Dec 17, 2025
@edmundhung edmundhung force-pushed the mattietk/version-numbers branch from 1d53a18 to d1950de Compare December 17, 2025 17:11
@edmundhung
Copy link
Member

Just rebased it to fix the changeset review ci job error.

@MattieTK
Copy link
Member Author

@edmundhung I got confused by the changeset docs and chatting to Samuel yesterday. It may be that this doesn't need a changeset at all if Claude is correct. lmk if you need that removed.

@edmundhung
Copy link
Member

In general we expect a changeset whenever we make any changes that needs to be released. This is also not internal facing as we document what we are collecting from the telemetry in https://github.com/cloudflare/workers-sdk/blob/c0e249e3d662444720548acee70ac33a078c408f/packages/wrangler/telemetry.md

@MattieTK MattieTK force-pushed the mattietk/version-numbers branch from d1950de to 5e96c0a Compare December 18, 2025 11:35
@MattieTK MattieTK merged commit b827893 into main Dec 18, 2025
34 of 35 checks passed
@MattieTK MattieTK deleted the mattietk/version-numbers branch December 18, 2025 14:27
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Dec 18, 2025
AmirSa12 pushed a commit to AmirSa12/workers-sdk that referenced this pull request Jan 5, 2026
* test: add parsed wrangler version components to metrics events

* Added changeset
@lrapoport-cf lrapoport-cf mentioned this pull request Jan 6, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants