Skip to content

Commit d3811e1

Browse files
authored
Marked as deprecated query.EmptyTxControl() (#1955)
1 parent 5392c4d commit d3811e1

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

query/transaction.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ func TxControl(opts ...tx.ControlOption) *TransactionControl {
4747
}
4848

4949
// EmptyTxControl defines transaction control inference on server-side by query content
50+
// Deprecated: Use ImplicitTxControl instead.
51+
// Will be removed after May 2026.
52+
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
5053
func EmptyTxControl() *TransactionControl {
5154
return ImplicitTxControl()
5255
}
@@ -60,7 +63,7 @@ func ImplicitTxControl() *TransactionControl {
6063

6164
// NoTx defines nil transaction control
6265
// This is wrong name for transaction control inference on server-side by query content
63-
// Deprecated: Use EmptyTxControl instead.
66+
// Deprecated: Use ImplicitTxControl instead.
6467
// Will be removed after Oct 2025.
6568
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
6669
func NoTx() *TransactionControl {

tests/slo/internal/metrics/metrics.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ import (
77
"sync/atomic"
88
"time"
99

10+
"github.com/ydb-platform/ydb-go-sdk/v3"
1011
"go.opentelemetry.io/otel/attribute"
1112
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
1213
otelmetric "go.opentelemetry.io/otel/metric"
1314
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
1415
"go.opentelemetry.io/otel/sdk/resource"
1516
semconv "go.opentelemetry.io/otel/semconv/v1.24.0"
1617

17-
"github.com/ydb-platform/ydb-go-sdk/v3"
18-
1918
"slo/internal/log"
2019
)
2120

@@ -28,7 +27,7 @@ type (
2827
Metrics struct {
2928
mp *sdkmetric.MeterProvider
3029
meter otelmetric.Meter
31-
ctx context.Context
30+
ctx context.Context //nolint:containedctx
3231
cancel context.CancelFunc
3332

3433
// Labels for metrics
@@ -66,6 +65,7 @@ func New(endpoint, ref, label, jobName string, reportPeriodMs int) (*Metrics, er
6665

6766
if endpoint == "" {
6867
log.Printf("Warning: no OTLP endpoint provided, metrics will not be exported")
68+
6969
return m, nil
7070
}
7171

@@ -214,6 +214,7 @@ func (m *Metrics) Push() error {
214214
if m.mp == nil {
215215
return nil
216216
}
217+
217218
// Force flush
218219
return m.mp.ForceFlush(m.ctx)
219220
}
@@ -234,6 +235,7 @@ func (m *Metrics) Close() error {
234235
return nil
235236
}
236237
m.cancel()
238+
237239
return m.mp.Shutdown(context.Background())
238240
}
239241

@@ -242,6 +244,7 @@ func (m *Metrics) commonAttrs(additional ...attribute.KeyValue) []attribute.KeyV
242244
attrs := []attribute.KeyValue{
243245
attribute.String("ref", m.ref),
244246
}
247+
245248
return append(attrs, additional...)
246249
}
247250

tests/slo/internal/workers/workers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,6 @@ func (w *Workers) Close() error {
6464
if w.m != nil {
6565
return w.m.Close()
6666
}
67+
6768
return nil
6869
}

0 commit comments

Comments
 (0)