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

[wrangler]: add wrangler telemetry commands and update existing info on telemetry collection #18350

Merged
merged 5 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ Inheritable keys are configurable at the top-level, and can be inherited (or ove

- `send_metrics` <Type text="boolean" /> <MetaInfo text="optional" />

- Whether Wrangler should send usage metrics to Cloudflare for this project.
- Whether Wrangler should send usage metrics to Cloudflare for this project. Defaults to `true`. You can learn more about this in our [data policy](https://github.com/cloudflare/workers-sdk/tree/main/telemetry.md).
Copy link
Member

Choose a reason for hiding this comment

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

How about this?

Fallbacks to the current wrangler metrics status if not defined. You can learn more about this in our data policy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

seems a bit sneaky to hide that its on by default behind an extra click 🤔

Copy link
Member

Choose a reason for hiding this comment

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

I'm just worrying if users might come across this and think they have to set sendMetrics = false to turn it off, especially if we prefer them using the telemetry command 🤔


- `limits` Limits optional

Expand Down
45 changes: 45 additions & 0 deletions src/content/docs/workers/wrangler/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Wrangler offers a number of commands to manage your Cloudflare Workers.
- [`dispatch-namespace`](#dispatch-namespace) - Interact with a [dispatch namespace](/cloudflare-for-platforms/workers-for-platforms/reference/how-workers-for-platforms-works/#dispatch-namespace).
- [`mtls-certificate`](#mtls-certificate) - Manage certificates used for mTLS connections.
- [`types`](#types) - Generate types from bindings and module rules in configuration.
- [`telemetry`](#telemetry) - Configure whether Wrangler can collect anonymous usage telemetry
emily-shen marked this conversation as resolved.
Show resolved Hide resolved

:::note

Expand Down Expand Up @@ -2585,3 +2586,47 @@ The minimum required Wrangler version to use this command is 3.66.0.
- A custom path must have a `d.ts` extension.

<Render file="wrangler-commands/global-flags" product="workers" />

---

## `telemetry`

Cloudflare collects anonymous usage data to improve Wrangler. You can learn more about this in our [data policy](https://github.com/cloudflare/workers-sdk/tree/main/telemetry.md).

You can opt-out of sharing telemetry data at any time using these commands.
emily-shen marked this conversation as resolved.
Show resolved Hide resolved

### `disable`

Disable telemetry collection for Wrangler.

```txt
wrangler telemetry disable
```

:::note

You can also disable telemetry collection on a specific project by setting the environment variable `WRANGLER_SEND_METRICS=false`.

:::

### `enable`

Enable telemetry collection for Wrangler.

```txt
wrangler telemetry enable
```

:::note

You can also enable telemetry for a specific project by setting the environment variable `WRANGLER_SEND_METRICS=true`.

:::
emily-shen marked this conversation as resolved.
Show resolved Hide resolved

### `status`

Check whether telemetry collection is currently enabled.
emily-shen marked this conversation as resolved.
Show resolved Hide resolved

```txt
wrangler telemetry status
```
2 changes: 1 addition & 1 deletion src/content/docs/workers/wrangler/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Top-level keys apply to the Worker as a whole (and therefore all environments).

- `send_metrics` <Type text="boolean" /> <MetaInfo text="optional" />

- Whether Wrangler should send usage metrics to Cloudflare for this project.
- Whether Wrangler should send usage metrics to Cloudflare for this project. Defaults to `true`. You can learn more about this in our [data policy](https://github.com/cloudflare/workers-sdk/tree/main/telemetry.md).

- `site` <Type text="object" /> <MetaInfo text="optional deprecated" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Wrangler supports the following environment variables:

* `WRANGLER_SEND_METRICS` <Type text="string" /> <MetaInfo text="optional" />

* Options for this are `true` and `false`, the default behavior is `false`.
* Options for this are `true` and `false`, the default behavior is `true`. Controls whether Wrangler can send anonymous usage metrics to Cloudflare for this project. You can learn more about this in our [data policy](https://github.com/cloudflare/workers-sdk/tree/main/telemetry.md).

* `WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING_NAME>`<Type text="string" /> <MetaInfo text="optional" />

Expand Down
Loading