pass test

This commit is contained in:
Shreyas Goenka 2025-02-03 11:42:17 +01:00
parent da0cf951b9
commit 88015876ad
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
3 changed files with 8 additions and 3 deletions

View File

@ -1 +1 @@
{"method":"POST","path":"/telemetry-ext","body":{"uploadTime":1738560432192,"items":[],"protoLogs":["{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE1\"}}}}","{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE2\"}}}}"]}} {"method":"POST","path":"/telemetry-ext","body":{"uploadTime":"UNIX_TIME_MILLIS","items":[],"protoLogs":["{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE1\"}}}}","{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"cli_test_event\":{\"name\":\"VALUE2\"}}}}"]}}

View File

@ -7,3 +7,8 @@ Response.Body = '''
"numProtoSuccess": 2 "numProtoSuccess": 2
} }
''' '''
[[Repls]]
Old = '17\d{11}'
New = '"UNIX_TIME_MILLIS"'

View File

@ -2,7 +2,7 @@ package telemetry
import ( import (
"context" "context"
"fmt" "errors"
) )
// Private type to store the telemetry logger in the context // Private type to store the telemetry logger in the context
@ -18,7 +18,7 @@ func WithNewLogger(ctx context.Context) context.Context {
func fromContext(ctx context.Context) *logger { func fromContext(ctx context.Context) *logger {
v := ctx.Value(telemetryLoggerKey) v := ctx.Value(telemetryLoggerKey)
if v == nil { if v == nil {
panic(fmt.Errorf("telemetry logger not found in the context")) panic(errors.New("telemetry logger not found in the context"))
} }
return v.(*logger) return v.(*logger)