Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions acceptance/bundle/dms/no-resources/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/dms-no-resources-[
Files: 3 uploaded, 0 deleted
Resources: 0 created, 0 changed, 0 deleted, 0 unchanged

>>> deployment_history_telemetry
deployment_history_enabled true

>>> print_requests.py --dms //api/2.0/bundle --get
{
"method": "POST",
Expand Down
1 change: 1 addition & 0 deletions acceptance/bundle/dms/no-resources/script
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ envsubst < databricks.yml.tmpl > databricks.yml

title "First deploy of a bundle with no resources: the deployment is created, and its workspace node identifies it even though no resource state was written"
trace $CLI bundle deploy
trace deployment_history_telemetry
trace print_requests.py --dms //api/2.0/bundle --get
trace MSYS_NO_PATHCONV=1 $CLI workspace get-status "/Workspace/Users/${CURRENT_USER_NAME}/.bundle/dms-no-resources-${UNIQUE_NAME}/default/state/resources.deployment.json" | jq '{object_type,path}'

Expand Down
4 changes: 4 additions & 0 deletions acceptance/bundle/dms/script.prepare
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ dms_plan() {
trace $CLI bundle plan "$@" -o json | jq 'del(.plan)'
trace $CLI bundle plan "$@"
}

deployment_history_telemetry() {
jq -r 'select(.path? == "/telemetry-ext") | .body.protoLogs[] | fromjson | .entry.databricks_cli_log.bundle_deploy_event.experimental.bool_values[] | select(.key == "deployment_history_enabled") | "\(.key) \(.value)"' "$OUT_REQUESTS"
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ Resources: 1 created, 0 changed, 0 deleted, 0 unchanged
"key": "has_classic_interactive_compute",
"value": false
},
{
"key": "deployment_history_enabled",
"value": false
},
{
"key": "app_lifecycle_started",
"value": true
Expand Down
4 changes: 4 additions & 0 deletions acceptance/bundle/telemetry/deploy/out.telemetry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
{
"key": "has_classic_interactive_compute",
"value": false
},
{
"key": "deployment_history_enabled",
"value": false
}
],
"bundle_mode": "TYPE_UNSPECIFIED",
Expand Down
9 changes: 4 additions & 5 deletions acceptance/script.prepare
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,11 @@ nostamp() {
env -u MSYS_NO_PATHCONV nostamp.py "$@"
}

# The engine_terraform_* keys reflect the deployment engine opt-in; engine_terraform_env
# in particular mirrors $DATABRICKS_BUNDLE_ENGINE, which the acceptance matrix sets per
# variant, so it diverges across the matrix. Drop both here so this shared helper stays
# engine-agnostic; they are asserted per-engine in bundle/telemetry/deploy.
# The engine_terraform_* and deployment_history_enabled keys reflect matrix settings, so they
# legitimately diverge across variants. Drop them here so this shared helper stays
# matrix-agnostic; engine selection is asserted in bundle/telemetry/deploy.
print_telemetry_bool_values() {
jq -r 'select(.path? == "/telemetry-ext") | (.body.protoLogs // [])[] | fromjson | ( (.entry // .) | (.databricks_cli_log.bundle_deploy_event.experimental.bool_values // []) ) | map("\(.key) \(.value)") | .[]' "$OUT_REQUESTS" | grep -v '^engine_terraform_' | sort
jq -r 'select(.path? == "/telemetry-ext") | (.body.protoLogs // [])[] | fromjson | ( (.entry // .) | (.databricks_cli_log.bundle_deploy_event.experimental.bool_values // []) ) | map("\(.key) \(.value)") | .[]' "$OUT_REQUESTS" | grep -Ev '^(engine_terraform_|deployment_history_enabled )' | sort
}

sethome() {
Expand Down
1 change: 1 addition & 0 deletions bundle/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const (
PresetsNamePrefixIsSet = "presets_name_prefix_is_set"
AppLifecycleStarted = "app_lifecycle_started"
ClusterLifecycleStarted = "cluster_lifecycle_started"
DeploymentHistoryEnabled = "deployment_history_enabled"
SqlWarehouseLifecycleStarted = "sql_warehouse_lifecycle_started"
SelectUsed = "select_used"

Expand Down
1 change: 1 addition & 0 deletions bundle/phases/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func aiRuntimeTaskMetrics(jobs map[string]*resources.Job) (present, scheduled, m
// LogDeployTelemetry logs a telemetry event for a bundle deploy command.
func LogDeployTelemetry(ctx context.Context, b *bundle.Bundle, errMsg string) {
errMsg = telemetry.ScrubErrorMessage(errMsg)
b.Metrics.SetBoolValue(metrics.DeploymentHistoryEnabled, b.DeploymentBundle.StateDB.IsDeploymentMetadataService())

resourcesCount := int64(0)
_, err := dyn.MapByPattern(b.Config.Value(), dyn.NewPattern(dyn.Key("resources"), dyn.AnyKey(), dyn.AnyKey()), func(p dyn.Path, v dyn.Value) (dyn.Value, error) {
Expand Down
Loading