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

Synchronize observability settings during versions deploy #7091

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

taylorlee
Copy link
Contributor

@taylorlee taylorlee commented Oct 24, 2024

In addition to logpush and tail_consumers, patch observability settings
on version deploy. This still doesn't quite match the behavior of
"wrangler deploy", which will disable observability if it is not defined
in wrangler.toml (as of #6776), but at least this is more correct for now.

@taylorlee taylorlee requested a review from a team as a code owner October 24, 2024 20:53
Copy link

changeset-bot bot commented Oct 24, 2024

🦋 Changeset detected

Latest commit: cab588b

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

@taylorlee taylorlee changed the title Syncrhonize observability settings during versions deploy Synchronize observability settings during versions deploy Oct 24, 2024
Copy link
Contributor

github-actions bot commented Oct 24, 2024

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/11522361067/npm-package-wrangler-7091

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11522361067/npm-package-wrangler-7091 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11522361067/npm-package-create-cloudflare-7091 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11522361067/npm-package-cloudflare-kv-asset-handler-7091
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11522361067/npm-package-miniflare-7091
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11522361067/npm-package-cloudflare-pages-shared-7091
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11522361067/npm-package-cloudflare-vitest-pool-workers-7091
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11522361067/npm-package-cloudflare-workers-editor-shared-7091
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11522361067/npm-package-cloudflare-workers-shared-7091
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/11522361067/npm-package-cloudflare-workflows-shared-7091

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


wrangler@3.83.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20241022.0
workerd 1.20241022.0 1.20241022.0
workerd --version 1.20241022.0 2024-10-22

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

) {
const maybeUndefinedSettings = {
logpush: config.logpush,
tail_consumers: config.tail_consumers,
observability: config.observability, // TODO reconcile with how regular deploy handles empty state
Copy link
Member

Choose a reason for hiding this comment

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

What's the desired end state here when it's empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure. When @RamIdeas added versions-deploy, any undefined settings are not synchronized. When @zebp added observability to regular deploy, it defaults to false when undefined.

It would be unfortunate to need to always patch settings to false for undefined observabililty, but that is the simplest way to reconcile them.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the default is false then how about we remove the default (make it undefined, i.e. falsey) so this just works™️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RamIdeas I'm not sure I follow. The default does seem to be undefined/falsey, but the difference between deploy and versions-deploy is that deploy always patches the full NonVersionedScriptSettings whereas versions-deploy only does so if at least one field is defined.

So deploy with undefined observability will disable it, whereas versions-deploy will leave it unchanged. Should we always patch during versions-deploy? Or conditionally patch during deploy? Or leave them slightly different?

@taylorlee taylorlee force-pushed the tlee/sync-observability-in-versions-deploy branch from 1dfe8b0 to 2f56dcf Compare October 25, 2024 01:38
@taylorlee taylorlee added the e2e Run e2e tests on a PR label Oct 25, 2024
In addition to logpush and tail_consumers, patch observability settings
on version deploy. This still doesn't quite match the behavior of
"wrangler deploy", which will disable observability if it is not defined
in wrangler.toml (as of #6776), but at least this is more correct for now.
@taylorlee taylorlee force-pushed the tlee/sync-observability-in-versions-deploy branch from 2f56dcf to cab588b Compare October 25, 2024 17:01
│ Synced non-versioned settings:
│ logpush: <skipped>
│ observability: enabled: false
Copy link
Contributor

@RamIdeas RamIdeas Oct 25, 2024

Choose a reason for hiding this comment

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

should we display head_sampling_rate with <skipped> if it's not present? to avoid this single-entry nested value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to go with whatever you suggest, but I would personally find that confusing. logpush: <skipped> means that wrangler left the remote state unchanged. Omitting head_sampling_rate does not skip synchronizing that field, but causes the default behavior of 100% sampling, which may be different from the prior setting.

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

Successfully merging this pull request may close these issues.

3 participants