Skip to content

Commit f73b5cd

Browse files
Track usage of presets.name_prefix (#2949)
## Why This information, along with mode development/production usage, will allow us to understand the impact of changing the prefixing behaviour for UC schemas. ## Tests Acceptance tests.
1 parent d10b8d9 commit f73b5cd

File tree

12 files changed

+175
-0
lines changed

12 files changed

+175
-0
lines changed

acceptance/bundle/paths/fallback_metric/output.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Deployment complete!
1414

1515
>>> cat out.requests.txt
1616
[
17+
{
18+
"key": "presets_name_prefix_is_set",
19+
"value": false
20+
},
1721
{
1822
"key": "python_wheel_wrapper_is_set",
1923
"value": false
@@ -32,6 +36,10 @@ Deployment complete!
3236
}
3337
]
3438
[
39+
{
40+
"key": "presets_name_prefix_is_set",
41+
"value": false
42+
},
3543
{
3644
"key": "is_job_path_fallback",
3745
"value": true

acceptance/bundle/telemetry/deploy-compute-type/output.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Deployment complete!
1313

1414
>>> cat out.requests.txt
1515
[
16+
{
17+
"key": "presets_name_prefix_is_set",
18+
"value": false
19+
},
1620
{
1721
"key": "python_wheel_wrapper_is_set",
1822
"value": false
@@ -31,6 +35,10 @@ Deployment complete!
3135
}
3236
]
3337
[
38+
{
39+
"key": "presets_name_prefix_is_set",
40+
"value": false
41+
},
3442
{
3543
"key": "python_wheel_wrapper_is_set",
3644
"value": false
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
bundle:
2+
name: "custom-prefix"
3+
4+
presets:
5+
name_prefix: one
6+
7+
resources:
8+
schemas:
9+
foo:
10+
catalog_name: "foo"
11+
name: "bar"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
>>> [CLI] bundle deploy
3+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/custom-prefix/default/files...
4+
Deploying resources...
5+
Updating deployment state...
6+
Deployment complete!
7+
8+
>>> cat out.requests.txt
9+
{
10+
"bundle_uuid": "[UUID]",
11+
"deployment_id": "[UUID]",
12+
"resource_count": 1,
13+
"resource_job_count": 0,
14+
"resource_pipeline_count": 0,
15+
"resource_model_count": 0,
16+
"resource_experiment_count": 0,
17+
"resource_model_serving_endpoint_count": 0,
18+
"resource_registered_model_count": 0,
19+
"resource_quality_monitor_count": 0,
20+
"resource_schema_count": 1,
21+
"resource_volume_count": 0,
22+
"resource_cluster_count": 0,
23+
"resource_dashboard_count": 0,
24+
"resource_app_count": 0,
25+
"experimental": {
26+
"configuration_file_count": 1,
27+
"variable_count": 0,
28+
"complex_variable_count": 0,
29+
"lookup_variable_count": 0,
30+
"target_count": 1,
31+
"bool_values": [
32+
{
33+
"key": "presets_name_prefix_is_set",
34+
"value": true
35+
},
36+
{
37+
"key": "python_wheel_wrapper_is_set",
38+
"value": false
39+
},
40+
{
41+
"key": "has_serverless_compute",
42+
"value": false
43+
},
44+
{
45+
"key": "has_classic_job_compute",
46+
"value": false
47+
},
48+
{
49+
"key": "has_classic_interactive_compute",
50+
"value": false
51+
}
52+
],
53+
"bundle_mode": "TYPE_UNSPECIFIED",
54+
"workspace_artifact_path_type": "WORKSPACE_FILE_SYSTEM"
55+
}
56+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trace $CLI bundle deploy
2+
3+
trace cat out.requests.txt | jq 'select(has("path") and .path == "/telemetry-ext") | .body.protoLogs[] | fromjson | .entry.databricks_cli_log.bundle_deploy_event'
4+
5+
rm out.requests.txt
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
bundle:
2+
name: "development-prefix"
3+
4+
resources:
5+
schemas:
6+
foo:
7+
catalog_name: "foo"
8+
name: "bar"
9+
10+
targets:
11+
development:
12+
default: true
13+
mode: development
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
2+
>>> [CLI] bundle deploy
3+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/development-prefix/development/files...
4+
Deploying resources...
5+
Updating deployment state...
6+
Deployment complete!
7+
8+
>>> cat out.requests.txt
9+
{
10+
"bundle_uuid": "[UUID]",
11+
"deployment_id": "[UUID]",
12+
"resource_count": 1,
13+
"resource_job_count": 0,
14+
"resource_pipeline_count": 0,
15+
"resource_model_count": 0,
16+
"resource_experiment_count": 0,
17+
"resource_model_serving_endpoint_count": 0,
18+
"resource_registered_model_count": 0,
19+
"resource_quality_monitor_count": 0,
20+
"resource_schema_count": 1,
21+
"resource_volume_count": 0,
22+
"resource_cluster_count": 0,
23+
"resource_dashboard_count": 0,
24+
"resource_app_count": 0,
25+
"experimental": {
26+
"configuration_file_count": 1,
27+
"variable_count": 0,
28+
"complex_variable_count": 0,
29+
"lookup_variable_count": 0,
30+
"target_count": 1,
31+
"bool_values": [
32+
{
33+
"key": "presets_name_prefix_is_set",
34+
"value": true
35+
},
36+
{
37+
"key": "python_wheel_wrapper_is_set",
38+
"value": false
39+
},
40+
{
41+
"key": "has_serverless_compute",
42+
"value": false
43+
},
44+
{
45+
"key": "has_classic_job_compute",
46+
"value": false
47+
},
48+
{
49+
"key": "has_classic_interactive_compute",
50+
"value": false
51+
}
52+
],
53+
"bundle_mode": "DEVELOPMENT",
54+
"workspace_artifact_path_type": "WORKSPACE_FILE_SYSTEM"
55+
}
56+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
trace $CLI bundle deploy
2+
3+
trace cat out.requests.txt | jq 'select(has("path") and .path == "/telemetry-ext") | .body.protoLogs[] | fromjson | .entry.databricks_cli_log.bundle_deploy_event'
4+
5+
rm out.requests.txt

acceptance/bundle/telemetry/deploy-no-uuid/out.telemetry.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
"lookup_variable_count": 0,
3737
"target_count": 1,
3838
"bool_values": [
39+
{
40+
"key": "presets_name_prefix_is_set",
41+
"value": false
42+
},
3943
{
4044
"key": "python_wheel_wrapper_is_set",
4145
"value": false

acceptance/bundle/telemetry/deploy/out.telemetry.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
"lookup_variable_count": 0,
4343
"target_count": 1,
4444
"bool_values": [
45+
{
46+
"key": "presets_name_prefix_is_set",
47+
"value": false
48+
},
4549
{
4650
"key": "python_wheel_wrapper_is_set",
4751
"value": false

bundle/config/mutator/resourcemutator/apply_presets.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
"github.com/databricks/cli/bundle"
1111
"github.com/databricks/cli/bundle/config"
12+
"github.com/databricks/cli/bundle/metrics"
1213
"github.com/databricks/cli/libs/diag"
1314
"github.com/databricks/cli/libs/dyn"
1415
"github.com/databricks/cli/libs/textutil"
@@ -44,6 +45,9 @@ func (m *applyPresets) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagnos
4445
r := b.Config.Resources
4546
t := b.Config.Presets
4647
prefix := t.NamePrefix
48+
49+
b.Metrics.AddBoolValue(metrics.PresetsNamePrefixIsSet, prefix != "")
50+
4751
tags := toTagArray(t.Tags)
4852

4953
// Jobs presets: Prefix, Tags, JobsMaxConcurrentRuns, TriggerPauseStatus

bundle/metrics/metrics.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ const (
55
ArtifactDynamicVersionIsSet = "artifact_dynamic_version_is_set"
66
ArtifactBuildCommandIsSet = "artifact_build_command_is_set"
77
ArtifactFilesIsSet = "artifact_files_is_set"
8+
PresetsNamePrefixIsSet = "presets_name_prefix_is_set"
89
)

0 commit comments

Comments
 (0)