Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
da2e6d3
Add telemetry infrastructure: CircuitBreaker and FeatureFlagCache
samikshya-db Jan 28, 2026
02b2368
Add telemetry client management: TelemetryClient and Provider
samikshya-db Jan 28, 2026
3fcc454
Add telemetry event emission and aggregation
samikshya-db Jan 28, 2026
1daf6b5
Add telemetry export: DatabricksTelemetryExporter
samikshya-db Jan 28, 2026
d5ae8fb
Add authentication support for REST API calls
samikshya-db Jan 29, 2026
f75eb3d
Update DatabricksTelemetryExporter to use authenticated export
samikshya-db Jan 29, 2026
6663aad
Fix feature flag endpoint and telemetry export
samikshya-db Jan 29, 2026
36f2878
Match JDBC telemetry payload format
samikshya-db Jan 29, 2026
5c1851a
Fix lint errors
samikshya-db Jan 29, 2026
39f3c00
Add missing getAuthHeaders method to ClientContextStub
samikshya-db Jan 29, 2026
d646c31
Fix prettier formatting
samikshya-db Jan 29, 2026
7cb09e9
Add DRIVER_NAME constant for nodejs-sql-driver
samikshya-db Jan 30, 2026
c5d4cfc
Add missing telemetry fields to match JDBC
samikshya-db Jan 30, 2026
288f624
Fix TypeScript compilation: add missing fields to system_configuratio…
samikshya-db Jan 30, 2026
b2bbd0a
Merge branch 'telemetry-4-event-aggregation' into telemetry-5-export
samikshya-db Jan 30, 2026
3bef69c
Merge PR #327 fixes into PR #328
samikshya-db Feb 5, 2026
fa356e1
Merge telemetry-4-event-aggregation proxy fix into telemetry-5-export
samikshya-db Feb 5, 2026
c3494c1
Merge extensible feature flags from telemetry-4-event-aggregation
samikshya-db Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions tests/unit/.stubs/TelemetryExporterStub.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Copyright (c) 2025 Databricks Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { TelemetryMetric } from '../../../lib/telemetry/types';

/**
* Stub implementation of DatabricksTelemetryExporter for testing.
* Records exported metrics for verification in tests.
*/
export default class TelemetryExporterStub {
public exportedMetrics: TelemetryMetric[][] = [];
public exportCount = 0;
public shouldThrow = false;
public throwError: Error | null = null;

/**
* Stub export method that records metrics.
*/
async export(metrics: TelemetryMetric[]): Promise<void> {
this.exportCount++;
this.exportedMetrics.push([...metrics]);

if (this.shouldThrow && this.throwError) {
throw this.throwError;
}
}

/**
* Reset the stub state.
*/
reset(): void {
this.exportedMetrics = [];
this.exportCount = 0;
this.shouldThrow = false;
this.throwError = null;
}

/**
* Get all exported metrics flattened.
*/
getAllExportedMetrics(): TelemetryMetric[] {
return this.exportedMetrics.flat();
}

/**
* Configure stub to throw an error on export.
*/
throwOnExport(error: Error): void {
this.shouldThrow = true;
this.throwError = error;
}
}
Loading
Loading