mirror of https://github.com/databricks/cli.git
some cleanup
This commit is contained in:
parent
d80a5ec673
commit
9774046825
|
@ -10,8 +10,8 @@
|
||||||
"uploadTime": "UNIX_TIME_MILLIS",
|
"uploadTime": "UNIX_TIME_MILLIS",
|
||||||
"items": [],
|
"items": [],
|
||||||
"protoLogs": [
|
"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]\",\"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]\"},\"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]\",\"execution_time_ms\":1},\"cli_test_event\":{\"name\":\"VALUE2\"}}}}"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@ HH:MM:SS Debug: POST /telemetry-ext
|
||||||
> {
|
> {
|
||||||
> "items": null,
|
> "items": null,
|
||||||
> "protoLogs": [
|
> "protoLogs": [
|
||||||
> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (210 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\":{\"... (232 more bytes)"
|
||||||
> ],
|
> ],
|
||||||
> "uploadTime": "UNIX_TIME_MILLIS"
|
> "uploadTime": "UNIX_TIME_MILLIS"
|
||||||
> }
|
> }
|
||||||
|
|
|
@ -7,12 +7,3 @@ Response.Body = '''
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
DelaySeconds = 5
|
DelaySeconds = 5
|
||||||
|
|
||||||
|
|
||||||
[[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"
|
|
||||||
|
|
|
@ -78,8 +78,8 @@ func Upload(ctx context.Context, cfg *config.Config) error {
|
||||||
return fmt.Errorf("failed to create API client: %w", err)
|
return fmt.Errorf("failed to create API client: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, _ = context.WithTimeout(ctx, 3*time.Second)
|
ctx, cancel := context.WithTimeout(ctx, 3*time.Second)
|
||||||
var resp *ResponseBody
|
defer cancel()
|
||||||
|
|
||||||
// Only try uploading logs for a maximum of 3 times.
|
// Only try uploading logs for a maximum of 3 times.
|
||||||
for i := range 3 {
|
for i := range 3 {
|
||||||
|
@ -90,7 +90,7 @@ func Upload(ctx context.Context, cfg *config.Config) error {
|
||||||
// proceed
|
// proceed
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err = attempt(ctx, apiClient, protoLogs)
|
resp, err := attempt(ctx, apiClient, protoLogs)
|
||||||
|
|
||||||
// All logs were uploaded successfully.
|
// All logs were uploaded successfully.
|
||||||
if err == nil && resp.NumProtoSuccess >= int64(len(protoLogs)) {
|
if err == nil && resp.NumProtoSuccess >= int64(len(protoLogs)) {
|
||||||
|
|
Loading…
Reference in New Issue