feat: add option to skip individual queries in batch mode#59
Open
feat: add option to skip individual queries in batch mode#59
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new feature to allow skipping individual queries in batch mode and refactors the Tracer implementation for better maintainability and performance. Key changes include adding a new configuration option WithSkipBatchQueries, restructuring the Tracer struct to embed a unified tracerConfig, and replacing string-based context keys with dedicated struct types.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tracer.go | Refactored context key usage and added skip logic for batch query tracing. |
| options.go | Added a new option function to enable skipping batch queries. |
7a05b65 to
d223148
Compare
This was referenced Jun 2, 2025
obitech
requested changes
Sep 17, 2025
| o.minimumReadDBStatsInterval = interval | ||
| }) | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
Suggested change
| // WithSkipBatchQueries will disable tracing individuals batch queries, only tracing the batch itself |
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.
This pull request introduces a new feature to allow skipping individual batch queries during tracing and refactors the
Tracerimplementation for improved maintainability. The most significant changes include adding a new configuration option, restructuring theTracerto use a unified configuration object, and modifying context handling to support batch query skipping.New Feature: Skipping Batch Queries
WithSkipBatchQueriesoption to enable skipping the tracing of individual batch queries while still tracing the batch itself.Refactoring for maintainability and performance
Tracerstruct (e.g.,tracerAttrs,trimQuerySpanName) with a single embeddedtracerConfigstruct for better organization and scalability.startTimeCtxKeyto an empty struct type to minimally reduce memory usage.Closes #54