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
This commit implements Phase 7 (driver integration) for the telemetry system,
completing the full telemetry pipeline from driver operations to export.
Phase 7: Driver Integration
- Add telemetry configuration to UserConfig
- EnableTelemetry: User opt-in flag (respects server feature flags)
- ForceEnableTelemetry: Force enable flag (bypasses server checks)
- DSN parameter parsing in ParseDSN()
- DeepCopy support for telemetry fields
- Add telemetry support to connection
- Add telemetry field to conn struct (*telemetry.Interceptor)
- Initialize telemetry in connector.Connect()
- Release telemetry resources in conn.Close()
- Graceful shutdown with pending metric flush
- Export telemetry types for driver use
- Export Interceptor type (was interceptor)
- Export GetInterceptor() method (was getInterceptor)
- Export Close() method (was close)
- Create driver integration helper (driver_integration.go)
- InitializeForConnection(): One-stop initialization
- ReleaseForConnection(): Resource cleanup
- Encapsulates feature flag checks and client management
- Reference counting for per-host resources
Integration Flow:
1. User sets enableTelemetry=true or forceEnableTelemetry=true in DSN
2. connector.Connect() calls telemetry.InitializeForConnection()
3. Telemetry checks feature flags and returns Interceptor if enabled
4. Connection uses Interceptor for metric collection (Phase 8)
5. conn.Close() releases telemetry resources
Architecture:
- Per-connection: Interceptor instance
- Per-host (shared): telemetryClient, aggregator, exporter
- Global (singleton): clientManager, featureFlagCache, circuitBreakerManager
Opt-In Priority (5 levels):
1. forceEnableTelemetry=true - Always enabled (testing/internal)
2. enableTelemetry=false - Always disabled (explicit opt-out)
3. enableTelemetry=true + server flag - User opt-in with server control
4. Server flag only - Default Databricks-controlled behavior
5. Default - Disabled (fail-safe)
Testing:
- All 70+ telemetry tests passing
- No breaking changes to existing driver tests
- Compilation verified across all packages
- Graceful handling when telemetry disabled
Note: Statement hooks (beforeExecute/afterExecute) will be added in follow-up
for actual metric collection during query execution.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
0 commit comments