From 9229e9e76044d58756b025152e94c8ce855ca5ed Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 21 Nov 2022 11:32:58 -0800 Subject: [PATCH] Remove duplicate parse IDs code, avoid coreinternal dependency (#16393) The main reason to do this, is to allow coreinternal/processor/filter* to use ottl. Signed-off-by: Bogdan Drutu Signed-off-by: Bogdan Drutu --- .chloggen/rmdup.yaml | 16 +++++ pkg/ottl/contexts/internal/ottlcommon/ids.go | 46 ++++++++++++ .../contexts/internal/ottlcommon/ids_test.go | 71 +++++++++++++++++++ pkg/ottl/contexts/internal/ottlcommon/span.go | 55 +++++--------- pkg/ottl/contexts/ottllog/log.go | 46 ++++-------- pkg/ottl/go.mod | 9 ++- pkg/ottl/go.sum | 6 ++ processor/routingprocessor/go.mod | 7 -- processor/transformprocessor/go.mod | 5 +- processor/transformprocessor/go.sum | 5 ++ 10 files changed, 180 insertions(+), 86 deletions(-) create mode 100755 .chloggen/rmdup.yaml create mode 100644 pkg/ottl/contexts/internal/ottlcommon/ids.go create mode 100644 pkg/ottl/contexts/internal/ottlcommon/ids_test.go diff --git a/.chloggen/rmdup.yaml b/.chloggen/rmdup.yaml new file mode 100755 index 0000000000000..d78d178e97952 --- /dev/null +++ b/.chloggen/rmdup.yaml @@ -0,0 +1,16 @@ +# 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: Remove duplicate parse IDs code, avoid coreinternal dependency + +# One or more tracking issues related to the change +issues: [16393] + +# (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: The "[trace|span]_id_string" func returns "000..000" string for invalid ids. diff --git a/pkg/ottl/contexts/internal/ottlcommon/ids.go b/pkg/ottl/contexts/internal/ottlcommon/ids.go new file mode 100644 index 0000000000000..c2a9a5871e1ee --- /dev/null +++ b/pkg/ottl/contexts/internal/ottlcommon/ids.go @@ -0,0 +1,46 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ottlcommon // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal/ottlcommon" + +import ( + "encoding/hex" + "errors" + + "go.opentelemetry.io/collector/pdata/pcommon" +) + +func ParseSpanID(spanIDStr string) (pcommon.SpanID, error) { + var id pcommon.SpanID + if hex.DecodedLen(len(spanIDStr)) != len(id) { + return pcommon.SpanID{}, errors.New("span ids must be 16 hex characters") + } + _, err := hex.Decode(id[:], []byte(spanIDStr)) + if err != nil { + return pcommon.SpanID{}, err + } + return id, nil +} + +func ParseTraceID(traceIDStr string) (pcommon.TraceID, error) { + var id pcommon.TraceID + if hex.DecodedLen(len(traceIDStr)) != len(id) { + return pcommon.TraceID{}, errors.New("trace ids must be 32 hex characters") + } + _, err := hex.Decode(id[:], []byte(traceIDStr)) + if err != nil { + return pcommon.TraceID{}, err + } + return id, nil +} diff --git a/pkg/ottl/contexts/internal/ottlcommon/ids_test.go b/pkg/ottl/contexts/internal/ottlcommon/ids_test.go new file mode 100644 index 0000000000000..4e5bf2c5403de --- /dev/null +++ b/pkg/ottl/contexts/internal/ottlcommon/ids_test.go @@ -0,0 +1,71 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ottlcommon + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestParseSpanIDError(t *testing.T) { + tests := []struct { + name string + input string + wantErr string + }{ + { + name: "incorrect size", + input: "0123456789abcde", + wantErr: "span ids must be 16 hex characters", + }, + { + name: "incorrect characters", + input: "0123456789Xbcdef", + wantErr: "encoding/hex: invalid byte: U+0058 'X'", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := ParseSpanID(tt.input) + assert.EqualError(t, err, tt.wantErr) + }) + } +} + +func TestParseTraceIDError(t *testing.T) { + tests := []struct { + name string + input string + wantErr string + }{ + { + name: "incorrect size", + input: "0123456789abcdef0123456789abcde", + wantErr: "trace ids must be 32 hex characters", + }, + { + name: "incorrect characters", + input: "0123456789Xbcdef0123456789abcdef", + wantErr: "encoding/hex: invalid byte: U+0058 'X'", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := ParseTraceID(tt.input) + assert.EqualError(t, err, tt.wantErr) + }) + } +} diff --git a/pkg/ottl/contexts/internal/ottlcommon/span.go b/pkg/ottl/contexts/internal/ottlcommon/span.go index 03a88f35cc715..871d4656f5412 100644 --- a/pkg/ottl/contexts/internal/ottlcommon/span.go +++ b/pkg/ottl/contexts/internal/ottlcommon/span.go @@ -17,7 +17,6 @@ package ottlcommon // import "github.com/open-telemetry/opentelemetry-collector- import ( "context" "encoding/hex" - "errors" "fmt" "time" @@ -25,7 +24,6 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/otel/trace" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/traceutil" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) @@ -148,13 +146,16 @@ func accessTraceID[K SpanContext]() ottl.StandardGetSetter[K] { func accessStringTraceID[K SpanContext]() ottl.StandardGetSetter[K] { return ottl.StandardGetSetter[K]{ Getter: func(ctx context.Context, tCtx K) (interface{}, error) { - return traceutil.TraceIDToHexOrEmptyString(tCtx.GetSpan().TraceID()), nil + id := tCtx.GetSpan().TraceID() + return hex.EncodeToString(id[:]), nil }, Setter: func(ctx context.Context, tCtx K, val interface{}) error { if str, ok := val.(string); ok { - if traceID, err := parseTraceID(str); err == nil { - tCtx.GetSpan().SetTraceID(traceID) + id, err := ParseTraceID(str) + if err != nil { + return err } + tCtx.GetSpan().SetTraceID(id) } return nil }, @@ -178,13 +179,16 @@ func accessSpanID[K SpanContext]() ottl.StandardGetSetter[K] { func accessStringSpanID[K SpanContext]() ottl.StandardGetSetter[K] { return ottl.StandardGetSetter[K]{ Getter: func(ctx context.Context, tCtx K) (interface{}, error) { - return traceutil.SpanIDToHexOrEmptyString(tCtx.GetSpan().SpanID()), nil + id := tCtx.GetSpan().SpanID() + return hex.EncodeToString(id[:]), nil }, Setter: func(ctx context.Context, tCtx K, val interface{}) error { if str, ok := val.(string); ok { - if spanID, err := parseSpanID(str); err == nil { - tCtx.GetSpan().SetSpanID(spanID) + id, err := ParseSpanID(str) + if err != nil { + return err } + tCtx.GetSpan().SetSpanID(id) } return nil }, @@ -243,13 +247,16 @@ func accessParentSpanID[K SpanContext]() ottl.StandardGetSetter[K] { func accessStringParentSpanID[K SpanContext]() ottl.StandardGetSetter[K] { return ottl.StandardGetSetter[K]{ Getter: func(ctx context.Context, tCtx K) (interface{}, error) { - return traceutil.SpanIDToHexOrEmptyString(tCtx.GetSpan().ParentSpanID()), nil + id := tCtx.GetSpan().ParentSpanID() + return hex.EncodeToString(id[:]), nil }, Setter: func(ctx context.Context, tCtx K, val interface{}) error { if str, ok := val.(string); ok { - if spanID, err := parseSpanID(str); err == nil { - tCtx.GetSpan().SetParentSpanID(spanID) + id, err := ParseSpanID(str) + if err != nil { + return err } + tCtx.GetSpan().SetParentSpanID(id) } return nil }, @@ -455,29 +462,3 @@ func accessStatusMessage[K SpanContext]() ottl.StandardGetSetter[K] { }, } } - -func parseSpanID(spanIDStr string) (pcommon.SpanID, error) { - id, err := hex.DecodeString(spanIDStr) - if err != nil { - return pcommon.SpanID{}, err - } - if len(id) != 8 { - return pcommon.SpanID{}, errors.New("span ids must be 8 bytes") - } - var idArr [8]byte - copy(idArr[:8], id) - return pcommon.SpanID(idArr), nil -} - -func parseTraceID(traceIDStr string) (pcommon.TraceID, error) { - id, err := hex.DecodeString(traceIDStr) - if err != nil { - return pcommon.TraceID{}, err - } - if len(id) != 16 { - return pcommon.TraceID{}, errors.New("traces ids must be 16 bytes") - } - var idArr [16]byte - copy(idArr[:16], id) - return pcommon.TraceID(idArr), nil -} diff --git a/pkg/ottl/contexts/ottllog/log.go b/pkg/ottl/contexts/ottllog/log.go index ddfb53bce3b11..fb02607ac5666 100644 --- a/pkg/ottl/contexts/ottllog/log.go +++ b/pkg/ottl/contexts/ottllog/log.go @@ -17,7 +17,6 @@ package ottllog // import "github.com/open-telemetry/opentelemetry-collector-con import ( "context" "encoding/hex" - "errors" "fmt" "time" @@ -25,7 +24,6 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" - "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/ottl/contexts/internal/ottlcommon" ) @@ -292,13 +290,16 @@ func accessTraceID() ottl.StandardGetSetter[TransformContext] { func accessStringTraceID() ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (interface{}, error) { - return traceutil.TraceIDToHexOrEmptyString(tCtx.GetLogRecord().TraceID()), nil + id := tCtx.GetLogRecord().TraceID() + return hex.EncodeToString(id[:]), nil }, Setter: func(ctx context.Context, tCtx TransformContext, val interface{}) error { if str, ok := val.(string); ok { - if traceID, err := parseTraceID(str); err == nil { - tCtx.GetLogRecord().SetTraceID(traceID) + id, err := ottlcommon.ParseTraceID(str) + if err != nil { + return err } + tCtx.GetLogRecord().SetTraceID(id) } return nil }, @@ -322,41 +323,18 @@ func accessSpanID() ottl.StandardGetSetter[TransformContext] { func accessStringSpanID() ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (interface{}, error) { - return traceutil.SpanIDToHexOrEmptyString(tCtx.GetLogRecord().SpanID()), nil + id := tCtx.GetLogRecord().SpanID() + return hex.EncodeToString(id[:]), nil }, Setter: func(ctx context.Context, tCtx TransformContext, val interface{}) error { if str, ok := val.(string); ok { - if spanID, err := parseSpanID(str); err == nil { - tCtx.GetLogRecord().SetSpanID(spanID) + id, err := ottlcommon.ParseSpanID(str) + if err != nil { + return err } + tCtx.GetLogRecord().SetSpanID(id) } return nil }, } } - -func parseSpanID(spanIDStr string) (pcommon.SpanID, error) { - id, err := hex.DecodeString(spanIDStr) - if err != nil { - return pcommon.SpanID{}, err - } - if len(id) != 8 { - return pcommon.SpanID{}, errors.New("span ids must be 8 bytes") - } - var idArr [8]byte - copy(idArr[:8], id) - return pcommon.SpanID(idArr), nil -} - -func parseTraceID(traceIDStr string) (pcommon.TraceID, error) { - id, err := hex.DecodeString(traceIDStr) - if err != nil { - return pcommon.TraceID{}, err - } - if len(id) != 16 { - return pcommon.TraceID{}, errors.New("traces ids must be 16 bytes") - } - var idArr [16]byte - copy(idArr[:16], id) - return pcommon.TraceID(idArr), nil -} diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index edd06bfaed266..47b01400d6ef6 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -6,7 +6,6 @@ require ( github.com/alecthomas/participle/v2 v2.0.0-beta.5 github.com/gobwas/glob v0.2.3 github.com/iancoleman/strcase v0.2.0 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.8.1 go.opentelemetry.io/collector/component v0.0.0-20221119033128-e3509cd9f772 go.opentelemetry.io/collector/pdata v0.64.2-0.20221119033128-e3509cd9f772 @@ -18,18 +17,19 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf v1.4.4 // indirect - github.com/kr/text v0.2.0 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect 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/pelletier/go-toml v1.9.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.6.1 // indirect go.opentelemetry.io/collector v0.64.2-0.20221119033128-e3509cd9f772 // indirect go.opentelemetry.io/collector/consumer v0.0.0-20221119033128-e3509cd9f772 // indirect go.opentelemetry.io/collector/featuregate v0.0.0-20221119033128-e3509cd9f772 // indirect @@ -42,7 +42,6 @@ require ( google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect google.golang.org/grpc v1.50.1 // indirect google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal diff --git a/pkg/ottl/go.sum b/pkg/ottl/go.sum index 34d390eccf8df..bd2c7b24534ca 100644 --- a/pkg/ottl/go.sum +++ b/pkg/ottl/go.sum @@ -52,6 +52,7 @@ github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -161,7 +162,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -208,6 +211,7 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -367,6 +371,7 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -433,6 +438,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/processor/routingprocessor/go.mod b/processor/routingprocessor/go.mod index 661125b71059a..bfcea85d5e333 100644 --- a/processor/routingprocessor/go.mod +++ b/processor/routingprocessor/go.mod @@ -36,7 +36,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/go-grpc-compression v1.1.17 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.0.0-00010101000000-000000000000 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.6.2 // indirect @@ -57,10 +56,4 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/jaegerexporter => ../../exporter/jaegerexporter - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../pkg/translator/jaeger - replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => ../../pkg/ottl diff --git a/processor/transformprocessor/go.mod b/processor/transformprocessor/go.mod index afea80c5a21e7..b05371925ed41 100644 --- a/processor/transformprocessor/go.mod +++ b/processor/transformprocessor/go.mod @@ -21,13 +21,14 @@ require ( github.com/iancoleman/strcase v0.2.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf v1.4.4 // indirect + github.com/kr/text v0.2.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect 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/internal/coreinternal v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rogpeppe/go-internal v1.6.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/featuregate v0.0.0-20221119033128-e3509cd9f772 // indirect go.opentelemetry.io/otel v1.11.1 // indirect @@ -45,6 +46,4 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal - replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl => ../../pkg/ottl diff --git a/processor/transformprocessor/go.sum b/processor/transformprocessor/go.sum index 4525e5155450c..bb70c8d71f6a1 100644 --- a/processor/transformprocessor/go.sum +++ b/processor/transformprocessor/go.sum @@ -37,6 +37,7 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -167,6 +168,7 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -236,6 +238,7 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/rhnvrm/simples3 v0.6.1/go.mod h1:Y+3vYm2V7Y4VijFoJHHTrja6OgPrJ2cBti8dPGkC3sA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= @@ -434,8 +437,10 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=