feat: propagate traceparent to all NAPI async entry points#49
Open
sinianluoye wants to merge 1 commit intomainfrom
Open
feat: propagate traceparent to all NAPI async entry points#49sinianluoye wants to merge 1 commit intomainfrom
sinianluoye wants to merge 1 commit intomainfrom
Conversation
Add traceparent: Option<String> parameter to all remaining async NAPI entry points that perform I/O, so Rust-side spans share the same traceId as the calling TypeScript code. Rust changes: - connection.rs: 7 functions (table_names, create_table, create_empty_table, open_table, clone_table, drop_table, drop_all_tables) - iterator.rs: store traceparent in RecordBatchIterator, use in next() - query.rs: pass traceparent to RecordBatchIterator::new() (3 sites) - merge.rs: add traceparent to execute() TypeScript changes: - connection.ts: pass getTraceparent() to all 7 NAPI calls - merge.ts: pass getTraceparent() to execute() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📝 Description
Propagate
traceparentto all remaining async NAPI entry points that perform I/O, so Rust-side tracing spans share the same traceId as the calling TypeScript code. Previously onlyquery.execute,table.add,table.update,table.delete,table.countRows,table.createIndex, andtable.optimizereceived a traceparent — all other async functions produced orphaned traces.Rust changes
traceparent: Option<String>+napi_span!+.instrument(span)to 7 functions:table_names,create_table,create_empty_table,open_table,clone_table,drop_table,drop_all_tablestraceparentfield inRecordBatchIterator, use innext()withnapi_span!+.instrument(span)traceparenttoRecordBatchIterator::new()in all 3execute()methods (Query, VectorQuery, TakeQuery)traceparenttoexecute()+napi_span!+.instrument(span)TypeScript changes
getTraceparent, passawait getTraceparent()to all 7 NAPI callsgetTraceparent, passawait getTraceparent()toexecute()Verification
cargo checkpasses (both with and withoutprofiling-otlpfeature)tsc --noEmitpasses✅ Checklist
type(scope): descriptionformat (lowercase).🤖 Generated with Claude Code