@databricks/sql 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/DBSQLClient.d.ts +99 -0
- package/dist/DBSQLClient.js +445 -0
- package/dist/DBSQLClient.js.map +1 -1
- package/dist/DBSQLOperation.d.ts +32 -1
- package/dist/DBSQLOperation.js +138 -29
- package/dist/DBSQLOperation.js.map +1 -1
- package/dist/DBSQLSession.d.ts +1 -0
- package/dist/DBSQLSession.js +39 -12
- package/dist/DBSQLSession.js.map +1 -1
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js +10 -6
- package/dist/connection/auth/DatabricksOAuth/OAuthManager.js.map +1 -1
- package/dist/contracts/IClientContext.d.ts +29 -0
- package/dist/contracts/IDBSQLClient.d.ts +84 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/result/CloudFetchResultHandler.d.ts +8 -1
- package/dist/result/CloudFetchResultHandler.js +28 -2
- package/dist/result/CloudFetchResultHandler.js.map +1 -1
- package/dist/result/RowSetProvider.d.ts +8 -1
- package/dist/result/RowSetProvider.js +110 -1
- package/dist/result/RowSetProvider.js.map +1 -1
- package/dist/telemetry/DatabricksTelemetryExporter.js +67 -33
- package/dist/telemetry/DatabricksTelemetryExporter.js.map +1 -1
- package/dist/telemetry/FeatureFlagCache.js +10 -4
- package/dist/telemetry/FeatureFlagCache.js.map +1 -1
- package/dist/telemetry/MetricsAggregator.d.ts +38 -0
- package/dist/telemetry/MetricsAggregator.js +249 -14
- package/dist/telemetry/MetricsAggregator.js.map +1 -1
- package/dist/telemetry/TelemetryClient.d.ts +94 -14
- package/dist/telemetry/TelemetryClient.js +252 -20
- package/dist/telemetry/TelemetryClient.js.map +1 -1
- package/dist/telemetry/TelemetryClientProvider.d.ts +28 -33
- package/dist/telemetry/TelemetryClientProvider.js +58 -52
- package/dist/telemetry/TelemetryClientProvider.js.map +1 -1
- package/dist/telemetry/TelemetryEventEmitter.d.ts +52 -26
- package/dist/telemetry/TelemetryEventEmitter.js +88 -109
- package/dist/telemetry/TelemetryEventEmitter.js.map +1 -1
- package/dist/telemetry/{urlUtils.d.ts → telemetryTypeMappers.d.ts} +8 -5
- package/dist/telemetry/telemetryTypeMappers.js +72 -0
- package/dist/telemetry/telemetryTypeMappers.js.map +1 -0
- package/dist/telemetry/telemetryUtils.d.ts +14 -0
- package/dist/telemetry/telemetryUtils.js +52 -1
- package/dist/telemetry/telemetryUtils.js.map +1 -1
- package/dist/telemetry/types.d.ts +33 -1
- package/dist/telemetry/types.js +5 -2
- package/dist/telemetry/types.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/dist/telemetry/urlUtils.js +0 -35
- package/dist/telemetry/urlUtils.js.map +0 -1
|
@@ -21,36 +21,49 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
const IDBSQLLogger_1 = require("../contracts/IDBSQLLogger");
|
|
22
22
|
const TelemetryClient_1 = __importDefault(require("./TelemetryClient"));
|
|
23
23
|
// Soft cap on distinct host entries. Above this the provider warns once so a
|
|
24
|
-
// misconfigured caller (per-request hosts, unnormalized aliases) is visible
|
|
25
|
-
// logs rather than silently growing the map.
|
|
24
|
+
// misconfigured caller (per-request hosts, unnormalized aliases) is visible
|
|
25
|
+
// in logs rather than silently growing the map.
|
|
26
26
|
const MAX_CLIENTS_SOFT_LIMIT = 128;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* Process-wide registry of `TelemetryClient`s, one per host. Multiple
|
|
29
|
+
* `DBSQLClient` instances connecting to the same host share the same
|
|
30
|
+
* `TelemetryClient`, which owns the host-scoped circuit breaker, feature
|
|
31
|
+
* flag cache, exporter, and aggregator.
|
|
31
32
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
33
|
+
* Singleton because the resources we're sharing — circuit-breaker counters,
|
|
34
|
+
* batched HTTP exports — are correct only at process scope. Per-`DBSQLClient`
|
|
35
|
+
* provider scope (the previous design) deduplicates nothing.
|
|
36
|
+
*
|
|
37
|
+
* `getOrCreateClient` is sync: caller increments refcount, registers its
|
|
38
|
+
* context+auth, and walks away. `releaseClient` is `async` because the
|
|
39
|
+
* underlying `TelemetryClient.close()` awaits the final flush.
|
|
39
40
|
*/
|
|
40
41
|
class TelemetryClientProvider {
|
|
41
|
-
constructor(
|
|
42
|
-
this.context = context;
|
|
43
|
-
this.softLimitWarned = false;
|
|
42
|
+
constructor() {
|
|
44
43
|
this.clients = new Map();
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
this.softLimitWarned = false;
|
|
45
|
+
}
|
|
46
|
+
// Production code should use `TelemetryClientProvider.getInstance()` for
|
|
47
|
+
// the process-wide singleton. The constructor remains public so unit tests
|
|
48
|
+
// can build an isolated provider with its own map. Deliberate no-op body —
|
|
49
|
+
// initial state is set inline on the field declarations above.
|
|
50
|
+
static getInstance() {
|
|
51
|
+
if (!TelemetryClientProvider.instance) {
|
|
52
|
+
TelemetryClientProvider.instance = new TelemetryClientProvider();
|
|
53
|
+
}
|
|
54
|
+
return TelemetryClientProvider.instance;
|
|
47
55
|
}
|
|
48
56
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
57
|
+
* Reset the process-wide singleton. Test-only — name-prefixed so
|
|
58
|
+
* production callsites can't reach for it accidentally via autocomplete.
|
|
59
|
+
* Resetting in production drops every host's circuit-breaker counters,
|
|
60
|
+
* feature-flag cache, exporter, and pending-metric buffer at once.
|
|
61
|
+
*
|
|
62
|
+
* @internal Test-only. Production code MUST NOT call this.
|
|
53
63
|
*/
|
|
64
|
+
static __resetInstanceForTests() {
|
|
65
|
+
TelemetryClientProvider.instance = undefined;
|
|
66
|
+
}
|
|
54
67
|
static normalizeHostKey(host) {
|
|
55
68
|
return host
|
|
56
69
|
.trim()
|
|
@@ -61,22 +74,16 @@ class TelemetryClientProvider {
|
|
|
61
74
|
.replace(/:443$/, '');
|
|
62
75
|
}
|
|
63
76
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* @param host The host identifier (e.g., "workspace.cloud.databricks.com")
|
|
68
|
-
* @returns The telemetry client for the host
|
|
77
|
+
* Get or create the `TelemetryClient` for `host`, registering `context` as
|
|
78
|
+
* a participant. Increments refcount.
|
|
69
79
|
*/
|
|
70
|
-
getOrCreateClient(host) {
|
|
71
|
-
const logger =
|
|
80
|
+
getOrCreateClient(context, host) {
|
|
81
|
+
const logger = context.getLogger();
|
|
72
82
|
const key = TelemetryClientProvider.normalizeHostKey(host);
|
|
73
83
|
let holder = this.clients.get(key);
|
|
74
84
|
if (!holder) {
|
|
75
|
-
const client = new TelemetryClient_1.default(
|
|
76
|
-
holder = {
|
|
77
|
-
client,
|
|
78
|
-
refCount: 0,
|
|
79
|
-
};
|
|
85
|
+
const client = new TelemetryClient_1.default(context, key);
|
|
86
|
+
holder = { client, refCount: 0 };
|
|
80
87
|
this.clients.set(key, holder);
|
|
81
88
|
logger.log(IDBSQLLogger_1.LogLevel.debug, `Created new TelemetryClient for host: ${host}`);
|
|
82
89
|
if (!this.softLimitWarned && this.clients.size > MAX_CLIENTS_SOFT_LIMIT) {
|
|
@@ -84,40 +91,43 @@ class TelemetryClientProvider {
|
|
|
84
91
|
logger.log(IDBSQLLogger_1.LogLevel.warn, `TelemetryClientProvider has ${this.clients.size} distinct hosts — possible alias or leak`);
|
|
85
92
|
}
|
|
86
93
|
}
|
|
94
|
+
else {
|
|
95
|
+
holder.client.registerContext(context);
|
|
96
|
+
}
|
|
87
97
|
holder.refCount += 1;
|
|
88
98
|
logger.log(IDBSQLLogger_1.LogLevel.debug, `TelemetryClient reference count for ${host}: ${holder.refCount}`);
|
|
89
99
|
return holder.client;
|
|
90
100
|
}
|
|
91
101
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* @param host The host identifier
|
|
102
|
+
* Release `context`'s registration. When the last `DBSQLClient` releases,
|
|
103
|
+
* the underlying `TelemetryClient.close()` runs and the entry is removed.
|
|
96
104
|
*/
|
|
97
|
-
releaseClient(host) {
|
|
98
|
-
const logger =
|
|
105
|
+
async releaseClient(context, host) {
|
|
106
|
+
const logger = context.getLogger();
|
|
99
107
|
const key = TelemetryClientProvider.normalizeHostKey(host);
|
|
100
108
|
const holder = this.clients.get(key);
|
|
101
109
|
if (!holder) {
|
|
102
110
|
logger.log(IDBSQLLogger_1.LogLevel.debug, `No TelemetryClient found for host: ${host}`);
|
|
103
111
|
return;
|
|
104
112
|
}
|
|
105
|
-
// Guard against double-release: a caller releasing more times than it got
|
|
106
|
-
// would otherwise drive refCount negative and close a client another
|
|
107
|
-
// caller is still holding. Warn loudly and refuse to decrement further.
|
|
108
113
|
if (holder.refCount <= 0) {
|
|
109
114
|
logger.log(IDBSQLLogger_1.LogLevel.warn, `Unbalanced release for TelemetryClient host: ${host}`);
|
|
110
115
|
return;
|
|
111
116
|
}
|
|
117
|
+
// Skip unregister on the last release so close()'s final flush can still
|
|
118
|
+
// resolve auth/connection providers from the FIFO snapshot.
|
|
119
|
+
if (holder.refCount > 1) {
|
|
120
|
+
holder.client.unregisterContext(context);
|
|
121
|
+
}
|
|
112
122
|
holder.refCount -= 1;
|
|
113
123
|
logger.log(IDBSQLLogger_1.LogLevel.debug, `TelemetryClient reference count for ${host}: ${holder.refCount}`);
|
|
114
|
-
// Close and remove client when reference count reaches zero.
|
|
115
|
-
// Remove from map before calling close so a concurrent getOrCreateClient
|
|
116
|
-
// creates a fresh client rather than receiving this closing one.
|
|
117
124
|
if (holder.refCount <= 0) {
|
|
125
|
+
// Remove from map BEFORE awaiting close so a concurrent
|
|
126
|
+
// getOrCreateClient creates a fresh instance rather than receiving
|
|
127
|
+
// this closing one.
|
|
118
128
|
this.clients.delete(key);
|
|
119
129
|
try {
|
|
120
|
-
holder.client.close();
|
|
130
|
+
await holder.client.close();
|
|
121
131
|
logger.log(IDBSQLLogger_1.LogLevel.debug, `Closed and removed TelemetryClient for host: ${host}`);
|
|
122
132
|
}
|
|
123
133
|
catch (error) {
|
|
@@ -126,16 +136,12 @@ class TelemetryClientProvider {
|
|
|
126
136
|
}
|
|
127
137
|
}
|
|
128
138
|
}
|
|
129
|
-
/**
|
|
130
|
-
* @internal Exposed for testing only.
|
|
131
|
-
*/
|
|
139
|
+
/** @internal Exposed for testing only. */
|
|
132
140
|
getRefCount(host) {
|
|
133
141
|
const holder = this.clients.get(TelemetryClientProvider.normalizeHostKey(host));
|
|
134
142
|
return holder ? holder.refCount : 0;
|
|
135
143
|
}
|
|
136
|
-
/**
|
|
137
|
-
* @internal Exposed for testing only.
|
|
138
|
-
*/
|
|
144
|
+
/** @internal Exposed for testing only. */
|
|
139
145
|
getActiveClients() {
|
|
140
146
|
const result = new Map();
|
|
141
147
|
for (const [host, holder] of this.clients.entries()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelemetryClientProvider.js","sourceRoot":"","sources":["../../lib/telemetry/TelemetryClientProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;AAGH,4DAAqD;AACrD,wEAAgD;
|
|
1
|
+
{"version":3,"file":"TelemetryClientProvider.js","sourceRoot":"","sources":["../../lib/telemetry/TelemetryClientProvider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;AAGH,4DAAqD;AACrD,wEAAgD;AAOhD,6EAA6E;AAC7E,4EAA4E;AAC5E,gDAAgD;AAChD,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC;;;;;;;;;;;;;GAaG;AACH,MAAM,uBAAuB;IAA7B;QAGU,YAAO,GAAG,IAAI,GAAG,EAAiC,CAAC;QAEnD,oBAAe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AE,MAAM,CAAC,MAAM,CAAC,CAAC;SACjC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,kBAAe,uBAAuB,CAAC"}
|
|
@@ -16,7 +16,22 @@
|
|
|
16
16
|
/// <reference types="node" />
|
|
17
17
|
import { EventEmitter } from 'events';
|
|
18
18
|
import IClientContext from '../contracts/IClientContext';
|
|
19
|
-
import { DriverConfiguration } from './types';
|
|
19
|
+
import { TelemetryEvent, TelemetryEventType, DriverConfiguration } from './types';
|
|
20
|
+
/**
|
|
21
|
+
* Typed map of event-type → listener payload shape. Keeps `on`/`off` calls
|
|
22
|
+
* structurally typed: `emitter.on(TelemetryEventType.ERROR, (e) => …)` infers
|
|
23
|
+
* `e: TelemetryEvent` instead of `any`. Avoids the EventEmitter-default
|
|
24
|
+
* `(...args: any[]) => void` trap where a typo in the event name silently
|
|
25
|
+
* registers a listener that never fires.
|
|
26
|
+
*/
|
|
27
|
+
export interface TelemetryEventMap {
|
|
28
|
+
[TelemetryEventType.CONNECTION_OPEN]: (event: TelemetryEvent) => void;
|
|
29
|
+
[TelemetryEventType.CONNECTION_CLOSE]: (event: TelemetryEvent) => void;
|
|
30
|
+
[TelemetryEventType.STATEMENT_START]: (event: TelemetryEvent) => void;
|
|
31
|
+
[TelemetryEventType.STATEMENT_COMPLETE]: (event: TelemetryEvent) => void;
|
|
32
|
+
[TelemetryEventType.CLOUDFETCH_CHUNK]: (event: TelemetryEvent) => void;
|
|
33
|
+
[TelemetryEventType.ERROR]: (event: TelemetryEvent) => void;
|
|
34
|
+
}
|
|
20
35
|
/**
|
|
21
36
|
* EventEmitter for driver telemetry.
|
|
22
37
|
* Emits events at key driver operations.
|
|
@@ -24,52 +39,54 @@ import { DriverConfiguration } from './types';
|
|
|
24
39
|
* CRITICAL REQUIREMENT: ALL exceptions must be caught and logged at LogLevel.debug ONLY
|
|
25
40
|
* (never warn/error) to avoid customer anxiety. NO console logging allowed - only IDBSQLLogger.
|
|
26
41
|
*
|
|
27
|
-
* All emit methods
|
|
28
|
-
*
|
|
42
|
+
* All emit methods funnel through `emitWrapped`, which holds the
|
|
43
|
+
* try/catch/debug-log scaffold. The per-method bodies do nothing but build
|
|
44
|
+
* the event shape — adding a new event type is a one-method change.
|
|
29
45
|
*/
|
|
30
46
|
export default class TelemetryEventEmitter extends EventEmitter {
|
|
31
47
|
private context;
|
|
32
48
|
private enabled;
|
|
33
49
|
constructor(context: IClientContext);
|
|
50
|
+
on<K extends keyof TelemetryEventMap>(eventName: K, listener: TelemetryEventMap[K]): this;
|
|
51
|
+
off<K extends keyof TelemetryEventMap>(eventName: K, listener: TelemetryEventMap[K]): this;
|
|
52
|
+
once<K extends keyof TelemetryEventMap>(eventName: K, listener: TelemetryEventMap[K]): this;
|
|
34
53
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
54
|
+
* Build-and-emit helper. The per-event `build` callback constructs the
|
|
55
|
+
* payload; everything else (enabled check, try/catch, swallow-and-log)
|
|
56
|
+
* lives here so the wrapping cannot drift between event types.
|
|
38
57
|
*/
|
|
58
|
+
private emitWrapped;
|
|
39
59
|
emitConnectionOpen(data: {
|
|
40
60
|
sessionId: string;
|
|
41
|
-
workspaceId
|
|
42
|
-
|
|
61
|
+
workspaceId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The full driver-configuration block (~1KB). Static for the process —
|
|
64
|
+
* emit sites SHOULD pass it once per client and pass `undefined` on
|
|
65
|
+
* subsequent CONNECTION_OPEN events (one client may open many sessions).
|
|
66
|
+
* The aggregator and exporter both treat `undefined` as "no change since
|
|
67
|
+
* the last metric on the same session lineage".
|
|
68
|
+
*/
|
|
69
|
+
driverConfig?: DriverConfiguration;
|
|
70
|
+
latencyMs: number;
|
|
71
|
+
}): void;
|
|
72
|
+
emitConnectionClose(data: {
|
|
73
|
+
sessionId: string;
|
|
74
|
+
latencyMs: number;
|
|
43
75
|
}): void;
|
|
44
|
-
/**
|
|
45
|
-
* Emit a statement start event.
|
|
46
|
-
*
|
|
47
|
-
* @param data Statement start data including statementId, sessionId, and operationType
|
|
48
|
-
*/
|
|
49
76
|
emitStatementStart(data: {
|
|
50
77
|
statementId: string;
|
|
51
|
-
sessionId
|
|
78
|
+
sessionId?: string;
|
|
52
79
|
operationType?: string;
|
|
53
80
|
}): void;
|
|
54
|
-
/**
|
|
55
|
-
* Emit a statement complete event.
|
|
56
|
-
*
|
|
57
|
-
* @param data Statement completion data including latency, result format, and metrics
|
|
58
|
-
*/
|
|
59
81
|
emitStatementComplete(data: {
|
|
60
82
|
statementId: string;
|
|
61
|
-
sessionId
|
|
83
|
+
sessionId?: string;
|
|
62
84
|
latencyMs?: number;
|
|
63
85
|
resultFormat?: string;
|
|
64
86
|
chunkCount?: number;
|
|
65
87
|
bytesDownloaded?: number;
|
|
66
88
|
pollCount?: number;
|
|
67
89
|
}): void;
|
|
68
|
-
/**
|
|
69
|
-
* Emit a CloudFetch chunk download event.
|
|
70
|
-
*
|
|
71
|
-
* @param data CloudFetch chunk data including chunk index, latency, bytes, and compression
|
|
72
|
-
*/
|
|
73
90
|
emitCloudFetchChunk(data: {
|
|
74
91
|
statementId: string;
|
|
75
92
|
chunkIndex: number;
|
|
@@ -80,7 +97,16 @@ export default class TelemetryEventEmitter extends EventEmitter {
|
|
|
80
97
|
/**
|
|
81
98
|
* Emit an error event.
|
|
82
99
|
*
|
|
83
|
-
*
|
|
100
|
+
* Redaction happens HERE — not at the exporter — so any in-process listener
|
|
101
|
+
* (this class extends `EventEmitter` and `getTelemetryEmitter()` is reachable
|
|
102
|
+
* from any consumer of `@databricks/sql`) sees the same redacted strings
|
|
103
|
+
* the export pipeline does. `redactSensitive` strips Bearer/Basic, Databricks
|
|
104
|
+
* token prefixes, JWTs, JSON-encoded secrets, URL userinfo, and common
|
|
105
|
+
* username-bearing filesystem paths, then caps length.
|
|
106
|
+
*
|
|
107
|
+
* `errorMessage` is also redacted, not only `errorStack` — operation error
|
|
108
|
+
* messages can carry query fragments, table names, parameter values that the
|
|
109
|
+
* SECRET_PATTERNS regex must scrub before they're emitted anywhere.
|
|
84
110
|
*/
|
|
85
111
|
emitError(data: {
|
|
86
112
|
statementId?: string;
|
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
const events_1 = require("events");
|
|
19
19
|
const IDBSQLLogger_1 = require("../contracts/IDBSQLLogger");
|
|
20
20
|
const types_1 = require("./types");
|
|
21
|
+
const telemetryUtils_1 = require("./telemetryUtils");
|
|
21
22
|
/**
|
|
22
23
|
* EventEmitter for driver telemetry.
|
|
23
24
|
* Emits events at key driver operations.
|
|
@@ -25,8 +26,9 @@ const types_1 = require("./types");
|
|
|
25
26
|
* CRITICAL REQUIREMENT: ALL exceptions must be caught and logged at LogLevel.debug ONLY
|
|
26
27
|
* (never warn/error) to avoid customer anxiety. NO console logging allowed - only IDBSQLLogger.
|
|
27
28
|
*
|
|
28
|
-
* All emit methods
|
|
29
|
-
*
|
|
29
|
+
* All emit methods funnel through `emitWrapped`, which holds the
|
|
30
|
+
* try/catch/debug-log scaffold. The per-method bodies do nothing but build
|
|
31
|
+
* the event shape — adding a new event type is a one-method change.
|
|
30
32
|
*/
|
|
31
33
|
class TelemetryEventEmitter extends events_1.EventEmitter {
|
|
32
34
|
constructor(context) {
|
|
@@ -38,134 +40,111 @@ class TelemetryEventEmitter extends events_1.EventEmitter {
|
|
|
38
40
|
const config = context.getConfig();
|
|
39
41
|
this.enabled = (_a = config.telemetryEnabled) !== null && _a !== void 0 ? _a : false;
|
|
40
42
|
}
|
|
43
|
+
// Typed event subscription. EventEmitter's native types use `any` payloads;
|
|
44
|
+
// these overrides give consumers a typed `event` parameter without forcing
|
|
45
|
+
// a wholesale rewrite of the EventEmitter contract.
|
|
46
|
+
on(eventName, listener) {
|
|
47
|
+
return super.on(eventName, listener);
|
|
48
|
+
}
|
|
49
|
+
off(eventName, listener) {
|
|
50
|
+
return super.off(eventName, listener);
|
|
51
|
+
}
|
|
52
|
+
once(eventName, listener) {
|
|
53
|
+
return super.once(eventName, listener);
|
|
54
|
+
}
|
|
41
55
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
56
|
+
* Build-and-emit helper. The per-event `build` callback constructs the
|
|
57
|
+
* payload; everything else (enabled check, try/catch, swallow-and-log)
|
|
58
|
+
* lives here so the wrapping cannot drift between event types.
|
|
45
59
|
*/
|
|
46
|
-
|
|
60
|
+
emitWrapped(eventType, build) {
|
|
61
|
+
var _a;
|
|
47
62
|
if (!this.enabled)
|
|
48
63
|
return;
|
|
49
64
|
const logger = this.context.getLogger();
|
|
50
65
|
try {
|
|
51
|
-
|
|
52
|
-
eventType: types_1.TelemetryEventType.CONNECTION_OPEN,
|
|
53
|
-
timestamp: Date.now(),
|
|
54
|
-
sessionId: data.sessionId,
|
|
55
|
-
workspaceId: data.workspaceId,
|
|
56
|
-
driverConfig: data.driverConfig,
|
|
57
|
-
};
|
|
58
|
-
this.emit(types_1.TelemetryEventType.CONNECTION_OPEN, event);
|
|
66
|
+
this.emit(eventType, build());
|
|
59
67
|
}
|
|
60
68
|
catch (error) {
|
|
61
|
-
|
|
62
|
-
logger.log(IDBSQLLogger_1.LogLevel.debug, `Error emitting connection event: ${error.message}`);
|
|
69
|
+
logger.log(IDBSQLLogger_1.LogLevel.debug, `Error emitting ${eventType}: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
63
70
|
}
|
|
64
71
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
emitConnectionOpen(data) {
|
|
73
|
+
this.emitWrapped(types_1.TelemetryEventType.CONNECTION_OPEN, () => ({
|
|
74
|
+
eventType: types_1.TelemetryEventType.CONNECTION_OPEN,
|
|
75
|
+
timestamp: Date.now(),
|
|
76
|
+
sessionId: data.sessionId,
|
|
77
|
+
workspaceId: data.workspaceId,
|
|
78
|
+
driverConfig: data.driverConfig,
|
|
79
|
+
latencyMs: data.latencyMs,
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
emitConnectionClose(data) {
|
|
83
|
+
this.emitWrapped(types_1.TelemetryEventType.CONNECTION_CLOSE, () => ({
|
|
84
|
+
eventType: types_1.TelemetryEventType.CONNECTION_CLOSE,
|
|
85
|
+
timestamp: Date.now(),
|
|
86
|
+
sessionId: data.sessionId,
|
|
87
|
+
latencyMs: data.latencyMs,
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
70
90
|
emitStatementStart(data) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
statementId: data.statementId,
|
|
79
|
-
sessionId: data.sessionId,
|
|
80
|
-
operationType: data.operationType,
|
|
81
|
-
};
|
|
82
|
-
this.emit(types_1.TelemetryEventType.STATEMENT_START, event);
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
// Swallow all exceptions - log at debug level only
|
|
86
|
-
logger.log(IDBSQLLogger_1.LogLevel.debug, `Error emitting statement start: ${error.message}`);
|
|
87
|
-
}
|
|
91
|
+
this.emitWrapped(types_1.TelemetryEventType.STATEMENT_START, () => ({
|
|
92
|
+
eventType: types_1.TelemetryEventType.STATEMENT_START,
|
|
93
|
+
timestamp: Date.now(),
|
|
94
|
+
statementId: data.statementId,
|
|
95
|
+
sessionId: data.sessionId,
|
|
96
|
+
operationType: data.operationType,
|
|
97
|
+
}));
|
|
88
98
|
}
|
|
89
|
-
/**
|
|
90
|
-
* Emit a statement complete event.
|
|
91
|
-
*
|
|
92
|
-
* @param data Statement completion data including latency, result format, and metrics
|
|
93
|
-
*/
|
|
94
99
|
emitStatementComplete(data) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
chunkCount: data.chunkCount,
|
|
107
|
-
bytesDownloaded: data.bytesDownloaded,
|
|
108
|
-
pollCount: data.pollCount,
|
|
109
|
-
};
|
|
110
|
-
this.emit(types_1.TelemetryEventType.STATEMENT_COMPLETE, event);
|
|
111
|
-
}
|
|
112
|
-
catch (error) {
|
|
113
|
-
// Swallow all exceptions - log at debug level only
|
|
114
|
-
logger.log(IDBSQLLogger_1.LogLevel.debug, `Error emitting statement complete: ${error.message}`);
|
|
115
|
-
}
|
|
100
|
+
this.emitWrapped(types_1.TelemetryEventType.STATEMENT_COMPLETE, () => ({
|
|
101
|
+
eventType: types_1.TelemetryEventType.STATEMENT_COMPLETE,
|
|
102
|
+
timestamp: Date.now(),
|
|
103
|
+
statementId: data.statementId,
|
|
104
|
+
sessionId: data.sessionId,
|
|
105
|
+
latencyMs: data.latencyMs,
|
|
106
|
+
resultFormat: data.resultFormat,
|
|
107
|
+
chunkCount: data.chunkCount,
|
|
108
|
+
bytesDownloaded: data.bytesDownloaded,
|
|
109
|
+
pollCount: data.pollCount,
|
|
110
|
+
}));
|
|
116
111
|
}
|
|
117
|
-
/**
|
|
118
|
-
* Emit a CloudFetch chunk download event.
|
|
119
|
-
*
|
|
120
|
-
* @param data CloudFetch chunk data including chunk index, latency, bytes, and compression
|
|
121
|
-
*/
|
|
122
112
|
emitCloudFetchChunk(data) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
latencyMs: data.latencyMs,
|
|
133
|
-
bytes: data.bytes,
|
|
134
|
-
compressed: data.compressed,
|
|
135
|
-
};
|
|
136
|
-
this.emit(types_1.TelemetryEventType.CLOUDFETCH_CHUNK, event);
|
|
137
|
-
}
|
|
138
|
-
catch (error) {
|
|
139
|
-
// Swallow all exceptions - log at debug level only
|
|
140
|
-
logger.log(IDBSQLLogger_1.LogLevel.debug, `Error emitting cloudfetch chunk: ${error.message}`);
|
|
141
|
-
}
|
|
113
|
+
this.emitWrapped(types_1.TelemetryEventType.CLOUDFETCH_CHUNK, () => ({
|
|
114
|
+
eventType: types_1.TelemetryEventType.CLOUDFETCH_CHUNK,
|
|
115
|
+
timestamp: Date.now(),
|
|
116
|
+
statementId: data.statementId,
|
|
117
|
+
chunkIndex: data.chunkIndex,
|
|
118
|
+
latencyMs: data.latencyMs,
|
|
119
|
+
bytes: data.bytes,
|
|
120
|
+
compressed: data.compressed,
|
|
121
|
+
}));
|
|
142
122
|
}
|
|
143
123
|
/**
|
|
144
124
|
* Emit an error event.
|
|
145
125
|
*
|
|
146
|
-
*
|
|
126
|
+
* Redaction happens HERE — not at the exporter — so any in-process listener
|
|
127
|
+
* (this class extends `EventEmitter` and `getTelemetryEmitter()` is reachable
|
|
128
|
+
* from any consumer of `@databricks/sql`) sees the same redacted strings
|
|
129
|
+
* the export pipeline does. `redactSensitive` strips Bearer/Basic, Databricks
|
|
130
|
+
* token prefixes, JWTs, JSON-encoded secrets, URL userinfo, and common
|
|
131
|
+
* username-bearing filesystem paths, then caps length.
|
|
132
|
+
*
|
|
133
|
+
* `errorMessage` is also redacted, not only `errorStack` — operation error
|
|
134
|
+
* messages can carry query fragments, table names, parameter values that the
|
|
135
|
+
* SECRET_PATTERNS regex must scrub before they're emitted anywhere.
|
|
147
136
|
*/
|
|
148
137
|
emitError(data) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
errorMessage: data.errorMessage,
|
|
160
|
-
errorStack: data.errorStack,
|
|
161
|
-
isTerminal: data.isTerminal,
|
|
162
|
-
};
|
|
163
|
-
this.emit(types_1.TelemetryEventType.ERROR, event);
|
|
164
|
-
}
|
|
165
|
-
catch (error) {
|
|
166
|
-
// Swallow all exceptions - log at debug level only
|
|
167
|
-
logger.log(IDBSQLLogger_1.LogLevel.debug, `Error emitting error event: ${error.message}`);
|
|
168
|
-
}
|
|
138
|
+
this.emitWrapped(types_1.TelemetryEventType.ERROR, () => ({
|
|
139
|
+
eventType: types_1.TelemetryEventType.ERROR,
|
|
140
|
+
timestamp: Date.now(),
|
|
141
|
+
statementId: data.statementId,
|
|
142
|
+
sessionId: data.sessionId,
|
|
143
|
+
errorName: data.errorName,
|
|
144
|
+
errorMessage: (0, telemetryUtils_1.redactSensitive)(data.errorMessage),
|
|
145
|
+
errorStack: data.errorStack === undefined ? undefined : (0, telemetryUtils_1.redactSensitive)(data.errorStack),
|
|
146
|
+
isTerminal: data.isTerminal,
|
|
147
|
+
}));
|
|
169
148
|
}
|
|
170
149
|
}
|
|
171
150
|
exports.default = TelemetryEventEmitter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelemetryEventEmitter.js","sourceRoot":"","sources":["../../lib/telemetry/TelemetryEventEmitter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAEH,mCAAsC;AAEtC,4DAAqD;AACrD,mCAAkF;
|
|
1
|
+
{"version":3,"file":"TelemetryEventEmitter.js","sourceRoot":"","sources":["../../lib/telemetry/TelemetryEventEmitter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAEH,mCAAsC;AAEtC,4DAAqD;AACrD,mCAAkF;AAClF,qDAAmD;AAkBnD;;;;;;;;;;GAUG;AACH,MAAqB,qBAAsB,SAAQ,qBAAY;IAG7D,YAAoB,OAAuB;;QACzC,KAAK,EAAE,CAAC;QADU,YAAO,GAAP,OAAO,CAAgB;QAEzC,4CAA4C;QAC5C,oCAAoC;QACpC,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,MAAA,MAAM,CAAC,gBAAgB,mCAAI,KAAK,CAAC;IAClD,CAAC;IAED,4EAA4E;IAC5E,2EAA2E;IAC3E,oDAAoD;IACpD,EAAE,CAAo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GAAG,EAAE;YACrB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAC,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,IAOT;QACC,IAAI,CAAC,WAAW,CAAC,0BAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YAChD,SAAS,EAAE,0BAAkB,CAAC,KAAK;YACnC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,YAAY,EAAE,IAAA,gCAAe,EAAC,IAAI,CAAC,YAAY,CAAC;YAChD,UAAU,EAAE,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,gCAAe,EAAC,IAAI,CAAC,UAAU,CAAC;YACxF,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC,CAAC,CAAC;IACN,CAAC;CACF;AA5JD,wCA4JC"}
|
|
@@ -13,10 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { TOperationType, TSparkRowSetType } from '../../thrift/TCLIService_types';
|
|
16
17
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @param path The path to append (should start with /)
|
|
20
|
-
* @returns Full URL with protocol
|
|
18
|
+
* Map Thrift TOperationType to telemetry Operation.Type enum string.
|
|
19
|
+
* Returns 'TYPE_UNSPECIFIED' if operationType is undefined or unknown.
|
|
21
20
|
*/
|
|
22
|
-
export declare function
|
|
21
|
+
export declare function mapOperationTypeToTelemetryType(operationType?: TOperationType): string;
|
|
22
|
+
/**
|
|
23
|
+
* Map Thrift TSparkRowSetType to telemetry ExecutionResult.Format enum string.
|
|
24
|
+
*/
|
|
25
|
+
export declare function mapResultFormatToTelemetryType(resultFormat?: TSparkRowSetType): string | undefined;
|