You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-05-22 09:35:21 +02:00
Drop support for Go 1.24 (#7984)
This commit is contained in:
@@ -167,7 +167,7 @@ jobs:
|
||||
compatibility-test:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: ["1.26.0", "1.25.0", "1.24.0"]
|
||||
go-version: ["1.26.0", "1.25.0"]
|
||||
platform:
|
||||
- os: ubuntu-latest
|
||||
arch: "386"
|
||||
|
||||
@@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Removed
|
||||
|
||||
- Drop support for [Go 1.24]. (#7984)
|
||||
|
||||
<!-- Released section -->
|
||||
<!-- Don't change this section unless doing release -->
|
||||
|
||||
|
||||
@@ -55,25 +55,18 @@ Currently, this project supports the following environments.
|
||||
|----------|------------|--------------|
|
||||
| Ubuntu | 1.26 | amd64 |
|
||||
| Ubuntu | 1.25 | amd64 |
|
||||
| Ubuntu | 1.24 | amd64 |
|
||||
| Ubuntu | 1.26 | 386 |
|
||||
| Ubuntu | 1.25 | 386 |
|
||||
| Ubuntu | 1.24 | 386 |
|
||||
| Ubuntu | 1.26 | arm64 |
|
||||
| Ubuntu | 1.25 | arm64 |
|
||||
| Ubuntu | 1.24 | arm64 |
|
||||
| macOS | 1.26 | amd64 |
|
||||
| macOS | 1.25 | amd64 |
|
||||
| macOS | 1.24 | amd64 |
|
||||
| macOS | 1.26 | arm64 |
|
||||
| macOS | 1.25 | arm64 |
|
||||
| macOS | 1.24 | arm64 |
|
||||
| Windows | 1.26 | amd64 |
|
||||
| Windows | 1.25 | amd64 |
|
||||
| Windows | 1.24 | amd64 |
|
||||
| Windows | 1.26 | 386 |
|
||||
| Windows | 1.25 | 386 |
|
||||
| Windows | 1.24 | 386 |
|
||||
|
||||
While this project should work for other systems, no compatibility guarantees
|
||||
are made for those systems currently.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/bridge/opencensus
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.11.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/bridge/opencensus/test
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
go.opencensus.io v0.24.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/bridge/opentracing
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
replace go.opentelemetry.io/otel => ../..
|
||||
|
||||
|
||||
@@ -126,10 +126,7 @@ func TestExporterConcurrentSafe(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(t.Context())
|
||||
runs := new(uint64)
|
||||
for range goroutines {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
|
||||
wg.Go(func() {
|
||||
r := make([]sdklog.Record, 1)
|
||||
for {
|
||||
select {
|
||||
@@ -141,7 +138,7 @@ func TestExporterConcurrentSafe(t *testing.T) {
|
||||
atomic.AddUint64(runs, 1)
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
for atomic.LoadUint64(runs) == 0 {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
// Contains broken dependency on go.opentelemetry.io/otel/sdk/log/logtest.
|
||||
retract v0.12.0
|
||||
|
||||
@@ -94,10 +94,7 @@ func TestExporterConcurrentSafe(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(t.Context())
|
||||
runs := new(uint64)
|
||||
for range goroutines {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
|
||||
wg.Go(func() {
|
||||
r := make([]log.Record, 1)
|
||||
for {
|
||||
select {
|
||||
@@ -109,7 +106,7 @@ func TestExporterConcurrentSafe(t *testing.T) {
|
||||
atomic.AddUint64(runs, 1)
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
for atomic.LoadUint64(runs) == 0 {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
// Contains broken dependency on go.opentelemetry.io/otel/sdk/log/logtest.
|
||||
retract v0.12.0
|
||||
|
||||
@@ -84,14 +84,12 @@ func TestExporterDoesNotBlockTemporalityAndAggregation(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
rm := new(metricdata.ResourceMetrics)
|
||||
t.Log("starting export")
|
||||
require.NoError(t, exp.Export(ctx, rm))
|
||||
t.Log("export complete")
|
||||
}()
|
||||
})
|
||||
|
||||
assert.Eventually(t, func() bool {
|
||||
const inst = metric.InstrumentKindCounter
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
retract v0.32.2 // Contains unresolvable dependencies.
|
||||
|
||||
|
||||
@@ -84,14 +84,12 @@ func TestExporterDoesNotBlockTemporalityAndAggregation(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
rm := new(metricdata.ResourceMetrics)
|
||||
t.Log("starting export")
|
||||
require.NoError(t, exp.Export(ctx, rm))
|
||||
t.Log("export complete")
|
||||
}()
|
||||
})
|
||||
|
||||
assert.Eventually(t, func() bool {
|
||||
const inst = metric.InstrumentKindCounter
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
retract v0.32.2 // Contains unresolvable dependencies.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/otlp/otlptrace
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/google/go-cmp v0.7.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/cenkalti/backoff/v5 v5.0.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/cenkalti/backoff/v5 v5.0.3
|
||||
|
||||
@@ -1162,12 +1162,10 @@ func TestCollectorConcurrentSafe(t *testing.T) {
|
||||
var wg sync.WaitGroup
|
||||
concurrencyLevel := 10
|
||||
for range concurrencyLevel {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_, err := registry.Gather() // this calls collector.Collect
|
||||
assert.NoError(t, err)
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/prometheus
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
// v0.59.0 produces incorrect metric names when bracketed units are used.
|
||||
// https://github.com/open-telemetry/opentelemetry-go/issues/7039
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/stdout/stdoutlog
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
// Contains broken dependency on go.opentelemetry.io/otel/sdk/log/logtest.
|
||||
retract v0.12.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/stdout/stdoutmetric
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.11.1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/exporters/stdout/stdouttrace
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
replace (
|
||||
go.opentelemetry.io/otel => ../../..
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// See the blog post "Deprecating Zipkin Exporter": https://opentelemetry.io/blog/2025/deprecating-zipkin-exporters/
|
||||
module go.opentelemetry.io/otel/exporters/zipkin
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/go-logr/logr v1.4.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/cespare/xxhash/v2 v2.3.0
|
||||
|
||||
@@ -19,16 +19,12 @@ import (
|
||||
|
||||
func TestLoggerConcurrentSafe(t *testing.T) {
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
SetLogger(stdr.New(log.New(io.Discard, "", 0)))
|
||||
}()
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
})
|
||||
wg.Go(func() {
|
||||
Info("")
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Wait()
|
||||
ResetForTest(t)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/internal/tools
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver v1.5.0
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/log
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/go-logr/logr v1.4.3
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/log/logtest
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/google/go-cmp v0.7.0
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/metric
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.11.1
|
||||
|
||||
+12
-24
@@ -98,44 +98,32 @@ func TestWithAttributesConcurrentSafe(*testing.T) {
|
||||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
opt := []AddOption{WithAttributes(attrs...)}
|
||||
_ = NewAddConfig(opt)
|
||||
}()
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
})
|
||||
wg.Go(func() {
|
||||
opt := []AddOption{WithAttributes(attrs...)}
|
||||
_ = NewAddConfig(opt)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
opt := []RecordOption{WithAttributes(attrs...)}
|
||||
_ = NewRecordConfig(opt)
|
||||
}()
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
})
|
||||
wg.Go(func() {
|
||||
opt := []RecordOption{WithAttributes(attrs...)}
|
||||
_ = NewRecordConfig(opt)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
opt := []ObserveOption{WithAttributes(attrs...)}
|
||||
_ = NewObserveConfig(opt)
|
||||
}()
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
})
|
||||
wg.Go(func() {
|
||||
opt := []ObserveOption{WithAttributes(attrs...)}
|
||||
_ = NewObserveConfig(opt)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/schema
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver/v3 v3.4.0
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/sdk
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
replace go.opentelemetry.io/otel => ../
|
||||
|
||||
|
||||
@@ -498,9 +498,7 @@ func TestBatchProcessor(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
var wg sync.WaitGroup
|
||||
for range goRoutines - 1 {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
@@ -511,19 +509,17 @@ func TestBatchProcessor(t *testing.T) {
|
||||
_ = b.ForceFlush(ctx)
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
require.Eventually(t, func() bool {
|
||||
return e.ExportN() > 0
|
||||
}, 2*time.Second, time.Microsecond, "export before shutdown")
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
assert.NoError(t, b.Shutdown(ctx))
|
||||
cancel()
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Wait()
|
||||
})
|
||||
|
||||
@@ -219,15 +219,12 @@ func TestExportSync(t *testing.T) {
|
||||
done := exportSync(in, exp)
|
||||
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
|
||||
wg.Go(func() {
|
||||
in <- exportData{
|
||||
ctx: t.Context(),
|
||||
records: make([]Record, 1),
|
||||
}
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Wait()
|
||||
close(in)
|
||||
@@ -339,9 +336,7 @@ func TestBufferExporter(t *testing.T) {
|
||||
stop := make(chan struct{})
|
||||
var wg sync.WaitGroup
|
||||
for range goRoutines {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for {
|
||||
select {
|
||||
case <-stop:
|
||||
@@ -352,7 +347,7 @@ func TestBufferExporter(t *testing.T) {
|
||||
_ = e.ForceFlush(ctx)
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
assert.Eventually(t, func() bool {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/sdk/log
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/go-logr/logr v1.4.3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/sdk/log/logtest
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.11.1
|
||||
|
||||
@@ -1521,10 +1521,7 @@ func TestRecordMethodsInputConcurrentSafe(t *testing.T) {
|
||||
|
||||
var wg sync.WaitGroup
|
||||
for range 10 {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
|
||||
wg.Go(func() {
|
||||
r := &Record{
|
||||
attributeValueLengthLimit: 10,
|
||||
attributeCountLimit: 4,
|
||||
@@ -1565,7 +1562,7 @@ func TestRecordMethodsInputConcurrentSafe(t *testing.T) {
|
||||
if !gotBody.Equal(wantBody) {
|
||||
t.Errorf("Body does not match.\ngot:\n%v\nwant:\n%v", gotBody, wantBody)
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
||||
@@ -188,12 +188,10 @@ func reservoirConcurrentSafeTest[N int64 | float64](f factory) func(*testing.T)
|
||||
}
|
||||
|
||||
// Also test concurrent Collect calls
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
wg.Go(func() {
|
||||
var dest []Exemplar
|
||||
r.Collect(&dest)
|
||||
wg.Done()
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Wait()
|
||||
|
||||
|
||||
@@ -38,9 +38,7 @@ func TestFixedSizeExemplarConcurrentSafe(t *testing.T) {
|
||||
|
||||
var wg sync.WaitGroup
|
||||
for range goRoutines {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
@@ -49,7 +47,7 @@ func TestFixedSizeExemplarConcurrentSafe(t *testing.T) {
|
||||
require.NotPanics(t, add)
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
const collections = 100
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/sdk/metric
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/go-logr/logr v1.4.3
|
||||
|
||||
@@ -161,15 +161,11 @@ func testAggergationConcurrentSafe[N int64 | float64](
|
||||
{ctx, 3, bob},
|
||||
{ctx, 6, bob},
|
||||
} {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
meas(args.ctx, args.value, args.attr)
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for range 2 {
|
||||
comp(got)
|
||||
// We do not check expected output for each step because
|
||||
@@ -177,7 +173,7 @@ func testAggergationConcurrentSafe[N int64 | float64](
|
||||
// we validate that the output is a valid possible output.
|
||||
validate(t, *got)
|
||||
}
|
||||
}()
|
||||
})
|
||||
wg.Wait()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,11 +22,9 @@ func TestAtomicSumAddFloatConcurrentSafe(t *testing.T) {
|
||||
10.55,
|
||||
42.4,
|
||||
} {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
aSum.add(in)
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
assert.Equal(t, float64(55), math.Round(aSum.load()))
|
||||
@@ -42,11 +40,9 @@ func TestAtomicSumAddIntConcurrentSafe(t *testing.T) {
|
||||
4,
|
||||
5,
|
||||
} {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
aSum.add(in)
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
assert.Equal(t, int64(15), aSum.load())
|
||||
@@ -84,13 +80,11 @@ func TestHotColdWaitGroupConcurrentSafe(t *testing.T) {
|
||||
hcwg := &hotColdWaitGroup{}
|
||||
var data [2]uint64
|
||||
for range 5 {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
hotIdx := hcwg.start()
|
||||
defer hcwg.done(hotIdx)
|
||||
atomic.AddUint64(&data[hotIdx], 1)
|
||||
}()
|
||||
})
|
||||
}
|
||||
for range 2 {
|
||||
readIdx := hcwg.swapHotAndWait()
|
||||
@@ -129,22 +123,16 @@ func testAtomicNConcurrentSafe[N int64 | float64](t *testing.T) {
|
||||
var v atomicN[N]
|
||||
|
||||
for range 2 {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
got := v.Load()
|
||||
assert.Equal(t, int64(0), int64(got)%6)
|
||||
}()
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
})
|
||||
wg.Go(func() {
|
||||
v.Store(12)
|
||||
}()
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
})
|
||||
wg.Go(func() {
|
||||
v.CompareAndSwap(0, 6)
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
@@ -202,11 +190,9 @@ func testAtomicMinMaxConcurrentSafe[N int64 | float64](t *testing.T) {
|
||||
|
||||
assert.False(t, minMax.set.Load())
|
||||
for _, i := range []float64{2, 4, 6, 8, -3, 0, 8, 0} {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
minMax.Update(N(i))
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
|
||||
@@ -37,11 +37,9 @@ func TestConcurrentSafeFilteredReservoir(t *testing.T) {
|
||||
reservoir := NewFilteredExemplarReservoir[int64](exemplar.AlwaysOnFilter, tc.reservoir)
|
||||
var wg sync.WaitGroup
|
||||
for range 5 {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
wg.Go(func() {
|
||||
reservoir.Offer(t.Context(), 25, []attribute.KeyValue{})
|
||||
wg.Done()
|
||||
}()
|
||||
})
|
||||
}
|
||||
into := []exemplar.Exemplar{}
|
||||
for range 2 {
|
||||
|
||||
+14
-28
@@ -86,11 +86,9 @@ func TestPipelineConcurrentSafe(t *testing.T) {
|
||||
var wg sync.WaitGroup
|
||||
const threads = 2
|
||||
for i := range threads {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = pipe.produce(ctx, &output)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func(n int) {
|
||||
@@ -100,15 +98,11 @@ func TestPipelineConcurrentSafe(t *testing.T) {
|
||||
pipe.addSync(instrumentation.Scope{}, sync)
|
||||
}(i)
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
pipe.addMultiCallback(func(context.Context) error { return nil })
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
b := aggregate.Builder[int64]{
|
||||
Temporality: metricdata.CumulativeTemporality,
|
||||
ReservoirFunc: nil,
|
||||
@@ -119,7 +113,7 @@ func TestPipelineConcurrentSafe(t *testing.T) {
|
||||
measures := []aggregate.Measure[int64]{}
|
||||
measures = append(measures, m)
|
||||
pipe.addInt64Measure(oID, measures)
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
@@ -549,35 +543,27 @@ func TestAddingAndObservingMeasureConcurrentSafe(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
wg := sync.WaitGroup{}
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_, err := m.Int64ObservableCounter("int64-observable-counter-2")
|
||||
require.NoError(t, err)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_, err := m.RegisterCallback(
|
||||
func(_ context.Context, o metric.Observer) error {
|
||||
o.ObserveInt64(oc1, 2)
|
||||
return nil
|
||||
}, oc1)
|
||||
require.NoError(t, err)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = mp.pipes[0].produce(t.Context(), &metricdata.ResourceMetrics{})
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = mp.pipes[1].produce(t.Context(), &metricdata.ResourceMetrics{})
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
+10
-20
@@ -147,37 +147,27 @@ func (ts *readerTestSuite) TestMethodConcurrentSafe() {
|
||||
var wg sync.WaitGroup
|
||||
const threads = 2
|
||||
for range threads {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = ts.Reader.temporality(InstrumentKindCounter)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = ts.Reader.aggregation(InstrumentKindCounter)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = ts.Reader.Collect(ctx, &metricdata.ResourceMetrics{})
|
||||
}()
|
||||
})
|
||||
|
||||
if f, ok := ts.Reader.(interface{ ForceFlush(context.Context) error }); ok {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = f.ForceFlush(ctx)
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = ts.Reader.Shutdown(ctx)
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
@@ -825,13 +825,11 @@ func TestResourceConcurrentSafe(t *testing.T) {
|
||||
// because Resources are immutable.
|
||||
var wg sync.WaitGroup
|
||||
for range 2 {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
d := &fakeDetector{}
|
||||
_, err := resource.Detect(t.Context(), d)
|
||||
assert.NoError(t, err)
|
||||
}()
|
||||
})
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
@@ -123,12 +123,10 @@ func NewBatchSpanProcessor(exporter SpanExporter, options ...BatchSpanProcessorO
|
||||
otel.Handle(err)
|
||||
}
|
||||
|
||||
bsp.stopWait.Add(1)
|
||||
go func() {
|
||||
defer bsp.stopWait.Done()
|
||||
bsp.stopWait.Go(func() {
|
||||
bsp.processQueue()
|
||||
bsp.drainQueue()
|
||||
}()
|
||||
})
|
||||
|
||||
return bsp
|
||||
}
|
||||
|
||||
@@ -617,35 +617,25 @@ func TestBatchSpanProcessorConcurrentSafe(t *testing.T) {
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
generateSpan(t, tr, testOption{genNumSpans: 1})
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = bsp.ForceFlush(ctx)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = bsp.Shutdown(ctx)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = tp.ForceFlush(ctx)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
_ = tp.Shutdown(ctx)
|
||||
}()
|
||||
})
|
||||
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/trace
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
replace go.opentelemetry.io/otel => ../
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module go.opentelemetry.io/otel/trace/internal/telemetry/test
|
||||
|
||||
go 1.24.0
|
||||
go 1.25.0
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.11.1
|
||||
|
||||
Reference in New Issue
Block a user