-
Notifications
You must be signed in to change notification settings - Fork 60
[PECOBLR-1384] Complete telemetry implementation: Phases 8-10 #322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
samikshya-db
merged 20 commits into
main
from
stack/PECOBLR-1384-telemetry-phase8-validation
Apr 13, 2026
Merged
Changes from 6 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
8c8fef0
Implement Phases 8-10: Testing, Launch Prep & Documentation
samikshya-db a1f8b0c
Rebase onto updated PR #320; remove ForceEnableTelemetry; fix test al…
samikshya-db 434114d
Fix gofmt formatting in telemetry files
samikshya-db fb91627
Remove LAUNCH.md and TROUBLESHOOTING.md
samikshya-db aa1f4ba
Fix rows.NewRows calls to include telemetry parameters
samikshya-db e23c725
Fix runQuery test calls to match updated function signature
samikshya-db 1c7c572
Address PR review feedback
samikshya-db b81f0f1
Fix golangci-lint failures
samikshya-db edc6e10
Fix remaining golangci-lint failures
samikshya-db d1c5f09
Make connection-close telemetry flush blocking
samikshya-db 1e5ae75
Fix generateEventID to use crypto/rand without modulo bias
samikshya-db 194ecb1
Rewrite telemetry DESIGN.md as a concise reference doc
samikshya-db d9cd31b
Wire up DELETE_SESSION, EXECUTE_STATEMENT, CLOSE_STATEMENT telemetry
samikshya-db 09862ba
Remove telemetry/benchmark_test.go
samikshya-db a35153f
Address PR review: fix shutdown race, featureflag data race, re-add b…
samikshya-db abd87f5
Wire telemetry tuning params from DSN through to telemetry client
samikshya-db 82b38ab
Fix all golangci-lint issues across the repository
samikshya-db 0b0c544
Merge branch 'main' into stack/PECOBLR-1384-telemetry-phase8-validation
samikshya-db af10e36
Revert .golangci.yml to main-compatible v1.51 format
samikshya-db 1f44c8f
Fix golangci-lint v1.51 errors: remove dead code, allow unused nolints
samikshya-db File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,12 @@ type rows struct { | |
| logger_ *dbsqllog.DBSQLLogger | ||
|
|
||
| ctx context.Context | ||
|
|
||
| // Telemetry tracking | ||
| telemetryCtx context.Context | ||
| telemetryUpdate func(chunkCount int, bytesDownloaded int64) | ||
| chunkCount int | ||
| bytesDownloaded int64 | ||
| } | ||
|
|
||
| var _ driver.Rows = (*rows)(nil) | ||
|
|
@@ -72,6 +78,8 @@ func NewRows( | |
| client cli_service.TCLIService, | ||
| config *config.Config, | ||
| directResults *cli_service.TSparkDirectResults, | ||
| telemetryCtx context.Context, | ||
| telemetryUpdate func(chunkCount int, bytesDownloaded int64), | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is a public function, are we sure this is ok to change? |
||
| ) (driver.Rows, dbsqlerr.DBError) { | ||
|
|
||
| connId := driverctx.ConnIdFromContext(ctx) | ||
|
|
@@ -103,14 +111,18 @@ func NewRows( | |
| logger.Debug().Msgf("databricks: creating Rows, pageSize: %d, location: %v", pageSize, location) | ||
|
|
||
| r := &rows{ | ||
| client: client, | ||
| opHandle: opHandle, | ||
| connId: connId, | ||
| correlationId: correlationId, | ||
| location: location, | ||
| config: config, | ||
| logger_: logger, | ||
| ctx: ctx, | ||
| client: client, | ||
| opHandle: opHandle, | ||
| connId: connId, | ||
| correlationId: correlationId, | ||
| location: location, | ||
| config: config, | ||
| logger_: logger, | ||
| ctx: ctx, | ||
| telemetryCtx: telemetryCtx, | ||
| telemetryUpdate: telemetryUpdate, | ||
| chunkCount: 0, | ||
| bytesDownloaded: 0, | ||
| } | ||
|
|
||
| // if we already have results for the query do some additional initialization | ||
|
|
@@ -127,6 +139,17 @@ func NewRows( | |
| if err != nil { | ||
| return r, err | ||
| } | ||
|
|
||
| r.chunkCount++ | ||
| if directResults.ResultSet != nil && directResults.ResultSet.Results != nil && directResults.ResultSet.Results.ArrowBatches != nil { | ||
| for _, batch := range directResults.ResultSet.Results.ArrowBatches { | ||
| r.bytesDownloaded += int64(len(batch.Batch)) | ||
| } | ||
| } | ||
|
|
||
| if r.telemetryUpdate != nil { | ||
| r.telemetryUpdate(r.chunkCount, r.bytesDownloaded) | ||
| } | ||
| } | ||
|
|
||
| var d rowscanner.Delimiter | ||
|
|
@@ -458,6 +481,19 @@ func (r *rows) fetchResultPage() error { | |
| return err1 | ||
| } | ||
|
|
||
| r.chunkCount++ | ||
| if fetchResult != nil && fetchResult.Results != nil { | ||
| if fetchResult.Results.ArrowBatches != nil { | ||
| for _, batch := range fetchResult.Results.ArrowBatches { | ||
| r.bytesDownloaded += int64(len(batch.Batch)) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if r.telemetryUpdate != nil { | ||
| r.telemetryUpdate(r.chunkCount, r.bytesDownloaded) | ||
| } | ||
|
|
||
| err1 = r.makeRowScanner(fetchResult) | ||
| if err1 != nil { | ||
| return err1 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we have forceEnableTelemetry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated from previous prs (where we removed forceTelemetry)