Skip to content

Commit a854d8d

Browse files
committed
telemetry: populate mode and use_proxy in driver_connection_params
The four Node-specific fields dropped in the previous commit have no proto equivalent (CloudFetch enablement, LZ4, retry config, concurrent downloads aren't tracked at the receiver). But two unrelated proto fields can be filled from existing Node config: - `mode = "THRIFT"` — Node.js always uses Thrift transport (no SEA client). JDBC's `DatabricksClientType` enum is `SEA | THRIFT`. - `use_proxy` — derived from `ConnectionOptions.proxy`. Stored on DBSQLClient at `connect()` time alongside the existing host / httpPath / authType fields, then surfaced through a new `DriverConfiguration.useProxy` field. Co-authored-by: Isaac
1 parent 05001b7 commit a854d8d

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

lib/DBSQLClient.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I
122122

123123
private authType?: string;
124124

125+
private useProxy?: boolean;
126+
125127
private telemetryClient?: TelemetryClient;
126128

127129
private telemetryEmitter?: TelemetryEventEmitter;
@@ -425,6 +427,7 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I
425427
// Connection parameters
426428
httpPath: this.httpPath,
427429
enableMetricViewMetadata: this.config.enableMetricViewMetadata,
430+
useProxy: this.useProxy,
428431
};
429432
}
430433

@@ -604,6 +607,7 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I
604607
this.host = options.host;
605608
this.httpPath = options.path;
606609
this.authType = this.mapAuthType(options);
610+
this.useProxy = Boolean(options.proxy);
607611

608612
// Store enableMetricViewMetadata configuration
609613
if (options.enableMetricViewMetadata !== undefined) {

lib/telemetry/DatabricksTelemetryExporter.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ interface DatabricksTelemetryLog {
6464
driver_connection_params?: {
6565
host_info?: { host_url?: string };
6666
http_path?: string;
67+
mode?: string;
68+
use_proxy?: boolean;
6769
enable_arrow?: boolean;
6870
enable_direct_results?: boolean;
6971
socket_timeout?: number;
@@ -411,6 +413,8 @@ export default class DatabricksTelemetryExporter {
411413
log.entry.sql_driver_log.driver_connection_params = {
412414
host_info: { host_url: this.host },
413415
http_path: metric.driverConfig.httpPath,
416+
mode: 'THRIFT',
417+
use_proxy: metric.driverConfig.useProxy,
414418
enable_arrow: metric.driverConfig.arrowEnabled,
415419
enable_direct_results: metric.driverConfig.directResultsEnabled,
416420
socket_timeout: metric.driverConfig.socketTimeout,

lib/telemetry/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ export interface DriverConfiguration {
304304

305305
/** Whether metric view metadata is enabled */
306306
enableMetricViewMetadata?: boolean;
307+
308+
/** Whether an HTTP/SOCKS proxy is configured on the connection */
309+
useProxy?: boolean;
307310
}
308311

309312
/**

0 commit comments

Comments
 (0)