[PECOBLR-1381] Implement telemetry Phase 6: Metric collection & aggregation #318
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This stacked PR builds on #317 and implements Phase 6 (Metric Collection & Aggregation) and Phase 7 (Driver Integration) of the telemetry system. This completes the full telemetry pipeline from driver operations through aggregation to export.
Stack:
✅ Phase 6: Metric Collection & Aggregation (PECOBLR-1381)
New Components
1. Error Classification (
errors.go- 108 lines)isTerminalError()- Identifies non-retryable errorsclassifyError()- Categorizes errors for telemetry2. Telemetry Interceptor (
interceptor.go- 146 lines)BeforeExecute()/AfterExecute()hooks (exported)AddTag())3. Metrics Aggregator (
aggregator.go- 242 lines)4. Client Integration (
client.go- updated)GetInterceptor()for driver use✅ Phase 7: Driver Integration (PECOBLR-1382)
Configuration Support
UserConfig Extensions (
internal/config/config.go)EnableTelemetryfield (user opt-in, respects server)ForceEnableTelemetryfield (bypass server checks)enableTelemetry=true/false)forceEnableTelemetry=true)DeepCopy()support for new fieldsConnection Integration (
connection.go,connector.go)telemetry *telemetry.Interceptorfield toconnstructconnector.Connect()conn.Close()with resource releaseDriver Integration Helper (
driver_integration.go- 59 lines)InitializeForConnection()- One-stop initializationReleaseForConnection()- Resource cleanupType Exports
Interceptortype (wasinterceptor)GetInterceptor()method (wasgetInterceptor)Close()method (wasclose)📊 Integration Flow
Opt-In Priority (5 levels):
forceEnableTelemetry=true→ Always enabled (testing/internal)enableTelemetry=false→ Always disabled (explicit opt-out)enableTelemetry=true+ server flag → User opt-in with server control📈 Changes Summary
Phase 6 Files:
telemetry/errors.go(108 lines) - NEWtelemetry/interceptor.go(146 lines) - NEWtelemetry/aggregator.go(242 lines) - NEWtelemetry/client.go(+27/-9 lines) - MODIFIEDPhase 7 Files:
telemetry/driver_integration.go(59 lines) - NEWtelemetry/interceptor.go(exports) - MODIFIEDtelemetry/client.go(exports) - MODIFIEDinternal/config/config.go(+18 lines) - MODIFIEDconnection.go(+10 lines) - MODIFIEDconnector.go(+10 lines) - MODIFIEDtelemetry/DESIGN.md(marked Phase 6-7 complete) - MODIFIEDTotal: +1,073 insertions, -48 deletions across 13 files
✅ Testing Status
All tests passing ✅
Integration verified:
🎯 Completion Status
✅ Completed (Phases 1-7):
🔄 Optional Enhancements (Future):
🚀 Usage Example
Related Issues
Checklist