diff --git a/.chloggen/add-adjusted-count-path.yaml b/.chloggen/add-adjusted-count-path.yaml new file mode 100644 index 000000000000..37ba46715693 --- /dev/null +++ b/.chloggen/add-adjusted-count-path.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/ottl + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add the `trace_state.adjusted_count` path in the span context + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [36572] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/connector/countconnector/go.mod b/connector/countconnector/go.mod index 4b3c2841079d..815a90108fa6 100644 --- a/connector/countconnector/go.mod +++ b/connector/countconnector/go.mod @@ -51,6 +51,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.116.1-0.20241220212031-7c2639723f67 // indirect @@ -93,3 +94,5 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index 6ee8e77a49b4..ff39e1ca8261 100644 --- a/connector/datadogconnector/go.mod +++ b/connector/datadogconnector/go.mod @@ -196,6 +196,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/opencontainers/runtime-spec v1.1.0-rc.3 // indirect github.com/openshift/api v3.9.0+incompatible // indirect github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142 // indirect diff --git a/connector/routingconnector/go.mod b/connector/routingconnector/go.mod index 7bc004279abd..6fdeec868f3e 100644 --- a/connector/routingconnector/go.mod +++ b/connector/routingconnector/go.mod @@ -50,6 +50,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.116.1-0.20241220212031-7c2639723f67 // indirect @@ -84,3 +85,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/connector/sumconnector/go.mod b/connector/sumconnector/go.mod index a218b5a893e3..92e6565d72bb 100644 --- a/connector/sumconnector/go.mod +++ b/connector/sumconnector/go.mod @@ -51,6 +51,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.116.1-0.20241220212031-7c2639723f67 // indirect @@ -88,3 +89,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index 63f74077a320..05549f33951a 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -249,6 +249,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.116.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect diff --git a/exporter/elasticsearchexporter/integrationtest/go.mod b/exporter/elasticsearchexporter/integrationtest/go.mod index d2e7135958f6..d5c4feb0af71 100644 --- a/exporter/elasticsearchexporter/integrationtest/go.mod +++ b/exporter/elasticsearchexporter/integrationtest/go.mod @@ -106,6 +106,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.116.0 // indirect @@ -313,3 +314,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/connector/rout replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics => ../../../internal/exp/metrics replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../../../internal/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../../pkg/sampling diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index c1c6408d24f8..10c1efb36af6 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -59,6 +59,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pierrec/lz4/v4 v4.1.22 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rs/cors v1.11.1 // indirect @@ -109,3 +110,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/corei replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/internal/filter/go.mod b/internal/filter/go.mod index 4439f8984ad2..075d4b101bbb 100644 --- a/internal/filter/go.mod +++ b/internal/filter/go.mod @@ -47,6 +47,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.116.1-0.20241220212031-7c2639723f67 // indirect @@ -83,3 +84,5 @@ retract ( replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/pkg/ottl/contexts/internal/span.go b/pkg/ottl/contexts/internal/span.go index 4669adb7b8fe..45f8358aa167 100644 --- a/pkg/ottl/contexts/internal/span.go +++ b/pkg/ottl/contexts/internal/span.go @@ -6,6 +6,7 @@ package internal // import "github.com/open-telemetry/opentelemetry-collector-co import ( "context" "encoding/hex" + "errors" "fmt" "time" @@ -15,6 +16,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/traceutil" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling" ) const ( @@ -63,6 +65,10 @@ func SpanPathGetSetter[K SpanContext](path ottl.Path[K]) (ottl.GetSetter[K], err return accessSpanID[K](), nil case "trace_state": mapKey := path.Keys() + nextPath := path.Next() + if nextPath != nil && nextPath.Name() == "adjusted_count" { + return accessAdjustedCount[K](), nil + } if mapKey == nil { return accessTraceState[K](), nil } @@ -572,3 +578,28 @@ func accessStatusMessage[K SpanContext]() ottl.StandardGetSetter[K] { }, } } + +func accessAdjustedCount[K SpanContext]() ottl.StandardGetSetter[K] { + return ottl.StandardGetSetter[K]{ + Getter: func(_ context.Context, tCtx K) (any, error) { + tracestate := tCtx.GetSpan().TraceState().AsRaw() + w3cTraceState, err := sampling.NewW3CTraceState(tracestate) + if err != nil { + return float64(0), fmt.Errorf("failed to parse w3c tracestate: %w", err) + } + otTraceState := w3cTraceState.OTelValue() + if otTraceState == nil { + // If otel trace state is missing, default to 1 + return float64(1), nil + } + if len(otTraceState.TValue()) == 0 { + // For non-probabilistic sampler OR always sampling threshold, default to 1 + return float64(1), nil + } + return otTraceState.AdjustedCount(), nil + }, + Setter: func(context.Context, K, any) error { + return errors.New("adjusted count cannot be set") + }, + } +} diff --git a/pkg/ottl/contexts/internal/span_test.go b/pkg/ottl/contexts/internal/span_test.go index 899d12493424..888e45b2bbf7 100644 --- a/pkg/ottl/contexts/internal/span_test.go +++ b/pkg/ottl/contexts/internal/span_test.go @@ -10,6 +10,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/ptrace" @@ -40,11 +41,12 @@ func TestSpanPathGetSetter(t *testing.T) { newStatus.SetMessage("new status") tests := []struct { - name string - path ottl.Path[*spanContext] - orig any - newVal any - modified func(span ptrace.Span) + name string + path ottl.Path[*spanContext] + orig any + newVal any + modified func(span ptrace.Span) + expectedSetterErrMsg string }{ { name: "trace_id", @@ -101,7 +103,7 @@ func TestSpanPathGetSetter(t *testing.T) { path: &TestPath[*spanContext]{ N: "trace_state", }, - orig: "key1=val1,key2=val2", + orig: "key1=val1,key2=val2,ot=th:c", newVal: "key=newVal", modified: func(span ptrace.Span) { span.TraceState().FromRaw("key=newVal") @@ -120,9 +122,21 @@ func TestSpanPathGetSetter(t *testing.T) { orig: "val1", newVal: "newVal", modified: func(span ptrace.Span) { - span.TraceState().FromRaw("key1=newVal,key2=val2") + span.TraceState().FromRaw("key1=newVal,key2=val2,ot=th:c") }, }, + { + name: "trace_state adjusted count", + path: &TestPath[*spanContext]{ + N: "trace_state", + NextPath: &TestPath[*spanContext]{ + N: "adjusted_count", + }, + }, + orig: float64(4), + newVal: float64(1), // setters not allowed + expectedSetterErrMsg: "adjusted count cannot be set", + }, { name: "parent_span_id", path: &TestPath[*spanContext]{ @@ -613,6 +627,10 @@ func TestSpanPathGetSetter(t *testing.T) { assert.Equal(t, tt.orig, got) err = accessor.Set(context.Background(), newSpanContext(span), tt.newVal) + if tt.expectedSetterErrMsg != "" { + assert.ErrorContains(t, err, tt.expectedSetterErrMsg) + return + } assert.NoError(t, err) expectedSpan := createSpan() @@ -623,11 +641,47 @@ func TestSpanPathGetSetter(t *testing.T) { } } +func TestAccessAdjustedCount(t *testing.T) { + for _, tc := range []struct { + tracestate string + want float64 + errMsg string + }{ + {tracestate: "", want: 1}, + {tracestate: "invalid=p:8;th:8", want: 1}, // otel trace state nil, default to 1 + {tracestate: "ot=notfound:8", want: 1}, // otel tvalue 0, default to 1 + {tracestate: "ot=404:0", errMsg: "failed to parse"}, // invalid syntax + {tracestate: "ot=th:0", want: 1}, // 100% sampling + {tracestate: "ot=th:8", want: 2}, // 50% sampling + {tracestate: "ot=th:c", want: 4}, // 25% sampling + } { + t.Run("tracestate/"+tc.tracestate, func(t *testing.T) { + span := ptrace.NewSpan() + span.TraceState().FromRaw(tc.tracestate) + + accessor, err := SpanPathGetSetter[*spanContext](&TestPath[*spanContext]{ + N: "trace_state", + NextPath: &TestPath[*spanContext]{ + N: "adjusted_count", + }, + }) + require.NoError(t, err) + got, err := accessor.Get(context.Background(), newSpanContext(span)) + if tc.errMsg != "" { + require.ErrorContains(t, err, tc.errMsg) + return + } + require.NoError(t, err) + assert.Equal(t, tc.want, got) + }) + } +} + func createSpan() ptrace.Span { span := ptrace.NewSpan() span.SetTraceID(traceID) span.SetSpanID(spanID) - span.TraceState().FromRaw("key1=val1,key2=val2") + span.TraceState().FromRaw("key1=val1,key2=val2,ot=th:c") span.SetParentSpanID(spanID2) span.SetName("bear") span.SetKind(ptrace.SpanKindServer) diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index 744aafc8b085..732a73972bbe 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -13,6 +13,7 @@ require ( github.com/iancoleman/strcase v0.3.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.116.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.116.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 github.com/stretchr/testify v1.10.0 github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 go.opentelemetry.io/collector/component v0.116.1-0.20241220212031-7c2639723f67 @@ -69,3 +70,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../sampling diff --git a/processor/attributesprocessor/go.mod b/processor/attributesprocessor/go.mod index 2c7f178138bc..34b33d116661 100644 --- a/processor/attributesprocessor/go.mod +++ b/processor/attributesprocessor/go.mod @@ -52,6 +52,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect @@ -98,3 +99,5 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/processor/cumulativetodeltaprocessor/go.mod b/processor/cumulativetodeltaprocessor/go.mod index f4b714aa6ec7..25c13bce18db 100644 --- a/processor/cumulativetodeltaprocessor/go.mod +++ b/processor/cumulativetodeltaprocessor/go.mod @@ -76,3 +76,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/processor/filterprocessor/go.mod b/processor/filterprocessor/go.mod index 8d3a2c0232dd..bff17b5825eb 100644 --- a/processor/filterprocessor/go.mod +++ b/processor/filterprocessor/go.mod @@ -57,6 +57,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect @@ -96,3 +97,5 @@ retract ( replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/processor/logdedupprocessor/go.mod b/processor/logdedupprocessor/go.mod index a157e20d9c65..beb1ccbcd88d 100644 --- a/processor/logdedupprocessor/go.mod +++ b/processor/logdedupprocessor/go.mod @@ -59,6 +59,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect go.opentelemetry.io/collector/component/componentstatus v0.116.1-0.20241220212031-7c2639723f67 // indirect go.opentelemetry.io/collector/consumer/xconsumer v0.116.1-0.20241220212031-7c2639723f67 // indirect @@ -91,3 +92,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => .. replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/processor/routingprocessor/go.mod b/processor/routingprocessor/go.mod index def9585dbccb..7a93efa65ba2 100644 --- a/processor/routingprocessor/go.mod +++ b/processor/routingprocessor/go.mod @@ -63,6 +63,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/go-grpc-compression v1.2.3 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect go.opentelemetry.io/collector/component/componentstatus v0.116.1-0.20241220212031-7c2639723f67 // indirect @@ -116,3 +117,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/processor/spanprocessor/go.mod b/processor/spanprocessor/go.mod index e117ed5d2856..69e920940a11 100644 --- a/processor/spanprocessor/go.mod +++ b/processor/spanprocessor/go.mod @@ -51,6 +51,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect @@ -96,3 +97,5 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/processor/tailsamplingprocessor/go.mod b/processor/tailsamplingprocessor/go.mod index f5c4bc5fa058..390af6f5a488 100644 --- a/processor/tailsamplingprocessor/go.mod +++ b/processor/tailsamplingprocessor/go.mod @@ -57,6 +57,7 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect go.opentelemetry.io/collector/component/componentstatus v0.116.1-0.20241220212031-7c2639723f67 // indirect @@ -95,3 +96,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filte replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/processor/transformprocessor/go.mod b/processor/transformprocessor/go.mod index ada8210edc27..c86bb8b332a5 100644 --- a/processor/transformprocessor/go.mod +++ b/processor/transformprocessor/go.mod @@ -61,6 +61,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect @@ -103,3 +104,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../../internal/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/receiver/hostmetricsreceiver/go.mod b/receiver/hostmetricsreceiver/go.mod index 12c912704420..630210893e8d 100644 --- a/receiver/hostmetricsreceiver/go.mod +++ b/receiver/hostmetricsreceiver/go.mod @@ -133,3 +133,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata => ../../pkg/experimentalmetricmetadata + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../../pkg/sampling diff --git a/testbed/go.mod b/testbed/go.mod index 237d2bfb184f..bf930485d83c 100644 --- a/testbed/go.mod +++ b/testbed/go.mod @@ -224,6 +224,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.116.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.116.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx v0.116.0 // indirect @@ -440,3 +441,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => .. replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics => ../internal/exp/metrics replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil => ../internal/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling => ../pkg/sampling diff --git a/testbed/go.sum b/testbed/go.sum index 5ff0cf78736d..d23c6bb0da55 100644 --- a/testbed/go.sum +++ b/testbed/go.sum @@ -556,8 +556,6 @@ github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4 github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.104.0 h1:iNr5/wS/0Rg4PnPO2Zf3Yj4Qc1RooVQ/7U7jKzocyPo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.104.0/go.mod h1:4bLfc6BnVKRp3yY+ueEUEeyNWjW/InCGbFs9ZA7o/ko= github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.104.0 h1:W2OartqDicbzoLjAp2MCi+FIt2FBy5PyeYce0kIuerc= github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.104.0/go.mod h1:I2so4Vn+ROaCECo0bdQXNxyUjY9tbq1JvcyuWPETLcM= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=