@@ -71,9 +71,12 @@ interface DatabricksTelemetryLog {
7171
7272/**
7373 * Payload format for Databricks telemetry export.
74+ * Matches JDBC TelemetryRequest format with protoLogs.
7475 */
7576interface DatabricksTelemetryPayload {
76- frontend_logs : DatabricksTelemetryLog [ ] ;
77+ uploadTime : number ;
78+ items : string [ ] ; // Always empty - required field
79+ protoLogs : string [ ] ; // JSON-stringified TelemetryFrontendLog objects
7780}
7881
7982/**
@@ -208,9 +211,14 @@ export default class DatabricksTelemetryExporter {
208211 ? buildUrl ( this . host , '/telemetry-ext' )
209212 : buildUrl ( this . host , '/telemetry-unauth' ) ;
210213
211- // Format payload
214+ // Format payload - each log is JSON-stringified to match JDBC format
215+ const telemetryLogs = metrics . map ( ( m ) => this . toTelemetryLog ( m ) ) ;
216+ const protoLogs = telemetryLogs . map ( ( log ) => JSON . stringify ( log ) ) ;
217+
212218 const payload : DatabricksTelemetryPayload = {
213- frontend_logs : metrics . map ( ( m ) => this . toTelemetryLog ( m ) ) ,
219+ uploadTime : Date . now ( ) ,
220+ items : [ ] , // Required but unused
221+ protoLogs,
214222 } ;
215223
216224 logger . log (
@@ -246,7 +254,6 @@ export default class DatabricksTelemetryExporter {
246254 */
247255 private toTelemetryLog ( metric : TelemetryMetric ) : DatabricksTelemetryLog {
248256 const log : DatabricksTelemetryLog = {
249- // workspace_id: metric.workspaceId, // TODO: Determine if this should be numeric or omitted
250257 frontend_log_event_id : this . generateUUID ( ) ,
251258 context : {
252259 client_context : {
0 commit comments