Skip to content

Commit

Permalink
feat(helm): add configuration for Dagster telemetry (#7190)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexledesma committed Mar 30, 2022
1 parent e66faf9 commit 404a7c1
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
from .run_launcher import RunLauncher
from .scheduler import Scheduler
from .service_account import ServiceAccount
from .telemetry import Telemetry
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from pydantic import BaseModel, Extra # pylint: disable=no-name-in-module


class Telemetry(BaseModel):
enabled: bool

class Config:
extra = Extra.forbid
1 change: 1 addition & 0 deletions helm/dagster/schema/schema/charts/dagster/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ class DagsterHelmValues(BaseModel):
dagsterDaemon: subschema.Daemon
busybox: subschema.Busybox
migrate: subschema.Migrate
telemetry: subschema.Telemetry
serviceAccount: subschema.ServiceAccount
global_: subschema.Global = Field(..., alias="global")
12 changes: 12 additions & 0 deletions helm/dagster/schema/schema_tests/test_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
RunLauncherConfig,
RunLauncherType,
)
from schema.charts.dagster.subschema.telemetry import Telemetry
from schema.charts.dagster.values import DagsterHelmValues
from schema.utils.helm_template import HelmTemplate

Expand Down Expand Up @@ -592,6 +593,17 @@ def test_custom_python_logs_missing_config(template: HelmTemplate):
assert "dagster_handler_config" not in python_logs_config


@pytest.mark.parametrize("enabled", [True, False])
def test_telemetry(template: HelmTemplate, enabled: bool):
helm_values = DagsterHelmValues.construct(telemetry=Telemetry.construct(enabled=enabled))

configmaps = template.render(helm_values)
instance = yaml.full_load(configmaps[0].data["dagster.yaml"])
telemetry_config = instance.get("telemetry")

assert telemetry_config["enabled"] == enabled


@pytest.mark.parametrize(
argnames=["json_schema_model", "compute_log_manager_class"],
argvalues=[
Expand Down
3 changes: 3 additions & 0 deletions helm/dagster/templates/configmap-instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ data:
{{- end }}
poll_interval_seconds: {{ $runMonitoring.pollIntervalSeconds }}
{{- end }}
telemetry:
enabled: {{ .Values.telemetry.enabled }}
18 changes: 18 additions & 0 deletions helm/dagster/values.schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions helm/dagster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,19 @@ extraManifests:
migrate:
enabled: false

####################################################################################################
# As an open source project, we collect usage statistics to better understand how users engage
# with Dagster and to inform development priorities.
#
# Telemetry data will motivate projects such as adding functionality in frequently-used parts of
# the product and will help us understand adoption of new features.
#
# For more details, see:
# https://docs.dagster.io/getting-started/telemetry
####################################################################################################
telemetry:
enabled: true

serviceAccount:
create: true

Expand Down

0 comments on commit 404a7c1

Please sign in to comment.