Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add telemetry to auto provisioning #7984

Closed
wants to merge 3 commits into from
Closed

Conversation

emily-shen
Copy link
Contributor

@emily-shen emily-shen commented Jan 31, 2025

Fixes [DEVX-1618]
Sends a new adhoc telemetry event since the dispatcher cannot (currently) be used in command handlers.
draft amplitude dash: https://app.amplitude.com/analytics/cloudflare/dashboard/4h1lunzd


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: unreleased

@emily-shen emily-shen requested a review from a team as a code owner January 31, 2025 12:59
Copy link

changeset-bot bot commented Jan 31, 2025

🦋 Changeset detected

Latest commit: ef8d644

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

This PR includes changesets to release 2 packages
Name Type
wrangler Patch
@cloudflare/vitest-pool-workers Patch

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

@emily-shen emily-shen marked this pull request as draft January 31, 2025 12:59
Copy link
Contributor

github-actions bot commented Jan 31, 2025

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-wrangler-7984

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7984/npm-package-wrangler-7984

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-wrangler-7984 dev path/to/script.js
Additional artifacts:

cloudflare-workers-bindings-extension:

wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-cloudflare-workers-bindings-extension-7984 -O ./cloudflare-workers-bindings-extension.0.0.0-v4f573b88f.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v4f573b88f.vsix

create-cloudflare:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-create-cloudflare-7984 --no-auto-update

@cloudflare/kv-asset-handler:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-cloudflare-kv-asset-handler-7984

miniflare:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-miniflare-7984

@cloudflare/pages-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-cloudflare-pages-shared-7984

@cloudflare/unenv-preset:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-cloudflare-unenv-preset-7984

@cloudflare/vite-plugin:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-cloudflare-vite-plugin-7984

@cloudflare/vitest-pool-workers:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-cloudflare-vitest-pool-workers-7984

@cloudflare/workers-editor-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-cloudflare-workers-editor-shared-7984

@cloudflare/workers-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-cloudflare-workers-shared-7984

@cloudflare/workflows-shared:

npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13078166767/npm-package-cloudflare-workflows-shared-7984

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20250129.0
workerd 1.20250129.0 1.20250129.0
workerd --version 1.20250129.0 2025-01-29

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@emily-shen emily-shen added the e2e Run wrangler e2e tests on a PR label Jan 31, 2025
@emily-shen emily-shen marked this pull request as ready for review January 31, 2025 17:54
public accountId: string
public accountId: string,
/** For telemetry */
public summary: Record<string, number>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An instance of this class represents a single binding—it feels odd to be passing in a record of multiple bindings here? Why does this need to be done insdie the class? Can't we just count the number of items in pendingResources?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it is odd :/ i wanted access to the inherit/create/connect methods to record what happens to each resource, not just that they get provisioned in some way (connected or created), especially as some resources get connected before runProvisioningFlow and some after.

Although now that i'm revisiting it, i think that's probably a level of granularity that isn't necessary/important and we can just count pendingResources... yeah i'll simplify this

"wrangler": patch
---

feat: add telemetry to experimental auto-provisioning
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a sanity check: This is a patch because it is an experimental feature, right?

@@ -30,6 +31,7 @@ describe("--x-provision", () => {
const { setIsTTY } = useMockIsTTY();

beforeEach(() => {
logger.loggerLevel = "debug";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might need to restore the loggerLevel after the test or it will create a side effect for the rest of the tests.

@emily-shen emily-shen closed this Feb 10, 2025
@emily-shen
Copy link
Contributor Author

#8077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run wrangler e2e tests on a PR
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants