Repository navigation
Added metrics for immutable folder usage #7168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andrewnester
wants to merge
2
commits into
main
Choose a base branch
from
feat/immutable/add-metric
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * Add deploy telemetry for immutable snapshots: whether a deploy used a snapshot and how long its upload took. ([#7168](https://github.com/databricks/cli/pull/7168)) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
acceptance/bundle/resource_deps/tf_path_only_error/out.telemetry.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
acceptance/bundle/telemetry/deploy-immutable-snapshot/databricks.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| bundle: | ||
| name: test-bundle | ||
|
|
||
| experimental: | ||
| immutable_folder: true | ||
|
|
||
| resources: | ||
| jobs: | ||
| foo: | ||
| name: foo | ||
| tasks: | ||
| - task_key: task1 | ||
| spark_python_task: | ||
| python_file: ./src/main.py | ||
| environment_key: env | ||
|
|
||
| environments: | ||
| - environment_key: env | ||
| spec: | ||
| environment_version: "4" |
2 changes: 2 additions & 0 deletions
2
acceptance/bundle/telemetry/deploy-immutable-snapshot/out.test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Cloud = false | ||
| EnvMatrix.DMS = [""] |
26 changes: 26 additions & 0 deletions
26
acceptance/bundle/telemetry/deploy-immutable-snapshot/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
|
|
||
| === First deploy uploads the snapshot | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Created internal_immutable_snapshots.immutable | ||
| Created jobs.foo | ||
| Files: 0 uploaded, 0 deleted | ||
| Resources: 2 created, 0 changed, 0 deleted, 0 unchanged | ||
|
|
||
| >>> print_telemetry_bool_values | ||
| immutable_snapshot_used true | ||
|
|
||
| >>> print_snapshot_upload_entries | ||
| 1 | ||
|
|
||
| === Second deploy finds the snapshot already uploaded | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Files: 0 uploaded, 0 deleted | ||
| Resources: 0 created, 0 changed, 0 deleted, 2 unchanged | ||
|
|
||
| >>> print_telemetry_bool_values | ||
| immutable_snapshot_used true | ||
|
|
||
| >>> print_snapshot_upload_entries | ||
| 0 |
17 changes: 17 additions & 0 deletions
17
acceptance/bundle/telemetry/deploy-immutable-snapshot/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # The snapshot upload duration is reported next to the files.(upload) mutator time. Its value | ||
| # varies, so only assert how many times it is reported. | ||
| print_snapshot_upload_entries() { | ||
| jq -r 'select(.path? == "/telemetry-ext") | (.body.protoLogs // [])[] | fromjson | (.entry // .) | .databricks_cli_log.bundle_deploy_event.experimental.bundle_mutator_execution_time_ms // [] | map(select(.key == "snapshot.upload" and .value >= 0)) | length' "$OUT_REQUESTS" | ||
| } | ||
|
|
||
| title "First deploy uploads the snapshot\n" | ||
| trace $CLI bundle deploy | ||
| trace print_telemetry_bool_values | grep immutable_snapshot_used | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's also print that snapshot upload duration is included? |
||
| trace print_snapshot_upload_entries | ||
| rm "$OUT_REQUESTS" | ||
|
|
||
| title "Second deploy finds the snapshot already uploaded\n" | ||
| trace $CLI bundle deploy | ||
| trace print_telemetry_bool_values | grep immutable_snapshot_used | ||
| trace print_snapshot_upload_entries | ||
| rm "$OUT_REQUESTS" | ||
1 change: 1 addition & 0 deletions
1
acceptance/bundle/telemetry/deploy-immutable-snapshot/src/main.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| print("hello") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,19 @@ const ( | |||||
| SqlWarehouseLifecycleStarted = "sql_warehouse_lifecycle_started" | ||||||
| SelectUsed = "select_used" | ||||||
|
|
||||||
| // Whether the deploy registered an immutable snapshot. Derived from the snapshot | ||||||
| // resource, not from experimental.immutable_folder: the flag may change, and the | ||||||
| // resource is what the deploy actually uploads. | ||||||
| ImmutableSnapshotUsed = "immutable_snapshot_used" | ||||||
|
|
||||||
| // Key under which the snapshot upload duration is reported in | ||||||
| // bundle_mutator_execution_time_ms, next to files.(upload) so the two can be | ||||||
| // compared. Covers creating the snapshot resource (the upload plus recording it in | ||||||
| // state), not building the zip, which is snapshot.(snapshotUpload). Absent when no | ||||||
| // snapshot was uploaded. It lacks the parentheses of a mutator name because it is | ||||||
| // not a mutator. | ||||||
| SnapshotUploadTime = "snapshot.upload" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| // Outcome of an automatic migration of terraform state to the direct engine. | ||||||
| // - migrate_error: state conversion itself errored. | ||||||
| // - migrate_commit_error: the state was converted, but committing it | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we need to add a changelog for telemetry