Skip to content

Commit

Permalink
Add setting to allow for disabling orchestration telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
bunchesofdonald committed Dec 17, 2024
1 parent 3d0f51c commit d3d1143
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/v3/develop/settings-ref.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,18 @@ API URL for Prefect Cloud. Used for authentication with Prefect Cloud.
**Supported environment variables**:
`PREFECT_CLOUD_API_URL`

### `disable_orchestration_telemetry`
Whether or not to disable orchestration telemetry.

**Type**: `boolean`

**Default**: `False`

**TOML dotted key path**: `cloud.disable_orchestration_telemetry`

**Supported environment variables**:
`PREFECT_CLOUD_DISABLE_ORCHESTRATION_TELEMETRY`

### `ui_url`
The URL of the Prefect Cloud UI. If not set, the client will attempt to infer it.

Expand Down
9 changes: 9 additions & 0 deletions schemas/settings.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,15 @@
"title": "Api Url",
"type": "string"
},
"disable_orchestration_telemetry": {
"default": false,
"description": "Whether or not to disable orchestration telemetry.",
"supported_environment_variables": [
"PREFECT_CLOUD_DISABLE_ORCHESTRATION_TELEMETRY"
],
"title": "Disable Orchestration Telemetry",
"type": "boolean"
},
"ui_url": {
"anyOf": [
{
Expand Down
5 changes: 5 additions & 0 deletions src/prefect/settings/models/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class CloudSettings(PrefectBaseSettings):
description="API URL for Prefect Cloud. Used for authentication with Prefect Cloud.",
)

disable_orchestration_telemetry: bool = Field(
default=False,
description="Whether or not to disable orchestration telemetry.",
)

ui_url: Optional[str] = Field(
default=None,
description="The URL of the Prefect Cloud UI. If not set, the client will attempt to infer it.",
Expand Down
3 changes: 3 additions & 0 deletions src/prefect/telemetry/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def setup_telemetry() -> (
if server_type != ServerType.CLOUD:
return None, None, None

if settings.cloud.disable_orchestration_telemetry:
return None, None, None

if not settings.api.key:
logger.warning(
"A Prefect Cloud API key is required to enable telemetry. Please set "
Expand Down
1 change: 1 addition & 0 deletions tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
"PREFECT_CLI_PROMPT": {"test_value": True},
"PREFECT_CLI_WRAP_LINES": {"test_value": True},
"PREFECT_CLOUD_API_URL": {"test_value": "https://cloud.prefect.io"},
"PREFECT_CLOUD_DISABLE_ORCHESTRATION_TELEMETRY": {"test_value": False},
"PREFECT_CLOUD_UI_URL": {"test_value": "https://cloud.prefect.io"},
"PREFECT_DEBUG_MODE": {"test_value": True},
"PREFECT_DEFAULT_DOCKER_BUILD_NAMESPACE": {"test_value": "prefect", "legacy": True},
Expand Down

0 comments on commit d3d1143

Please sign in to comment.