From ff15ced0670f30f261b80b578230f31b571a40fb Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Tue, 24 Dec 2024 13:32:27 +0530 Subject: [PATCH] use pointers for payload --- integration/libs/telemetry/telemetry_test.go | 4 ++-- libs/telemetry/frontend_log.go | 4 ++-- libs/telemetry/logger_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/integration/libs/telemetry/telemetry_test.go b/integration/libs/telemetry/telemetry_test.go index 9632d46b6..ba63aba9c 100644 --- a/integration/libs/telemetry/telemetry_test.go +++ b/integration/libs/telemetry/telemetry_test.go @@ -43,7 +43,7 @@ func TestTelemetryLogger(t *testing.T) { // Log some events. err := telemetry.Log(ctx, telemetry.FrontendLogEntry{ DatabricksCliLog: telemetry.DatabricksCliLog{ - CliTestEvent: events.CliTestEvent{ + CliTestEvent: &events.CliTestEvent{ Name: events.DummyCliEnumValue1, }, }, @@ -51,7 +51,7 @@ func TestTelemetryLogger(t *testing.T) { require.NoError(t, err) err = telemetry.Log(ctx, telemetry.FrontendLogEntry{ DatabricksCliLog: telemetry.DatabricksCliLog{ - CliTestEvent: events.CliTestEvent{ + CliTestEvent: &events.CliTestEvent{ Name: events.DummyCliEnumValue2, }, }, diff --git a/libs/telemetry/frontend_log.go b/libs/telemetry/frontend_log.go index 05960446a..d9dc02972 100644 --- a/libs/telemetry/frontend_log.go +++ b/libs/telemetry/frontend_log.go @@ -17,6 +17,6 @@ type FrontendLogEntry struct { } type DatabricksCliLog struct { - CliTestEvent events.CliTestEvent `json:"cli_test_event,omitempty"` - BundleInitEvent events.BundleInitEvent `json:"bundle_init_event,omitempty"` + CliTestEvent *events.CliTestEvent `json:"cli_test_event,omitempty"` + BundleInitEvent *events.BundleInitEvent `json:"bundle_init_event,omitempty"` } diff --git a/libs/telemetry/logger_test.go b/libs/telemetry/logger_test.go index e0fa4332d..794b79600 100644 --- a/libs/telemetry/logger_test.go +++ b/libs/telemetry/logger_test.go @@ -69,7 +69,7 @@ func TestTelemetryLoggerFlushesEvents(t *testing.T) { for _, v := range []events.DummyCliEnum{events.DummyCliEnumValue1, events.DummyCliEnumValue2, events.DummyCliEnumValue2, events.DummyCliEnumValue3} { err := Log(ctx, FrontendLogEntry{DatabricksCliLog: DatabricksCliLog{ - CliTestEvent: events.CliTestEvent{Name: v}, + CliTestEvent: &events.CliTestEvent{Name: v}, }}) require.NoError(t, err) } @@ -103,7 +103,7 @@ func TestTelemetryLoggerFlushExitsOnTimeout(t *testing.T) { for _, v := range []events.DummyCliEnum{events.DummyCliEnumValue1, events.DummyCliEnumValue2, events.DummyCliEnumValue2, events.DummyCliEnumValue3} { err := Log(ctx, FrontendLogEntry{DatabricksCliLog: DatabricksCliLog{ - CliTestEvent: events.CliTestEvent{Name: v}, + CliTestEvent: &events.CliTestEvent{Name: v}, }}) require.NoError(t, err) }