diff --git a/acceptance/bundle/debug/out.stderr.txt b/acceptance/bundle/debug/out.stderr.txt index b9ac5c4d9..631f51990 100644 --- a/acceptance/bundle/debug/out.stderr.txt +++ b/acceptance/bundle/debug/out.stderr.txt @@ -99,3 +99,4 @@ < } pid=12345 mutator=validate:files_to_sync sdk=true 10:07:59 Debug: Path /Workspace/Users/[USERNAME]/.bundle/debug/default/files has type directory (ID: 0) pid=12345 mutator=validate:files_to_sync 10:07:59 Info: completed execution pid=12345 exit_code=0 +10:07:59 Debug: no telemetry logs to upload pid=12345 diff --git a/acceptance/telemetry/failure-debug-logs/out.requests.txt b/acceptance/telemetry/failure-debug-logs/out.requests.txt deleted file mode 100644 index 69633b190..000000000 --- a/acceptance/telemetry/failure-debug-logs/out.requests.txt +++ /dev/null @@ -1,51 +0,0 @@ -{ - "headers": { - "Authorization": [ - "Bearer [DATABRICKS_TOKEN]" - ] - }, - "method": "POST", - "path": "/telemetry-ext", - "body": { - "uploadTime": "UNIX_TIME_MILLIS", - "items": [], - "protoLogs": [ - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}" - ] - } -} -{ - "headers": { - "Authorization": [ - "Bearer [DATABRICKS_TOKEN]" - ] - }, - "method": "POST", - "path": "/telemetry-ext", - "body": { - "uploadTime": "UNIX_TIME_MILLIS", - "items": [], - "protoLogs": [ - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}" - ] - } -} -{ - "headers": { - "Authorization": [ - "Bearer [DATABRICKS_TOKEN]" - ] - }, - "method": "POST", - "path": "/telemetry-ext", - "body": { - "uploadTime": "UNIX_TIME_MILLIS", - "items": [], - "protoLogs": [ - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}" - ] - } -} diff --git a/acceptance/telemetry/failure-debug-logs/output.txt b/acceptance/telemetry/failure-debug-logs/output.txt deleted file mode 100644 index 3221edf58..000000000 --- a/acceptance/telemetry/failure-debug-logs/output.txt +++ /dev/null @@ -1,56 +0,0 @@ - ->>> [CLI] selftest send-telemetry --debug -HH:MM:SS Info: start pid=PID version=[DEV_VERSION] args="[CLI], selftest, send-telemetry, --debug" -HH:MM:SS Info: completed execution pid=PID exit_code=0 -HH:MM:SS Debug: POST /telemetry-ext -> { -> "items": null, -> "protoLogs": [ -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" -> ], -> "uploadTime": "UNIX_TIME_MILLIS" -> } -< HTTP/1.1 501 Not Implemented -< { -< "error_code": "ERROR_CODE", -< "message": "Endpoint not implemented." -< } pid=PID sdk=true -HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true -HH:MM:SS Debug: Attempt 1 failed due to a server side error. Retrying status code: 501 - pid=PID -HH:MM:SS Debug: POST /telemetry-ext -> { -> "items": null, -> "protoLogs": [ -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" -> ], -> "uploadTime": "UNIX_TIME_MILLIS" -> } -< HTTP/1.1 501 Not Implemented -< { -< "error_code": "ERROR_CODE", -< "message": "Endpoint not implemented." -< } pid=PID sdk=true -HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true -HH:MM:SS Debug: Attempt 2 failed due to a server side error. Retrying status code: 501 - pid=PID -HH:MM:SS Debug: POST /telemetry-ext -> { -> "items": null, -> "protoLogs": [ -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" -> ], -> "uploadTime": "UNIX_TIME_MILLIS" -> } -< HTTP/1.1 501 Not Implemented -< { -< "error_code": "ERROR_CODE", -< "message": "Endpoint not implemented." -< } pid=PID sdk=true -HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true -HH:MM:SS Debug: Attempt 3 failed due to a server side error. Retrying status code: 501 - pid=PID -HH:MM:SS Debug: failed to upload telemetry: failed to upload telemetry logs after three attempts pid=PID diff --git a/acceptance/telemetry/failure-debug-logs/script b/acceptance/telemetry/failure-debug-logs/script deleted file mode 100644 index 7fe85f0cd..000000000 --- a/acceptance/telemetry/failure-debug-logs/script +++ /dev/null @@ -1 +0,0 @@ -trace $CLI selftest send-telemetry --debug diff --git a/acceptance/telemetry/failure-debug-logs/test.toml b/acceptance/telemetry/failure-debug-logs/test.toml deleted file mode 100644 index 7b441d48d..000000000 --- a/acceptance/telemetry/failure-debug-logs/test.toml +++ /dev/null @@ -1,17 +0,0 @@ -[[Server]] -Pattern = "POST /telemetry-ext" -Response.Body = ''' -{ - "error_code": "ERROR_CODE", - "message": "Endpoint not implemented." -} -''' -Response.StatusCode = 501 - -[[Repls]] -Old = "(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]" -New = "HH:MM:SS" - -[[Repls]] -Old = "pid=[0-9]+" -New = "pid=PID" diff --git a/acceptance/telemetry/failure/output.txt b/acceptance/telemetry/failure/output.txt index 78d1c02c4..3221edf58 100644 --- a/acceptance/telemetry/failure/output.txt +++ b/acceptance/telemetry/failure/output.txt @@ -1,2 +1,56 @@ ->>> [CLI] selftest send-telemetry +>>> [CLI] selftest send-telemetry --debug +HH:MM:SS Info: start pid=PID version=[DEV_VERSION] args="[CLI], selftest, send-telemetry, --debug" +HH:MM:SS Info: completed execution pid=PID exit_code=0 +HH:MM:SS Debug: POST /telemetry-ext +> { +> "items": null, +> "protoLogs": [ +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" +> ], +> "uploadTime": "UNIX_TIME_MILLIS" +> } +< HTTP/1.1 501 Not Implemented +< { +< "error_code": "ERROR_CODE", +< "message": "Endpoint not implemented." +< } pid=PID sdk=true +HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true +HH:MM:SS Debug: Attempt 1 failed due to a server side error. Retrying status code: 501 + pid=PID +HH:MM:SS Debug: POST /telemetry-ext +> { +> "items": null, +> "protoLogs": [ +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" +> ], +> "uploadTime": "UNIX_TIME_MILLIS" +> } +< HTTP/1.1 501 Not Implemented +< { +< "error_code": "ERROR_CODE", +< "message": "Endpoint not implemented." +< } pid=PID sdk=true +HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true +HH:MM:SS Debug: Attempt 2 failed due to a server side error. Retrying status code: 501 + pid=PID +HH:MM:SS Debug: POST /telemetry-ext +> { +> "items": null, +> "protoLogs": [ +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" +> ], +> "uploadTime": "UNIX_TIME_MILLIS" +> } +< HTTP/1.1 501 Not Implemented +< { +< "error_code": "ERROR_CODE", +< "message": "Endpoint not implemented." +< } pid=PID sdk=true +HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true +HH:MM:SS Debug: Attempt 3 failed due to a server side error. Retrying status code: 501 + pid=PID +HH:MM:SS Debug: failed to upload telemetry: failed to upload telemetry logs after three attempts pid=PID diff --git a/acceptance/telemetry/failure/script b/acceptance/telemetry/failure/script index a5bda47cf..7fe85f0cd 100644 --- a/acceptance/telemetry/failure/script +++ b/acceptance/telemetry/failure/script @@ -1 +1 @@ -trace $CLI selftest send-telemetry +trace $CLI selftest send-telemetry --debug diff --git a/acceptance/telemetry/partial-success-debug-logs/out.requests.txt b/acceptance/telemetry/partial-success-debug-logs/out.requests.txt deleted file mode 100644 index 69633b190..000000000 --- a/acceptance/telemetry/partial-success-debug-logs/out.requests.txt +++ /dev/null @@ -1,51 +0,0 @@ -{ - "headers": { - "Authorization": [ - "Bearer [DATABRICKS_TOKEN]" - ] - }, - "method": "POST", - "path": "/telemetry-ext", - "body": { - "uploadTime": "UNIX_TIME_MILLIS", - "items": [], - "protoLogs": [ - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}" - ] - } -} -{ - "headers": { - "Authorization": [ - "Bearer [DATABRICKS_TOKEN]" - ] - }, - "method": "POST", - "path": "/telemetry-ext", - "body": { - "uploadTime": "UNIX_TIME_MILLIS", - "items": [], - "protoLogs": [ - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}" - ] - } -} -{ - "headers": { - "Authorization": [ - "Bearer [DATABRICKS_TOKEN]" - ] - }, - "method": "POST", - "path": "/telemetry-ext", - "body": { - "uploadTime": "UNIX_TIME_MILLIS", - "items": [], - "protoLogs": [ - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}" - ] - } -} diff --git a/acceptance/telemetry/partial-success-debug-logs/output.txt b/acceptance/telemetry/partial-success-debug-logs/output.txt deleted file mode 100644 index 2bd9bf300..000000000 --- a/acceptance/telemetry/partial-success-debug-logs/output.txt +++ /dev/null @@ -1,53 +0,0 @@ - ->>> [CLI] selftest send-telemetry --debug -HH:MM:SS Info: start pid=PID version=[DEV_VERSION] args="[CLI], selftest, send-telemetry, --debug" -HH:MM:SS Info: completed execution pid=PID exit_code=0 -HH:MM:SS Debug: POST /telemetry-ext -> { -> "items": null, -> "protoLogs": [ -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" -> ], -> "uploadTime": "UNIX_TIME_MILLIS" -> } -< HTTP/1.1 200 OK -< { -< "errors": null, -< "numProtoSuccess": 1 -< } pid=PID sdk=true -HH:MM:SS Debug: Attempt 1 was a partial success. Number of logs uploaded: 1 out of 2 - pid=PID -HH:MM:SS Debug: POST /telemetry-ext -> { -> "items": null, -> "protoLogs": [ -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" -> ], -> "uploadTime": "UNIX_TIME_MILLIS" -> } -< HTTP/1.1 200 OK -< { -< "errors": null, -< "numProtoSuccess": 1 -< } pid=PID sdk=true -HH:MM:SS Debug: Attempt 2 was a partial success. Number of logs uploaded: 1 out of 2 - pid=PID -HH:MM:SS Debug: POST /telemetry-ext -> { -> "items": null, -> "protoLogs": [ -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" -> ], -> "uploadTime": "UNIX_TIME_MILLIS" -> } -< HTTP/1.1 200 OK -< { -< "errors": null, -< "numProtoSuccess": 1 -< } pid=PID sdk=true -HH:MM:SS Debug: Attempt 3 was a partial success. Number of logs uploaded: 1 out of 2 - pid=PID -HH:MM:SS Debug: failed to upload telemetry: failed to upload telemetry logs after three attempts pid=PID diff --git a/acceptance/telemetry/partial-success-debug-logs/script b/acceptance/telemetry/partial-success-debug-logs/script deleted file mode 100644 index 7fe85f0cd..000000000 --- a/acceptance/telemetry/partial-success-debug-logs/script +++ /dev/null @@ -1 +0,0 @@ -trace $CLI selftest send-telemetry --debug diff --git a/acceptance/telemetry/partial-success-debug-logs/test.toml b/acceptance/telemetry/partial-success-debug-logs/test.toml deleted file mode 100644 index c37b01569..000000000 --- a/acceptance/telemetry/partial-success-debug-logs/test.toml +++ /dev/null @@ -1,17 +0,0 @@ -[[Server]] -Pattern = "POST /telemetry-ext" -Response.Body = ''' -{ - "errors": [], - "numProtoSuccess": 1 -} -''' - - -[[Repls]] -Old = "(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]" -New = "HH:MM:SS" - -[[Repls]] -Old = "pid=[0-9]+" -New = "pid=PID" diff --git a/acceptance/telemetry/partial-success/output.txt b/acceptance/telemetry/partial-success/output.txt index 78d1c02c4..2bd9bf300 100644 --- a/acceptance/telemetry/partial-success/output.txt +++ b/acceptance/telemetry/partial-success/output.txt @@ -1,2 +1,53 @@ ->>> [CLI] selftest send-telemetry +>>> [CLI] selftest send-telemetry --debug +HH:MM:SS Info: start pid=PID version=[DEV_VERSION] args="[CLI], selftest, send-telemetry, --debug" +HH:MM:SS Info: completed execution pid=PID exit_code=0 +HH:MM:SS Debug: POST /telemetry-ext +> { +> "items": null, +> "protoLogs": [ +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" +> ], +> "uploadTime": "UNIX_TIME_MILLIS" +> } +< HTTP/1.1 200 OK +< { +< "errors": null, +< "numProtoSuccess": 1 +< } pid=PID sdk=true +HH:MM:SS Debug: Attempt 1 was a partial success. Number of logs uploaded: 1 out of 2 + pid=PID +HH:MM:SS Debug: POST /telemetry-ext +> { +> "items": null, +> "protoLogs": [ +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" +> ], +> "uploadTime": "UNIX_TIME_MILLIS" +> } +< HTTP/1.1 200 OK +< { +< "errors": null, +< "numProtoSuccess": 1 +< } pid=PID sdk=true +HH:MM:SS Debug: Attempt 2 was a partial success. Number of logs uploaded: 1 out of 2 + pid=PID +HH:MM:SS Debug: POST /telemetry-ext +> { +> "items": null, +> "protoLogs": [ +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" +> ], +> "uploadTime": "UNIX_TIME_MILLIS" +> } +< HTTP/1.1 200 OK +< { +< "errors": null, +< "numProtoSuccess": 1 +< } pid=PID sdk=true +HH:MM:SS Debug: Attempt 3 was a partial success. Number of logs uploaded: 1 out of 2 + pid=PID +HH:MM:SS Debug: failed to upload telemetry: failed to upload telemetry logs after three attempts pid=PID diff --git a/acceptance/telemetry/partial-success/script b/acceptance/telemetry/partial-success/script index a5bda47cf..7fe85f0cd 100644 --- a/acceptance/telemetry/partial-success/script +++ b/acceptance/telemetry/partial-success/script @@ -1 +1 @@ -trace $CLI selftest send-telemetry +trace $CLI selftest send-telemetry --debug diff --git a/acceptance/telemetry/skipped/output.txt b/acceptance/telemetry/skipped/output.txt index 78d1c02c4..640e03d54 100644 --- a/acceptance/telemetry/skipped/output.txt +++ b/acceptance/telemetry/skipped/output.txt @@ -1,2 +1,5 @@ ->>> [CLI] selftest send-telemetry +>>> [CLI] selftest send-telemetry --debug +HH:MM:SS Info: start pid=PID version=[DEV_VERSION] args="[CLI], selftest, send-telemetry, --debug" +HH:MM:SS Info: completed execution pid=PID exit_code=0 +HH:MM:SS Debug: telemetry upload is disabled. Not uploading any logs. pid=PID diff --git a/acceptance/telemetry/skipped/script b/acceptance/telemetry/skipped/script index 31f5dfb43..247171a6f 100644 --- a/acceptance/telemetry/skipped/script +++ b/acceptance/telemetry/skipped/script @@ -1,3 +1,3 @@ export DATABRICKS_CLI_DISABLE_TELEMETRY="true" -trace $CLI selftest send-telemetry +trace $CLI selftest send-telemetry --debug diff --git a/acceptance/telemetry/success/output.txt b/acceptance/telemetry/success/output.txt index 78d1c02c4..cd69e63d1 100644 --- a/acceptance/telemetry/success/output.txt +++ b/acceptance/telemetry/success/output.txt @@ -1,2 +1,19 @@ ->>> [CLI] selftest send-telemetry +>>> [CLI] selftest send-telemetry --debug +HH:MM:SS Info: start pid=PID version=[DEV_VERSION] args="[CLI], selftest, send-telemetry, --debug" +HH:MM:SS Info: completed execution pid=PID exit_code=0 +HH:MM:SS Debug: POST /telemetry-ext +> { +> "items": null, +> "protoLogs": [ +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" +> ], +> "uploadTime": "UNIX_TIME_MILLIS" +> } +< HTTP/1.1 200 OK +< { +< "errors": null, +< "numProtoSuccess": 2 +< } pid=PID sdk=true +HH:MM:SS Debug: All 2 logs uploaded successfully pid=PID diff --git a/acceptance/telemetry/success/script b/acceptance/telemetry/success/script index a5bda47cf..7fe85f0cd 100644 --- a/acceptance/telemetry/success/script +++ b/acceptance/telemetry/success/script @@ -1 +1 @@ -trace $CLI selftest send-telemetry +trace $CLI selftest send-telemetry --debug diff --git a/acceptance/telemetry/test.toml b/acceptance/telemetry/test.toml index a7f8adeb3..74e48d603 100644 --- a/acceptance/telemetry/test.toml +++ b/acceptance/telemetry/test.toml @@ -24,3 +24,11 @@ Response.Body = ''' "numProtoSuccess": 2 } ''' + +[[Repls]] +Old = "(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]" +New = "HH:MM:SS" + +[[Repls]] +Old = "pid=[0-9]+" +New = "pid=PID" diff --git a/acceptance/telemetry/timeout/out.requests.txt b/acceptance/telemetry/timeout/out.requests.txt index 57574b976..6fb834be7 100644 --- a/acceptance/telemetry/timeout/out.requests.txt +++ b/acceptance/telemetry/timeout/out.requests.txt @@ -10,8 +10,8 @@ "uploadTime": "UNIX_TIME_MILLIS", "items": [], "protoLogs": [ - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":1},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", - "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\",\"execution_time_ms\":1},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}" + "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE1\"}}}}", + "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"execution_context\":{\"cmd_exec_id\":\"[UUID]\",\"version\":\"[DEV_VERSION]\",\"command\":\"selftest_send-telemetry\",\"operating_system\":\"[OS]\"},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}" ] } } diff --git a/acceptance/telemetry/timeout/output.txt b/acceptance/telemetry/timeout/output.txt index 8dad2627a..be3e332a0 100644 --- a/acceptance/telemetry/timeout/output.txt +++ b/acceptance/telemetry/timeout/output.txt @@ -6,8 +6,8 @@ HH:MM:SS Debug: POST /telemetry-ext > { > "items": null, > "protoLogs": [ -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (232 more bytes)", -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (232 more bytes)" +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)", +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 more bytes)" > ], > "uploadTime": "UNIX_TIME_MILLIS" > } diff --git a/cmd/root/root.go b/cmd/root/root.go index 7b858b12d..6e4448ad1 100644 --- a/cmd/root/root.go +++ b/cmd/root/root.go @@ -173,11 +173,13 @@ Stack Trace: func uploadTelemetry(ctx context.Context, cmdStr string, startTime time.Time, exitCode int) { // Return early if there are no logs to upload. if !telemetry.HasLogs(ctx) { + log.Debugf(ctx, "no telemetry logs to upload") return } // Telemetry is disabled. We don't upload logs. if os.Getenv(telemetry.DisableEnvVar) != "" { + log.Debugf(ctx, "telemetry upload is disabled. Not uploading any logs.") return } diff --git a/libs/telemetry/logger.go b/libs/telemetry/logger.go index 96527e201..a060f47cc 100644 --- a/libs/telemetry/logger.go +++ b/libs/telemetry/logger.go @@ -94,6 +94,7 @@ func Upload(ctx context.Context, cfg *config.Config) error { // All logs were uploaded successfully. if err == nil && resp.NumProtoSuccess >= int64(len(protoLogs)) { + log.Debugf(ctx, "All %d logs uploaded successfully", len(protoLogs)) return nil }