You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Populate sql_operation, statement_id, and auth_type in telemetry
Fixes:
- sql_operation now properly populated by fetching metadata before statement close
- statement_id always populated from operation handle GUID
- auth_type now included in driver_connection_params
Changes:
- DBSQLOperation: Fetch metadata before emitting statement.complete to ensure
resultFormat is available for sql_operation field
- DBSQLClient: Track authType from connection options and include in
driver configuration
- DatabricksTelemetryExporter: Export auth_type in driver_connection_params
- types.ts: Add authType to DriverConfiguration interface
- Design doc: Document auth_type, resultFormat population, and connection params
Implementation details:
- emitStatementComplete() is now async to await metadata fetch
- Auth type defaults to 'access-token' if not specified
- Result format fetched even if not explicitly requested by user
- Handles metadata fetch failures gracefully (continues without resultFormat)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: samikshya-chand_data <samikshya.chand@databricks.com>
-**localeName**: Extracted from `LANG` environment variable in format `language_country` (e.g., `en_US`), defaults to `en_US`
1256
1257
-**charSetEncoding**: Always `'UTF-8'` (Node.js default encoding), equivalent to JDBC's Charset.defaultCharset()
1257
1258
-**processName**: Obtained from `process.title` or extracted from `process.argv[1]` (script name), equivalent to JDBC's ProcessNameUtil.getProcessName()
1259
+
-**authType**: Authentication method used ('access-token', 'databricks-oauth', or 'custom'), exported as `driver_connection_params.auth_type`
1260
+
1261
+
**Connection Parameters**:
1262
+
-**auth_type**: Exported in `driver_connection_params` field for connection metrics, indicates authentication method used
**Result Format Population**: To ensure `sql_operation` is properly populated in telemetry logs, the driver fetches result set metadata before emitting the `statement.complete` event. This guarantees that `resultFormat` is available even if the user closes the statement immediately after execution without explicitly fetching results.
0 commit comments