Skip to content

Conversation

@costela
Copy link
Member

@costela costela commented Jun 2, 2025

This pull request introduces a new feature to allow skipping individual batch queries during tracing and refactors the Tracer implementation for improved maintainability. The most significant changes include adding a new configuration option, restructuring the Tracer to use a unified configuration object, and modifying context handling to support batch query skipping.

New Feature: Skipping Batch Queries

  • Added a WithSkipBatchQueries option to enable skipping the tracing of individual batch queries while still tracing the batch itself.

Refactoring for maintainability and performance

  • Replaced the flat fields in the Tracer struct (e.g., tracerAttrs, trimQuerySpanName) with a single embedded tracerConfig struct for better organization and scalability.
  • Changed the startTimeCtxKey to an empty struct type to minimally reduce memory usage.

Closes #54

@costela costela requested review from Copilot and obitech June 2, 2025 15:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

o.minimumReadDBStatsInterval = interval
})
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// WithSkipBatchQueries will disable tracing individuals batch queries, only tracing the batch itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to supress span per query in batches

3 participants