Skip to content

Commit

Permalink
[wrangler]: add wrangler telemetry commands and update existing inf…
Browse files Browse the repository at this point in the history
…o on telemetry collection (#18350)

* add telemetry commands and update existing

* update link + pr feedback

* pr feedback 2

* metrics -> data

* Update src/content/docs/workers/wrangler/commands.mdx

Co-authored-by: Jun Lee <junlee@cloudflare.com>

---------

Co-authored-by: Jun Lee <junlee@cloudflare.com>
  • Loading branch information
emily-shen and Oxyjun authored Dec 6, 2024
1 parent 080c6d4 commit 9544d57
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,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 data 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/packages/wrangler/telemetry.md).

- `limits` Limits optional

Expand Down
35 changes: 35 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 data.

:::note

Expand Down Expand Up @@ -2602,3 +2603,37 @@ 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/packages/wrangler/telemetry.md).

You can manage sharing of usage data at any time using these commands.

### `disable`

Disable telemetry collection for Wrangler.

```txt
wrangler telemetry disable
```

### `enable`

Enable telemetry collection for Wrangler.

```txt
wrangler telemetry enable
```

### `status`

Check whether telemetry collection is currently enabled. The return result is specific to the directory where you have run the command.

This will resolve the global status set by `wrangler telemetry disable / enable`, the environment variable [`WRANGLER_SEND_METRICS`](/workers/wrangler/system-environment-variables/#supported-environment-variables), and the [`send_metrics`](/workers/wrangler/configuration/#top-level-only-keys) key in `wrangler.toml`.

```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 @@ -76,7 +76,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 data 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/packages/wrangler/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`. Defaults to `true`. Controls whether Wrangler can send anonymous usage data to Cloudflare for this project. You can learn more about this in our [data policy](https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md).

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

Expand All @@ -52,7 +52,7 @@ Wrangler supports the following environment variables:

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

* Options for Logging levels are `"none"`, `"error"`, `"warn"`, `"info"`, `"log"` and `"debug"`. Levels are case-insensitive and default to `"log"`. If an invalid level is specified, Wrangler will fallback to the default.
* Options for Logging levels are `"none"`, `"error"`, `"warn"`, `"info"`, `"log"` and `"debug"`. Levels are case-insensitive and default to `"log"`. If an invalid level is specified, Wrangler will fallback to the default. Logs can include requests to Cloudflare's API, any usage data being collected, and more verbose error logs.

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

Expand Down

0 comments on commit 9544d57

Please sign in to comment.