Skip to content

Commit 0af46e7

Browse files
committed
Remove stale nolint:unused directives
These functions/types are now used by the exported BeforeExecute, AfterExecute, and CompleteStatement methods wired into connection.go, so the unused suppression directives are no longer needed. Co-authored-by: samikshya-chand_data
1 parent 8fe174d commit 0af46e7

3 files changed

Lines changed: 5 additions & 28 deletions

File tree

telemetry/aggregator.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ type metricsAggregator struct {
2828
}
2929

3030
// statementMetrics holds aggregated metrics for a statement.
31-
//
32-
//nolint:unused // Will be used in Phase 8+
3331
type statementMetrics struct {
3432
statementID string
3533
sessionID string
@@ -63,8 +61,6 @@ func newMetricsAggregator(exporter *telemetryExporter, cfg *Config) *metricsAggr
6361
}
6462

6563
// recordMetric records a metric for aggregation.
66-
//
67-
//nolint:unused // Will be used in Phase 8+
6864
func (agg *metricsAggregator) recordMetric(ctx context.Context, metric *telemetryMetric) {
6965
// Swallow all errors
7066
defer func() {
@@ -136,8 +132,6 @@ func (agg *metricsAggregator) recordMetric(ctx context.Context, metric *telemetr
136132
}
137133

138134
// completeStatement marks a statement as complete and emits aggregated metric.
139-
//
140-
//nolint:unused // Will be used in Phase 8+
141135
func (agg *metricsAggregator) completeStatement(ctx context.Context, statementID string, failed bool) {
142136
defer func() {
143137
if r := recover(); r != nil {
@@ -248,13 +242,10 @@ func (agg *metricsAggregator) close(ctx context.Context) error {
248242
}
249243

250244
// simpleError is a simple error implementation for testing.
251-
//
252-
//nolint:unused // Will be used in Phase 8+
253245
type simpleError struct {
254246
msg string
255247
}
256248

257-
//nolint:unused // Will be used in Phase 8+
258249
func (e *simpleError) Error() string {
259250
return e.msg
260251
}

telemetry/errors.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import (
88
// isTerminalError returns true if error is terminal (non-retryable).
99
// Terminal errors indicate user errors or permanent failures that won't
1010
// be resolved by retrying the operation.
11-
//
12-
//nolint:unused // Will be used in Phase 8+
11+
1312
func isTerminalError(err error) bool {
1413
if err == nil {
1514
return false
@@ -45,8 +44,7 @@ func isTerminalError(err error) bool {
4544

4645
// classifyError classifies an error for telemetry purposes.
4746
// Returns a string representation of the error type.
48-
//
49-
//nolint:unused // Will be used in Phase 8+
47+
5048
func classifyError(err error) string {
5149
if err == nil {
5250
return ""
@@ -89,14 +87,12 @@ func isRetryableError(err error) bool {
8987
}
9088

9189
// httpError represents an HTTP error with status code.
92-
//
93-
//nolint:unused // Will be used in Phase 8+
90+
9491
type httpError struct {
9592
statusCode int
9693
message string
9794
}
9895

99-
//nolint:unused // Will be used in Phase 8+
10096
func (e *httpError) Error() string {
10197
return e.message
10298
}
@@ -112,16 +108,14 @@ func newHTTPError(statusCode int, message string) error {
112108
}
113109

114110
// isTerminalHTTPStatus returns true for non-retryable HTTP status codes.
115-
//
116-
//nolint:unused // Will be used in Phase 8+
111+
117112
func isTerminalHTTPStatus(status int) bool {
118113
// 4xx errors (except 429) are terminal
119114
return status >= 400 && status < 500 && status != 429
120115
}
121116

122117
// extractHTTPError extracts HTTP error information if available.
123-
//
124-
//nolint:unused // Will be used in Phase 8+
118+
125119
func extractHTTPError(err error) (*httpError, bool) {
126120
var httpErr *httpError
127121
if errors.As(err, &httpErr) {

telemetry/interceptor.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,14 @@ type Interceptor struct {
1515
}
1616

1717
// metricContext holds metric collection state in context.
18-
//
19-
//nolint:unused // Will be used in Phase 8+
2018
type metricContext struct {
2119
statementID string
2220
startTime time.Time
2321
tags map[string]interface{}
2422
}
2523

26-
//nolint:unused // Will be used in Phase 8+
2724
type contextKey int
2825

29-
//nolint:unused // Will be used in Phase 8+
3026
const metricContextKey contextKey = 0
3127

3228
// newInterceptor creates a new telemetry interceptor.
@@ -38,15 +34,11 @@ func newInterceptor(aggregator *metricsAggregator, enabled bool) *Interceptor {
3834
}
3935

4036
// withMetricContext adds metric context to the context.
41-
//
42-
//nolint:unused // Will be used in Phase 8+
4337
func withMetricContext(ctx context.Context, mc *metricContext) context.Context {
4438
return context.WithValue(ctx, metricContextKey, mc)
4539
}
4640

4741
// getMetricContext retrieves metric context from the context.
48-
//
49-
//nolint:unused // Will be used in Phase 8+
5042
func getMetricContext(ctx context.Context) *metricContext {
5143
if mc, ok := ctx.Value(metricContextKey).(*metricContext); ok {
5244
return mc

0 commit comments

Comments
 (0)