From b721c099fec020af1bdae72051e52214cac6f368 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Tue, 7 May 2024 12:39:42 +0200 Subject: [PATCH 01/36] initial uri bootstrap --- pkg/ottl/ottlfuncs/func_uri.go | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 pkg/ottl/ottlfuncs/func_uri.go diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go new file mode 100644 index 000000000000..906dc8bc07d4 --- /dev/null +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -0,0 +1,51 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package ottlfuncs // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs" + +import ( + "context" + "fmt" + "net/url" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" +) + +type UriArguments[K any] struct { + URI ottl.StringGetter[K] +} + +func NewUriFactory[K any]() ottl.Factory[K] { + return ottl.NewFactory("Uri", &UriArguments[K]{}, createTimeFunction[K]) +} + +func createUriFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { + args, ok := oArgs.(*UriArguments[K]) + if !ok { + return nil, fmt.Errorf("TimeFactory args must be of type *TimeArguments[K]") + } + + return Uri(args.URI) +} + +func Uri[K any](uriSource ottl.StringGetter[K]) (ottl.ExprFunc[K], error) { + return func(ctx context.Context, tCtx K) (any, error) { + uriString, err := uriSource.Get(ctx, tCtx) + if err != nil { + return nil, err + } + + if uriString == "" { + return nil, fmt.Errorf("uri cannot be nil") + } + + uriParts := make(map[string]string) + + _, err = url.Parse(uriString) + if err != nil { + return nil, err + } + + return uriParts, nil + }, nil +} From 4fa5b2d42832db5ad1d21d04d391de9bc6248a06 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Tue, 7 May 2024 15:09:47 +0200 Subject: [PATCH 02/36] Uri parser for ottl --- pkg/ottl/ottlfuncs/README.md | 38 +++++++ pkg/ottl/ottlfuncs/func_uri.go | 48 +++++++- pkg/ottl/ottlfuncs/func_uri_test.go | 171 ++++++++++++++++++++++++++++ pkg/ottl/ottlfuncs/functions.go | 1 + 4 files changed, 255 insertions(+), 3 deletions(-) create mode 100644 pkg/ottl/ottlfuncs/func_uri_test.go diff --git a/pkg/ottl/ottlfuncs/README.md b/pkg/ottl/ottlfuncs/README.md index 2c6a5b65bdc4..41320ed66714 100644 --- a/pkg/ottl/ottlfuncs/README.md +++ b/pkg/ottl/ottlfuncs/README.md @@ -1281,6 +1281,44 @@ Examples: - `UnixSeconds(Time("02/04/2023", "%m/%d/%Y"))` +### Uri + +`Uri(uri_string)` + +Parses a Uniform Resource Identifier (URI) string and extracts its components as an object. +This URI object includes properties for the URI’s domain, path, fragment, port, query, scheme, user info, username, and password. + +`original`, `domain`, `scheme` and `path` are always present, other are present only if they have corresponding values. + +`uri_string` is a `string`. + +- `Uri("http://www.example.com")` + +results in +``` + "original": "http://www.example.com", + "scheme": "http", + "domain": "www.example.com", + "path": "", +``` + +- `Uri("http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment")` + +results in +``` + "path": "/foo.gif", + "fragment": "fragment", + "extension": "gif", + "password": "mypassword", + "original": "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + "scheme": "http", + "port": 80, + "user_info": "myusername:mypassword", + "domain": "www.example.com", + "query": "key1=val1&key2=val2", + "username": "myusername", +``` + ### UUID `UUID()` diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index 906dc8bc07d4..912180e19ae8 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -7,6 +7,8 @@ import ( "context" "fmt" "net/url" + "strconv" + "strings" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) @@ -16,7 +18,7 @@ type UriArguments[K any] struct { } func NewUriFactory[K any]() ottl.Factory[K] { - return ottl.NewFactory("Uri", &UriArguments[K]{}, createTimeFunction[K]) + return ottl.NewFactory("Uri", &UriArguments[K]{}, createUriFunction[K]) } func createUriFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { @@ -39,13 +41,53 @@ func Uri[K any](uriSource ottl.StringGetter[K]) (ottl.ExprFunc[K], error) { return nil, fmt.Errorf("uri cannot be nil") } - uriParts := make(map[string]string) + uriParts := make(map[string]any) - _, err = url.Parse(uriString) + parsedURI, err := url.Parse(uriString) if err != nil { return nil, err } + // always present fields + uriParts["original"] = uriString + uriParts["domain"] = parsedURI.Hostname() + uriParts["scheme"] = parsedURI.Scheme + uriParts["path"] = parsedURI.Path + + // optional fields included only if populated + if port := parsedURI.Port(); len(port) > 0 { + uriParts["port"], err = strconv.Atoi(port) + if err != nil { + return nil, err + } + } + + if fragment := parsedURI.Fragment; len(fragment) > 0 { + uriParts["fragment"] = fragment + } + + if parsedURI.User != nil { + uriParts["user_info"] = parsedURI.User.String() + + if username := parsedURI.User.Username(); len(username) > 0 { + uriParts["username"] = username + } + + if pwd, isSet := parsedURI.User.Password(); isSet { + uriParts["password"] = pwd + } + } + + if query := parsedURI.RawQuery; len(query) > 0 { + uriParts["query"] = query + } + + if periodIdx := strings.LastIndex(parsedURI.Path, "."); periodIdx != -1 { + if periodIdx < len(parsedURI.Path)-1 { + uriParts["extension"] = parsedURI.Path[periodIdx+1:] + } + } + return uriParts, nil }, nil } diff --git a/pkg/ottl/ottlfuncs/func_uri_test.go b/pkg/ottl/ottlfuncs/func_uri_test.go new file mode 100644 index 000000000000..cbc12fbdb44f --- /dev/null +++ b/pkg/ottl/ottlfuncs/func_uri_test.go @@ -0,0 +1,171 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package ottlfuncs + +import ( + "context" + "testing" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/stretchr/testify/require" +) + +func TestURIParser(t *testing.T) { + testCases := []struct { + Name string + Original string + ExpectedMap map[string]any + }{ + { + "complete example", + "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + map[string]any{ + "path": "/foo.gif", + "fragment": "fragment", + "extension": "gif", + "password": "mypassword", + "original": "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + "scheme": "http", + "port": 80, + "user_info": "myusername:mypassword", + "domain": "www.example.com", + "query": "key1=val1&key2=val2", + "username": "myusername", + }, + }, + { + "simple example", + "http://www.example.com", + map[string]any{ + "original": "http://www.example.com", + "scheme": "http", + "domain": "www.example.com", + "path": "", + }, + }, + { + "custom port", + "http://www.example.com:77", + map[string]any{ + "original": "http://www.example.com:77", + "scheme": "http", + "domain": "www.example.com", + "path": "", + "port": 77, + }, + }, + { + "file", + "http://www.example.com:77/file.png", + map[string]any{ + "original": "http://www.example.com:77/file.png", + "scheme": "http", + "domain": "www.example.com", + "path": "/file.png", + "port": 77, + "extension": "png", + }, + }, + { + "fragment", + "http://www.example.com:77/foo#bar", + map[string]any{ + "original": "http://www.example.com:77/foo#bar", + "scheme": "http", + "domain": "www.example.com", + "path": "/foo", + "port": 77, + "fragment": "bar", + }, + }, + { + "query example", + "https://www.example.com:77/foo?key=val", + map[string]any{ + "original": "https://www.example.com:77/foo?key=val", + "scheme": "https", + "domain": "www.example.com", + "path": "/foo", + "port": 77, + "query": "key=val", + }, + }, + { + "user info", + "https://user:pw@www.example.com:77/foo", + map[string]any{ + "original": "https://user:pw@www.example.com:77/foo", + "scheme": "https", + "domain": "www.example.com", + "path": "/foo", + "port": 77, + "user_info": "user:pw", + "username": "user", + "password": "pw", + }, + }, + { + "user info - no password", + "https://user:@www.example.com:77/foo", + map[string]any{ + "original": "https://user:@www.example.com:77/foo", + "scheme": "https", + "domain": "www.example.com", + "path": "/foo", + "port": 77, + "user_info": "user:", + "username": "user", + "password": "", + }, + }, + { + "non-http scheme: ftp", + "ftp://ftp.is.co.za/rfc/rfc1808.txt", + map[string]any{ + "original": "ftp://ftp.is.co.za/rfc/rfc1808.txt", + "scheme": "ftp", + "path": "/rfc/rfc1808.txt", + "extension": "txt", + "domain": "ftp.is.co.za", + }, + }, + { + "non-http scheme: telnet", + "telnet://192.0.2.16:80/", + map[string]any{ + "original": "telnet://192.0.2.16:80/", + "scheme": "telnet", + "path": "/", + "port": 80, + "domain": "192.0.2.16", + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.Name, func(t *testing.T) { + source := &ottl.StandardStringGetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return tc.Original, nil + }, + } + + exprFunc, err := Uri(source) + require.NoError(t, err) + + res, err := exprFunc(context.Background(), nil) + require.NoError(t, err) + + resMap, ok := res.(map[string]any) + require.True(t, ok) + + require.Equal(t, len(tc.ExpectedMap), len(resMap)) + for k, v := range tc.ExpectedMap { + actualValue, found := resMap[k] + require.True(t, found, "key not found %q", k) + require.Equal(t, v, actualValue) + } + }) + } +} diff --git a/pkg/ottl/ottlfuncs/functions.go b/pkg/ottl/ottlfuncs/functions.go index 23522e9a11fc..bf7595c33163 100644 --- a/pkg/ottl/ottlfuncs/functions.go +++ b/pkg/ottl/ottlfuncs/functions.go @@ -79,5 +79,6 @@ func converters[K any]() []ottl.Factory[K] { NewUnixNanoFactory[K](), NewUnixSecondsFactory[K](), NewUUIDFactory[K](), + NewUriFactory[K](), } } From 44fbc787278d480808fbd3b527b252bf90d5b20d Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Tue, 7 May 2024 15:20:54 +0200 Subject: [PATCH 03/36] changelog --- .chloggen/ottl_uri-parser.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .chloggen/ottl_uri-parser.yaml diff --git a/.chloggen/ottl_uri-parser.yaml b/.chloggen/ottl_uri-parser.yaml new file mode 100644 index 000000000000..dfa117899122 --- /dev/null +++ b/.chloggen/ottl_uri-parser.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: Introducing `Uri` converter parsing URI string into SemConv + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [32433] + +# (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] From 2a75ec2e5e81d76b356e864a5e59eb09f6cbc5dc Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 9 May 2024 09:17:01 +0200 Subject: [PATCH 04/36] Update pkg/ottl/ottlfuncs/README.md Co-authored-by: Tiffany Hrabusa <30397949+tiffany76@users.noreply.github.com> --- pkg/ottl/ottlfuncs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ottl/ottlfuncs/README.md b/pkg/ottl/ottlfuncs/README.md index 41320ed66714..13d33b358f2f 100644 --- a/pkg/ottl/ottlfuncs/README.md +++ b/pkg/ottl/ottlfuncs/README.md @@ -1288,7 +1288,7 @@ Examples: Parses a Uniform Resource Identifier (URI) string and extracts its components as an object. This URI object includes properties for the URI’s domain, path, fragment, port, query, scheme, user info, username, and password. -`original`, `domain`, `scheme` and `path` are always present, other are present only if they have corresponding values. +`original`, `domain`, `scheme`, and `path` are always present. Other properties are present only if they have corresponding values. `uri_string` is a `string`. From 8ad8d9ee7c3f7e356cec4d3865cd7501c49616d5 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 9 May 2024 14:20:16 +0200 Subject: [PATCH 05/36] lint --- pkg/ottl/ottlfuncs/func_uri.go | 14 +++++++------- pkg/ottl/ottlfuncs/functions.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index 912180e19ae8..6502d8016d3d 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -13,24 +13,24 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) -type UriArguments[K any] struct { +type URIArguments[K any] struct { URI ottl.StringGetter[K] } -func NewUriFactory[K any]() ottl.Factory[K] { - return ottl.NewFactory("Uri", &UriArguments[K]{}, createUriFunction[K]) +func NewURIFactory[K any]() ottl.Factory[K] { + return ottl.NewFactory("Uri", &URIArguments[K]{}, createURIFunction[K]) } -func createUriFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { - args, ok := oArgs.(*UriArguments[K]) +func createURIFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { + args, ok := oArgs.(*URIArguments[K]) if !ok { return nil, fmt.Errorf("TimeFactory args must be of type *TimeArguments[K]") } - return Uri(args.URI) + return URI(args.URI) } -func Uri[K any](uriSource ottl.StringGetter[K]) (ottl.ExprFunc[K], error) { +func URI[K any](uriSource ottl.StringGetter[K]) (ottl.ExprFunc[K], error) { return func(ctx context.Context, tCtx K) (any, error) { uriString, err := uriSource.Get(ctx, tCtx) if err != nil { diff --git a/pkg/ottl/ottlfuncs/functions.go b/pkg/ottl/ottlfuncs/functions.go index bf7595c33163..06fda6d6d7c6 100644 --- a/pkg/ottl/ottlfuncs/functions.go +++ b/pkg/ottl/ottlfuncs/functions.go @@ -79,6 +79,6 @@ func converters[K any]() []ottl.Factory[K] { NewUnixNanoFactory[K](), NewUnixSecondsFactory[K](), NewUUIDFactory[K](), - NewUriFactory[K](), + NewURIFactory[K](), } } From 29d1e8bda458d4c585d0f5bcc7578ad0607339b1 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 10 May 2024 09:07:05 +0200 Subject: [PATCH 06/36] Update pkg/ottl/ottlfuncs/func_uri.go Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> --- pkg/ottl/ottlfuncs/func_uri.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index 6502d8016d3d..eb6a6dcaa079 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -24,7 +24,7 @@ func NewURIFactory[K any]() ottl.Factory[K] { func createURIFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { args, ok := oArgs.(*URIArguments[K]) if !ok { - return nil, fmt.Errorf("TimeFactory args must be of type *TimeArguments[K]") + return nil, fmt.Errorf("URIFactory args must be of type *URIArguments[K]") } return URI(args.URI) From bfbe1834ea418f5081a65195058f62ddbadfc51c Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 10 May 2024 09:09:37 +0200 Subject: [PATCH 07/36] Make uri uppercase" --- pkg/ottl/ottlfuncs/README.md | 8 ++++---- pkg/ottl/ottlfuncs/func_uri.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/ottl/ottlfuncs/README.md b/pkg/ottl/ottlfuncs/README.md index 13d33b358f2f..fcbe864e802d 100644 --- a/pkg/ottl/ottlfuncs/README.md +++ b/pkg/ottl/ottlfuncs/README.md @@ -1281,9 +1281,9 @@ Examples: - `UnixSeconds(Time("02/04/2023", "%m/%d/%Y"))` -### Uri +### URI -`Uri(uri_string)` +`URI(uri_string)` Parses a Uniform Resource Identifier (URI) string and extracts its components as an object. This URI object includes properties for the URI’s domain, path, fragment, port, query, scheme, user info, username, and password. @@ -1292,7 +1292,7 @@ This URI object includes properties for the URI’s domain, path, fragment, port `uri_string` is a `string`. -- `Uri("http://www.example.com")` +- `URI("http://www.example.com")` results in ``` @@ -1302,7 +1302,7 @@ results in "path": "", ``` -- `Uri("http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment")` +- `URI("http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment")` results in ``` diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index eb6a6dcaa079..481e7fc79204 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -18,7 +18,7 @@ type URIArguments[K any] struct { } func NewURIFactory[K any]() ottl.Factory[K] { - return ottl.NewFactory("Uri", &URIArguments[K]{}, createURIFunction[K]) + return ottl.NewFactory("URI", &URIArguments[K]{}, createURIFunction[K]) } func createURIFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { From 5bdda14b3a4a305ea562bb9bd83ed0e392886cdf Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 10 May 2024 09:22:13 +0200 Subject: [PATCH 08/36] URI in tests --- pkg/ottl/ottlfuncs/func_uri_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ottl/ottlfuncs/func_uri_test.go b/pkg/ottl/ottlfuncs/func_uri_test.go index cbc12fbdb44f..8694c16bd4e3 100644 --- a/pkg/ottl/ottlfuncs/func_uri_test.go +++ b/pkg/ottl/ottlfuncs/func_uri_test.go @@ -151,7 +151,7 @@ func TestURIParser(t *testing.T) { }, } - exprFunc, err := Uri(source) + exprFunc, err := URI(source) require.NoError(t, err) res, err := exprFunc(context.Background(), nil) From bcd8b490ec2ac9f892a7a3fdf57505428c8025e0 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 10 May 2024 09:39:02 +0200 Subject: [PATCH 09/36] fixed import order for uri tests --- pkg/ottl/ottlfuncs/func_uri_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/ottl/ottlfuncs/func_uri_test.go b/pkg/ottl/ottlfuncs/func_uri_test.go index 8694c16bd4e3..c8638e31cac4 100644 --- a/pkg/ottl/ottlfuncs/func_uri_test.go +++ b/pkg/ottl/ottlfuncs/func_uri_test.go @@ -7,8 +7,9 @@ import ( "context" "testing" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" "github.com/stretchr/testify/require" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) func TestURIParser(t *testing.T) { From 535d6bdeb7872f3a736973cecfbdb164aa53996b Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Wed, 15 May 2024 09:55:43 +0200 Subject: [PATCH 10/36] disable uri to URI lint for func_uri --- pkg/ottl/ottlfuncs/func_uri.go | 4 ++-- pkg/ottl/ottlfuncs/func_uri_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index 481e7fc79204..27fabce573d6 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -27,10 +27,10 @@ func createURIFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ott return nil, fmt.Errorf("URIFactory args must be of type *URIArguments[K]") } - return URI(args.URI) + return uri(args.URI) //revive:disable-line:var-naming } -func URI[K any](uriSource ottl.StringGetter[K]) (ottl.ExprFunc[K], error) { +func uri[K any](uriSource ottl.StringGetter[K]) (ottl.ExprFunc[K], error) { //revive:disable-line:var-naming return func(ctx context.Context, tCtx K) (any, error) { uriString, err := uriSource.Get(ctx, tCtx) if err != nil { diff --git a/pkg/ottl/ottlfuncs/func_uri_test.go b/pkg/ottl/ottlfuncs/func_uri_test.go index c8638e31cac4..b3ac318f874e 100644 --- a/pkg/ottl/ottlfuncs/func_uri_test.go +++ b/pkg/ottl/ottlfuncs/func_uri_test.go @@ -152,7 +152,7 @@ func TestURIParser(t *testing.T) { }, } - exprFunc, err := URI(source) + exprFunc, err := uri(source) //revive:disable-line:var-naming require.NoError(t, err) res, err := exprFunc(context.Background(), nil) From 7bd764db8062704d92f8475c8d036be3d7c45776 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Wed, 15 May 2024 10:50:41 +0200 Subject: [PATCH 11/36] fix error is always nil check --- pkg/ottl/ottlfuncs/func_uri.go | 6 +++--- pkg/ottl/ottlfuncs/func_uri_test.go | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index 27fabce573d6..b5786aa635f7 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -27,10 +27,10 @@ func createURIFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ott return nil, fmt.Errorf("URIFactory args must be of type *URIArguments[K]") } - return uri(args.URI) //revive:disable-line:var-naming + return uri(args.URI), nil //revive:disable-line:var-naming } -func uri[K any](uriSource ottl.StringGetter[K]) (ottl.ExprFunc[K], error) { //revive:disable-line:var-naming +func uri[K any](uriSource ottl.StringGetter[K]) ottl.ExprFunc[K] { //revive:disable-line:var-naming return func(ctx context.Context, tCtx K) (any, error) { uriString, err := uriSource.Get(ctx, tCtx) if err != nil { @@ -89,5 +89,5 @@ func uri[K any](uriSource ottl.StringGetter[K]) (ottl.ExprFunc[K], error) { //re } return uriParts, nil - }, nil + } } diff --git a/pkg/ottl/ottlfuncs/func_uri_test.go b/pkg/ottl/ottlfuncs/func_uri_test.go index b3ac318f874e..4154d3758938 100644 --- a/pkg/ottl/ottlfuncs/func_uri_test.go +++ b/pkg/ottl/ottlfuncs/func_uri_test.go @@ -152,9 +152,7 @@ func TestURIParser(t *testing.T) { }, } - exprFunc, err := uri(source) //revive:disable-line:var-naming - require.NoError(t, err) - + exprFunc := uri(source) //revive:disable-line:var-naming res, err := exprFunc(context.Background(), nil) require.NoError(t, err) From 6bc8e8f315639ad48ddf56e061686c6b8615726a Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Sun, 26 May 2024 08:06:20 +0200 Subject: [PATCH 12/36] saved functions.go file --- pkg/ottl/ottlfuncs/functions.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/ottl/ottlfuncs/functions.go b/pkg/ottl/ottlfuncs/functions.go index 47ba9c992664..6c686f6bc375 100644 --- a/pkg/ottl/ottlfuncs/functions.go +++ b/pkg/ottl/ottlfuncs/functions.go @@ -81,10 +81,7 @@ func converters[K any]() []ottl.Factory[K] { NewUnixNanoFactory[K](), NewUnixSecondsFactory[K](), NewUUIDFactory[K](), -<<<<<<< HEAD NewURIFactory[K](), -======= NewYearFactory[K](), ->>>>>>> 4fad28787f74a96ff8fca1ea86d4fdbaf18304f5 } } From 8f4b7ae7969cf5a3211ce3d298afec32d95a9335 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Tue, 11 Jun 2024 09:11:27 +0200 Subject: [PATCH 13/36] resolved conflicts in functions.go --- pkg/ottl/ottlfuncs/functions.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/ottl/ottlfuncs/functions.go b/pkg/ottl/ottlfuncs/functions.go index 0a6abfddeaa9..9ff7a407bb1a 100644 --- a/pkg/ottl/ottlfuncs/functions.go +++ b/pkg/ottl/ottlfuncs/functions.go @@ -83,11 +83,8 @@ func converters[K any]() []ottl.Factory[K] { NewUnixNanoFactory[K](), NewUnixSecondsFactory[K](), NewUUIDFactory[K](), -<<<<<<< HEAD NewURIFactory[K](), -======= NewAppendFactory[K](), ->>>>>>> 9396cd83e08de3a1d368d799e4b37aa6104fddbf NewYearFactory[K](), } } From 395fe2c4d89f838b8d29d7fcd1f8997e0e22e602 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Tue, 11 Jun 2024 18:45:17 +0200 Subject: [PATCH 14/36] replace hardcoded strings with ottl convention --- pkg/ottl/go.mod | 1 + pkg/ottl/go.sum | 2 + pkg/ottl/ottlfuncs/func_uri.go | 30 ++++--- pkg/ottl/ottlfuncs/func_uri_test.go | 129 ++++++++++++++-------------- 4 files changed, 87 insertions(+), 75 deletions(-) diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index 783bcb55f020..bf441ffa8176 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -13,6 +13,7 @@ require ( github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.2-0.20240606174409-6888f8f7a45f go.opentelemetry.io/collector/pdata v1.9.1-0.20240606174409-6888f8f7a45f + go.opentelemetry.io/collector/semconv v0.102.2-0.20240606174409-6888f8f7a45f go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 diff --git a/pkg/ottl/go.sum b/pkg/ottl/go.sum index d54637b29bae..50a7a839c0f2 100644 --- a/pkg/ottl/go.sum +++ b/pkg/ottl/go.sum @@ -66,6 +66,8 @@ go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240606174409-6 go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240606174409-6888f8f7a45f/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= go.opentelemetry.io/collector/pdata v1.9.1-0.20240606174409-6888f8f7a45f h1:ZSmt73uc+xxFHuryi4G1qh3VMx069JJGxfRLgIpaOHM= go.opentelemetry.io/collector/pdata v1.9.1-0.20240606174409-6888f8f7a45f/go.mod h1:vk7LrfpyVpGZrRWcpjyy0DDZzL3SZiYMQxfap25551w= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240606174409-6888f8f7a45f h1:e3QizVBHcpg13Sp9/ZvnZGcWP7VSKD+aNOw+vNyRczw= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240606174409-6888f8f7a45f/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index b5786aa635f7..665ab464d9cb 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -11,6 +11,14 @@ import ( "strings" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + semconv "go.opentelemetry.io/collector/semconv/v1.25.0" +) + +const ( + // replace once conventions includes these + AttributeURLUserInfo = "url.user_info" + AttributeURLUsername = "url.username" + AttributeURLPassword = "url.password" ) type URIArguments[K any] struct { @@ -49,42 +57,42 @@ func uri[K any](uriSource ottl.StringGetter[K]) ottl.ExprFunc[K] { //revive:disa } // always present fields - uriParts["original"] = uriString - uriParts["domain"] = parsedURI.Hostname() - uriParts["scheme"] = parsedURI.Scheme - uriParts["path"] = parsedURI.Path + uriParts[semconv.AttributeURLOriginal] = uriString + uriParts[semconv.AttributeURLDomain] = parsedURI.Hostname() + uriParts[semconv.AttributeURLScheme] = parsedURI.Scheme + uriParts[semconv.AttributeURLPath] = parsedURI.Path // optional fields included only if populated if port := parsedURI.Port(); len(port) > 0 { - uriParts["port"], err = strconv.Atoi(port) + uriParts[semconv.AttributeURLPort], err = strconv.Atoi(port) if err != nil { return nil, err } } if fragment := parsedURI.Fragment; len(fragment) > 0 { - uriParts["fragment"] = fragment + uriParts[semconv.AttributeURLFragment] = fragment } if parsedURI.User != nil { - uriParts["user_info"] = parsedURI.User.String() + uriParts[AttributeURLUserInfo] = parsedURI.User.String() if username := parsedURI.User.Username(); len(username) > 0 { - uriParts["username"] = username + uriParts[AttributeURLUsername] = username } if pwd, isSet := parsedURI.User.Password(); isSet { - uriParts["password"] = pwd + uriParts[AttributeURLPassword] = pwd } } if query := parsedURI.RawQuery; len(query) > 0 { - uriParts["query"] = query + uriParts[semconv.AttributeURLQuery] = query } if periodIdx := strings.LastIndex(parsedURI.Path, "."); periodIdx != -1 { if periodIdx < len(parsedURI.Path)-1 { - uriParts["extension"] = parsedURI.Path[periodIdx+1:] + uriParts[semconv.AttributeURLExtension] = parsedURI.Path[periodIdx+1:] } } diff --git a/pkg/ottl/ottlfuncs/func_uri_test.go b/pkg/ottl/ottlfuncs/func_uri_test.go index 4154d3758938..877c48f55ab4 100644 --- a/pkg/ottl/ottlfuncs/func_uri_test.go +++ b/pkg/ottl/ottlfuncs/func_uri_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/stretchr/testify/require" + semconv "go.opentelemetry.io/collector/semconv/v1.25.0" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) @@ -22,124 +23,124 @@ func TestURIParser(t *testing.T) { "complete example", "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", map[string]any{ - "path": "/foo.gif", - "fragment": "fragment", - "extension": "gif", - "password": "mypassword", - "original": "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", - "scheme": "http", - "port": 80, - "user_info": "myusername:mypassword", - "domain": "www.example.com", - "query": "key1=val1&key2=val2", - "username": "myusername", + semconv.AttributeURLPath: "/foo.gif", + semconv.AttributeURLFragment: "fragment", + semconv.AttributeURLExtension: "gif", + AttributeURLPassword: "mypassword", + semconv.AttributeURLOriginal: "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLPort: 80, + AttributeURLUserInfo: "myusername:mypassword", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLQuery: "key1=val1&key2=val2", + AttributeURLUsername: "myusername", }, }, { "simple example", "http://www.example.com", map[string]any{ - "original": "http://www.example.com", - "scheme": "http", - "domain": "www.example.com", - "path": "", + semconv.AttributeURLOriginal: "http://www.example.com", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "", }, }, { "custom port", "http://www.example.com:77", map[string]any{ - "original": "http://www.example.com:77", - "scheme": "http", - "domain": "www.example.com", - "path": "", - "port": 77, + semconv.AttributeURLOriginal: "http://www.example.com:77", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "", + semconv.AttributeURLPort: 77, }, }, { "file", "http://www.example.com:77/file.png", map[string]any{ - "original": "http://www.example.com:77/file.png", - "scheme": "http", - "domain": "www.example.com", - "path": "/file.png", - "port": 77, - "extension": "png", + semconv.AttributeURLOriginal: "http://www.example.com:77/file.png", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/file.png", + semconv.AttributeURLPort: 77, + semconv.AttributeURLExtension: "png", }, }, { "fragment", "http://www.example.com:77/foo#bar", map[string]any{ - "original": "http://www.example.com:77/foo#bar", - "scheme": "http", - "domain": "www.example.com", - "path": "/foo", - "port": 77, - "fragment": "bar", + semconv.AttributeURLOriginal: "http://www.example.com:77/foo#bar", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + semconv.AttributeURLFragment: "bar", }, }, { "query example", "https://www.example.com:77/foo?key=val", map[string]any{ - "original": "https://www.example.com:77/foo?key=val", - "scheme": "https", - "domain": "www.example.com", - "path": "/foo", - "port": 77, - "query": "key=val", + semconv.AttributeURLOriginal: "https://www.example.com:77/foo?key=val", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + semconv.AttributeURLQuery: "key=val", }, }, { "user info", "https://user:pw@www.example.com:77/foo", map[string]any{ - "original": "https://user:pw@www.example.com:77/foo", - "scheme": "https", - "domain": "www.example.com", - "path": "/foo", - "port": 77, - "user_info": "user:pw", - "username": "user", - "password": "pw", + semconv.AttributeURLOriginal: "https://user:pw@www.example.com:77/foo", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + AttributeURLUserInfo: "user:pw", + AttributeURLUsername: "user", + AttributeURLPassword: "pw", }, }, { "user info - no password", "https://user:@www.example.com:77/foo", map[string]any{ - "original": "https://user:@www.example.com:77/foo", - "scheme": "https", - "domain": "www.example.com", - "path": "/foo", - "port": 77, - "user_info": "user:", - "username": "user", - "password": "", + semconv.AttributeURLOriginal: "https://user:@www.example.com:77/foo", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + AttributeURLUserInfo: "user:", + AttributeURLUsername: "user", + AttributeURLPassword: "", }, }, { "non-http scheme: ftp", "ftp://ftp.is.co.za/rfc/rfc1808.txt", map[string]any{ - "original": "ftp://ftp.is.co.za/rfc/rfc1808.txt", - "scheme": "ftp", - "path": "/rfc/rfc1808.txt", - "extension": "txt", - "domain": "ftp.is.co.za", + semconv.AttributeURLOriginal: "ftp://ftp.is.co.za/rfc/rfc1808.txt", + semconv.AttributeURLScheme: "ftp", + semconv.AttributeURLPath: "/rfc/rfc1808.txt", + semconv.AttributeURLExtension: "txt", + semconv.AttributeURLDomain: "ftp.is.co.za", }, }, { "non-http scheme: telnet", "telnet://192.0.2.16:80/", map[string]any{ - "original": "telnet://192.0.2.16:80/", - "scheme": "telnet", - "path": "/", - "port": 80, - "domain": "192.0.2.16", + semconv.AttributeURLOriginal: "telnet://192.0.2.16:80/", + semconv.AttributeURLScheme: "telnet", + semconv.AttributeURLPath: "/", + semconv.AttributeURLPort: 80, + semconv.AttributeURLDomain: "192.0.2.16", }, }, } From ec00160a89bf284f8d2075435b8af52210660023 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Wed, 12 Jun 2024 18:01:18 +0200 Subject: [PATCH 15/36] govulncheck issue addressed --- processor/routingprocessor/go.mod | 1 + processor/routingprocessor/go.sum | 2 ++ 2 files changed, 3 insertions(+) diff --git a/processor/routingprocessor/go.mod b/processor/routingprocessor/go.mod index 0dcc1483d456..40e9e5e1ddff 100644 --- a/processor/routingprocessor/go.mod +++ b/processor/routingprocessor/go.mod @@ -68,6 +68,7 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.1-0.20240606174409-6888f8f7a45f // indirect go.opentelemetry.io/collector/pdata/testdata v0.102.2-0.20240606174409-6888f8f7a45f // indirect go.opentelemetry.io/collector/receiver v0.102.2-0.20240606174409-6888f8f7a45f // indirect + go.opentelemetry.io/collector/semconv v0.102.2-0.20240606174409-6888f8f7a45f // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/sdk v1.27.0 // indirect diff --git a/processor/routingprocessor/go.sum b/processor/routingprocessor/go.sum index 28a2e9234d29..4ce021715bdb 100644 --- a/processor/routingprocessor/go.sum +++ b/processor/routingprocessor/go.sum @@ -130,6 +130,8 @@ go.opentelemetry.io/collector/processor v0.102.2-0.20240606174409-6888f8f7a45f h go.opentelemetry.io/collector/processor v0.102.2-0.20240606174409-6888f8f7a45f/go.mod h1:3T8gH0qvKK3lhVL1Va0JdLNZvcqCstC4U+5iIg0bgCI= go.opentelemetry.io/collector/receiver v0.102.2-0.20240606174409-6888f8f7a45f h1:VtkWNIWgYGNplMa3dNKwLIbB95jaHqigD9QvaDDggzk= go.opentelemetry.io/collector/receiver v0.102.2-0.20240606174409-6888f8f7a45f/go.mod h1:jxMmi2G3dSBhhAqnn+0bT+GC+3n47P6VyD0KTnr/NeQ= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240606174409-6888f8f7a45f h1:e3QizVBHcpg13Sp9/ZvnZGcWP7VSKD+aNOw+vNyRczw= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240606174409-6888f8f7a45f/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/contrib/config v0.7.0 h1:b1rK5tGTuhhPirJiMxOcyQfZs76j2VapY6ODn3b2Dbs= go.opentelemetry.io/contrib/config v0.7.0/go.mod h1:8tdiFd8N5etOi3XzBmAoMxplEzI3TcL8dU5rM5/xcOQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 h1:vS1Ao/R55RNV4O7TA2Qopok8yN+X0LIP6RVWLFkprck= From 52b4c42d7b41f42e4c7288e77f6fb37a279f0167 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 13 Jun 2024 09:52:18 +0200 Subject: [PATCH 16/36] fixed go.mod for countconnector --- connector/countconnector/go.mod | 1 + connector/countconnector/go.sum | 2 ++ 2 files changed, 3 insertions(+) diff --git a/connector/countconnector/go.mod b/connector/countconnector/go.mod index 1eb2789d91dc..7d981561b7cf 100644 --- a/connector/countconnector/go.mod +++ b/connector/countconnector/go.mod @@ -49,6 +49,7 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/sdk v1.27.0 // indirect diff --git a/connector/countconnector/go.sum b/connector/countconnector/go.sum index cf697f414d9a..723e59ee9ed7 100644 --- a/connector/countconnector/go.sum +++ b/connector/countconnector/go.sum @@ -90,6 +90,8 @@ go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c h1:f8L2 go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4EegmtiSaOuh6wXWatKIui8xU= go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= From 5eb0620895a44bea8234839bd8e0629856b85386 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 13 Jun 2024 10:23:48 +0200 Subject: [PATCH 17/36] indirect semconv --- cmd/otelcontribcol/go.mod | 1 + connector/routingconnector/go.mod | 1 + connector/routingconnector/go.sum | 2 ++ exporter/honeycombmarkerexporter/go.mod | 1 + exporter/honeycombmarkerexporter/go.sum | 2 ++ processor/tailsamplingprocessor/go.mod | 1 + processor/tailsamplingprocessor/go.sum | 2 ++ processor/transformprocessor/go.mod | 1 + processor/transformprocessor/go.sum | 2 ++ 9 files changed, 13 insertions(+) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 89c64f749517..4408fba3bcdf 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -630,6 +630,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 // indirect + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.102.0 // indirect diff --git a/connector/routingconnector/go.mod b/connector/routingconnector/go.mod index 1dc3704edac9..7d83813c0d2b 100644 --- a/connector/routingconnector/go.mod +++ b/connector/routingconnector/go.mod @@ -44,6 +44,7 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/sdk v1.27.0 // indirect diff --git a/connector/routingconnector/go.sum b/connector/routingconnector/go.sum index 3c34c72879c3..749cea76c6a0 100644 --- a/connector/routingconnector/go.sum +++ b/connector/routingconnector/go.sum @@ -90,6 +90,8 @@ go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c h1:f8L2 go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4EegmtiSaOuh6wXWatKIui8xU= go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index 1ee7b2447088..541b2aa78dff 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -13,6 +13,7 @@ require ( go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/exporter v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index a5af3d1a6c34..4fcbb052b58f 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -126,6 +126,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0 h1:9l89oX4ba9kHbBol3Xin3leYJ+252h0zszDtBwyKe2A= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.52.0/go.mod h1:XLZfZboOJWHNKUv7eH0inh0E9VV6eWDFB/9yJyTLPp0= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= diff --git a/processor/tailsamplingprocessor/go.mod b/processor/tailsamplingprocessor/go.mod index 74b7fe3709a0..7f777e050b81 100644 --- a/processor/tailsamplingprocessor/go.mod +++ b/processor/tailsamplingprocessor/go.mod @@ -16,6 +16,7 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/processor v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/sdk/metric v1.27.0 diff --git a/processor/tailsamplingprocessor/go.sum b/processor/tailsamplingprocessor/go.sum index 0e79d9228e4a..966be72d3d25 100644 --- a/processor/tailsamplingprocessor/go.sum +++ b/processor/tailsamplingprocessor/go.sum @@ -94,6 +94,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.2-0.20240611143128-7dfb57b9a go.opentelemetry.io/collector/pdata/testdata v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:czLc/oKlriUYBB6EZbPLIhWMKaG4viHtxflaSDMjnxg= go.opentelemetry.io/collector/processor v0.102.2-0.20240611143128-7dfb57b9ad1c h1:SufVomDf8sHj3SMlKcCT5qJh/weXHlacQ8QDby7IFOM= go.opentelemetry.io/collector/processor v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:81izr5ORy0YdzmhelV5fRUJvV8ElmeodxToRpL0cocY= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/processor/transformprocessor/go.mod b/processor/transformprocessor/go.mod index 874a4ebdf9e5..f28a47b5eed0 100644 --- a/processor/transformprocessor/go.mod +++ b/processor/transformprocessor/go.mod @@ -14,6 +14,7 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/processor v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/processor/transformprocessor/go.sum b/processor/transformprocessor/go.sum index c7367253be38..24029778d96b 100644 --- a/processor/transformprocessor/go.sum +++ b/processor/transformprocessor/go.sum @@ -94,6 +94,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.2-0.20240611143128-7dfb57b9a go.opentelemetry.io/collector/pdata/testdata v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:czLc/oKlriUYBB6EZbPLIhWMKaG4viHtxflaSDMjnxg= go.opentelemetry.io/collector/processor v0.102.2-0.20240611143128-7dfb57b9ad1c h1:SufVomDf8sHj3SMlKcCT5qJh/weXHlacQ8QDby7IFOM= go.opentelemetry.io/collector/processor v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:81izr5ORy0YdzmhelV5fRUJvV8ElmeodxToRpL0cocY= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= From d204d4a671e603c394f4c7dfc51a96c35ecad32a Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 13 Jun 2024 10:49:05 +0200 Subject: [PATCH 18/36] lint --- cmd/otelcontribcol/go.mod | 1 - pkg/ottl/ottlfuncs/func_uri.go | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index 4408fba3bcdf..89c64f749517 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -630,7 +630,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 // indirect - go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.102.0 // indirect diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index 665ab464d9cb..74d0d6b8e77e 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -10,8 +10,9 @@ import ( "strconv" "strings" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" semconv "go.opentelemetry.io/collector/semconv/v1.25.0" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) const ( From db455ead32997108ca3722dcd31e8b112761bf10 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 13 Jun 2024 12:04:59 +0200 Subject: [PATCH 19/36] move logic to stanza uri parser --- pkg/ottl/go.mod | 13 ++ pkg/ottl/go.sum | 24 +++ pkg/ottl/ottlfuncs/func_uri.go | 62 +------ pkg/ottl/ottlfuncs/func_uri_test.go | 7 + pkg/stanza/go.mod | 1 + pkg/stanza/go.sum | 2 + pkg/stanza/operator/parser/uri/parser.go | 98 ++++++++++- pkg/stanza/operator/parser/uri/parser_test.go | 154 +++++++++++++++++- 8 files changed, 291 insertions(+), 70 deletions(-) diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index 08abab513060..c24c5433d763 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -10,6 +10,7 @@ require ( github.com/json-iterator/go v1.1.12 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.102.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c @@ -25,9 +26,17 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/knadh/koanf/providers/confmap v0.1.0 // indirect + github.com/knadh/koanf/v2 v2.1.1 // indirect + github.com/mitchellh/copystructure v1.2.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/pkg/pdatautil v0.102.0 // indirect @@ -37,6 +46,8 @@ require ( github.com/prometheus/common v0.54.0 // indirect github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect + go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect + go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect @@ -64,3 +75,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/stanza => ../stanza diff --git a/pkg/ottl/go.sum b/pkg/ottl/go.sum index 2dbe86234179..542630e1a5ba 100644 --- a/pkg/ottl/go.sum +++ b/pkg/ottl/go.sum @@ -11,11 +11,15 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -25,6 +29,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -33,10 +39,20 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= +github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= +github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= +github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= +github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= +github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -55,6 +71,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -64,6 +82,10 @@ go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c h go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:AM5c/Ohhxj2j/vfCZrwKUD7PrcMpuCbo68rSBibV9U4= go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c h1:biIHEgJgIFabkzjRrxyiGs3ZyoJ8jPiJyU8dorKaPWg= go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= +go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c h1:LOhGPowRmdpv7HU6HAFkdRvys41RWaijhGmWa7YBOsg= +go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:KgpS7UxH5rkd69CzAzlY2I1heH8Z7eNCZlHmwQBMxNg= +go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c h1:NL1/iU+6NoZZLxnPMgiML/d5nuYjokRKhSs/+YXkTHs= +go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c h1:f8L2r0f684bJAAZDoTvEWccx34C3kQsePNwy8KzTPqM= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= @@ -128,5 +150,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index 74d0d6b8e77e..79b089e54f4d 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -6,20 +6,9 @@ package ottlfuncs // import "github.com/open-telemetry/opentelemetry-collector-c import ( "context" "fmt" - "net/url" - "strconv" - "strings" - - semconv "go.opentelemetry.io/collector/semconv/v1.25.0" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" -) - -const ( - // replace once conventions includes these - AttributeURLUserInfo = "url.user_info" - AttributeURLUsername = "url.username" - AttributeURLPassword = "url.password" + uriparser "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/uri" ) type URIArguments[K any] struct { @@ -50,53 +39,6 @@ func uri[K any](uriSource ottl.StringGetter[K]) ottl.ExprFunc[K] { //revive:disa return nil, fmt.Errorf("uri cannot be nil") } - uriParts := make(map[string]any) - - parsedURI, err := url.Parse(uriString) - if err != nil { - return nil, err - } - - // always present fields - uriParts[semconv.AttributeURLOriginal] = uriString - uriParts[semconv.AttributeURLDomain] = parsedURI.Hostname() - uriParts[semconv.AttributeURLScheme] = parsedURI.Scheme - uriParts[semconv.AttributeURLPath] = parsedURI.Path - - // optional fields included only if populated - if port := parsedURI.Port(); len(port) > 0 { - uriParts[semconv.AttributeURLPort], err = strconv.Atoi(port) - if err != nil { - return nil, err - } - } - - if fragment := parsedURI.Fragment; len(fragment) > 0 { - uriParts[semconv.AttributeURLFragment] = fragment - } - - if parsedURI.User != nil { - uriParts[AttributeURLUserInfo] = parsedURI.User.String() - - if username := parsedURI.User.Username(); len(username) > 0 { - uriParts[AttributeURLUsername] = username - } - - if pwd, isSet := parsedURI.User.Password(); isSet { - uriParts[AttributeURLPassword] = pwd - } - } - - if query := parsedURI.RawQuery; len(query) > 0 { - uriParts[semconv.AttributeURLQuery] = query - } - - if periodIdx := strings.LastIndex(parsedURI.Path, "."); periodIdx != -1 { - if periodIdx < len(parsedURI.Path)-1 { - uriParts[semconv.AttributeURLExtension] = parsedURI.Path[periodIdx+1:] - } - } - - return uriParts, nil + return uriparser.ParseURI(uriString, true) } } diff --git a/pkg/ottl/ottlfuncs/func_uri_test.go b/pkg/ottl/ottlfuncs/func_uri_test.go index 877c48f55ab4..8e0a45fd9d2f 100644 --- a/pkg/ottl/ottlfuncs/func_uri_test.go +++ b/pkg/ottl/ottlfuncs/func_uri_test.go @@ -13,6 +13,13 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) +const ( + // replace once conventions includes these + AttributeURLUserInfo = "url.user_info" + AttributeURLUsername = "url.username" + AttributeURLPassword = "url.password" +) + func TestURIParser(t *testing.T) { testCases := []struct { Name string diff --git a/pkg/stanza/go.mod b/pkg/stanza/go.mod index 3bff75cf97f3..7ec689c87c90 100644 --- a/pkg/stanza/go.mod +++ b/pkg/stanza/go.mod @@ -23,6 +23,7 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/otel/metric v1.27.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 diff --git a/pkg/stanza/go.sum b/pkg/stanza/go.sum index ff061ed75eb6..cd36da4fdf87 100644 --- a/pkg/stanza/go.sum +++ b/pkg/stanza/go.sum @@ -105,6 +105,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/pkg/stanza/operator/parser/uri/parser.go b/pkg/stanza/operator/parser/uri/parser.go index e7761239cbbc..e6b271fb2ace 100644 --- a/pkg/stanza/operator/parser/uri/parser.go +++ b/pkg/stanza/operator/parser/uri/parser.go @@ -7,12 +7,36 @@ import ( "context" "fmt" "net/url" + "strconv" "strings" + semconv "go.opentelemetry.io/collector/semconv/v1.25.0" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper" + "go.opentelemetry.io/collector/featuregate" ) +const semconvCompliantFeatureGateID = "parser.uri.ecscompliant" + +const ( + // replace once conventions includes these + AttributeURLUserInfo = "url.user_info" + AttributeURLUsername = "url.username" + AttributeURLPassword = "url.password" +) + +var semconvCompliantFeatureGate *featuregate.Gate + +func init() { + semconvCompliantFeatureGate = featuregate.GlobalRegistry().MustRegister( + semconvCompliantFeatureGateID, + featuregate.StageAlpha, + featuregate.WithRegisterDescription("When enabled resulting map will be in semconv compliant format."), + featuregate.WithRegisterFromVersion("0.103.0"), + ) +} + // Parser is an operator that parses a uri. type Parser struct { helper.ParserOperator @@ -27,14 +51,14 @@ func (p *Parser) Process(ctx context.Context, entry *entry.Entry) error { func (p *Parser) parse(value any) (any, error) { switch m := value.(type) { case string: - return parseURI(m) + return ParseURI(m, semconvCompliantFeatureGate.IsEnabled()) default: return nil, fmt.Errorf("type '%T' cannot be parsed as URI", value) } } // parseURI takes an absolute or relative uri and returns the parsed values. -func parseURI(value string) (map[string]any, error) { +func ParseURI(value string, semconvCompliant bool) (map[string]any, error) { m := make(map[string]any) if strings.HasPrefix(value, "?") { @@ -46,15 +70,73 @@ func parseURI(value string) (map[string]any, error) { return queryToMap(v, m), nil } - x, err := url.ParseRequestURI(value) - if err != nil { - return nil, err + var x *url.URL + var err error + var mappingFn func(*url.URL, map[string]any) (map[string]any, error) + + if semconvCompliant { + mappingFn = urlToSemconvMap + x, err = url.Parse(value) + if err != nil { + return nil, err + } + } else { + x, err = url.ParseRequestURI(value) + if err != nil { + return nil, err + } + + mappingFn = urlToMap + } + return mappingFn(x, m) +} + +// urlToMap converts a url.URL to a map, excludes any values that are not set. +func urlToSemconvMap(parsedURI *url.URL, m map[string]any) (map[string]any, error) { + m[semconv.AttributeURLOriginal] = parsedURI.String() + m[semconv.AttributeURLDomain] = parsedURI.Hostname() + m[semconv.AttributeURLScheme] = parsedURI.Scheme + m[semconv.AttributeURLPath] = parsedURI.Path + + if portString := parsedURI.Port(); len(portString) > 0 { + port, err := strconv.Atoi(portString) + if err != nil { + return nil, err + } + m[semconv.AttributeURLPort] = port + } + + if fragment := parsedURI.Fragment; len(fragment) > 0 { + m[semconv.AttributeURLFragment] = fragment + } + + if parsedURI.User != nil { + m[AttributeURLUserInfo] = parsedURI.User.String() + + if username := parsedURI.User.Username(); len(username) > 0 { + m[AttributeURLUsername] = username + } + + if pwd, isSet := parsedURI.User.Password(); isSet { + m[AttributeURLPassword] = pwd + } + } + + if query := parsedURI.RawQuery; len(query) > 0 { + m[semconv.AttributeURLQuery] = query } - return urlToMap(x, m), nil + + if periodIdx := strings.LastIndex(parsedURI.Path, "."); periodIdx != -1 { + if periodIdx < len(parsedURI.Path)-1 { + m[semconv.AttributeURLExtension] = parsedURI.Path[periodIdx+1:] + } + } + + return m, nil } // urlToMap converts a url.URL to a map, excludes any values that are not set. -func urlToMap(p *url.URL, m map[string]any) map[string]any { +func urlToMap(p *url.URL, m map[string]any) (map[string]any, error) { scheme := p.Scheme if scheme != "" { m["scheme"] = scheme @@ -80,7 +162,7 @@ func urlToMap(p *url.URL, m map[string]any) map[string]any { m["path"] = path } - return queryToMap(p.Query(), m) + return queryToMap(p.Query(), m), nil } // queryToMap converts a query string url.Values to a map. diff --git a/pkg/stanza/operator/parser/uri/parser_test.go b/pkg/stanza/operator/parser/uri/parser_test.go index 3bec6dc7469e..cbfa372c0fa2 100644 --- a/pkg/stanza/operator/parser/uri/parser_test.go +++ b/pkg/stanza/operator/parser/uri/parser_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" + semconv "go.opentelemetry.io/collector/semconv/v1.25.0" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator" @@ -475,7 +476,7 @@ func TestParseURI(t *testing.T) { for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { - x, err := parseURI(tc.inputBody) + x, err := ParseURI(tc.inputBody, false) if tc.expectErr { require.Error(t, err) return @@ -583,7 +584,9 @@ func TestURLToMap(t *testing.T) { for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { m := make(map[string]any) - require.Equal(t, tc.outputBody, urlToMap(tc.inputBody, m)) + resMap, err := urlToMap(tc.inputBody, m) + require.NoError(t, err) + require.Equal(t, tc.outputBody, resMap) }) } } @@ -700,3 +703,150 @@ func BenchmarkQueryParamValuesToMap(b *testing.B) { queryParamValuesToMap(v) } } + +func TestParseSemconv(t *testing.T) { + testCases := []struct { + Name string + Original string + ExpectedMap map[string]any + }{ + { + "complete example", + "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + map[string]any{ + semconv.AttributeURLPath: "/foo.gif", + semconv.AttributeURLFragment: "fragment", + semconv.AttributeURLExtension: "gif", + AttributeURLPassword: "mypassword", + semconv.AttributeURLOriginal: "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLPort: 80, + AttributeURLUserInfo: "myusername:mypassword", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLQuery: "key1=val1&key2=val2", + AttributeURLUsername: "myusername", + }, + }, + { + "simple example", + "http://www.example.com", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "", + }, + }, + { + "custom port", + "http://www.example.com:77", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com:77", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "", + semconv.AttributeURLPort: 77, + }, + }, + { + "file", + "http://www.example.com:77/file.png", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com:77/file.png", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/file.png", + semconv.AttributeURLPort: 77, + semconv.AttributeURLExtension: "png", + }, + }, + { + "fragment", + "http://www.example.com:77/foo#bar", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com:77/foo#bar", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + semconv.AttributeURLFragment: "bar", + }, + }, + { + "query example", + "https://www.example.com:77/foo?key=val", + map[string]any{ + semconv.AttributeURLOriginal: "https://www.example.com:77/foo?key=val", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + semconv.AttributeURLQuery: "key=val", + }, + }, + { + "user info", + "https://user:pw@www.example.com:77/foo", + map[string]any{ + semconv.AttributeURLOriginal: "https://user:pw@www.example.com:77/foo", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + AttributeURLUserInfo: "user:pw", + AttributeURLUsername: "user", + AttributeURLPassword: "pw", + }, + }, + { + "user info - no password", + "https://user:@www.example.com:77/foo", + map[string]any{ + semconv.AttributeURLOriginal: "https://user:@www.example.com:77/foo", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + AttributeURLUserInfo: "user:", + AttributeURLUsername: "user", + AttributeURLPassword: "", + }, + }, + { + "non-http scheme: ftp", + "ftp://ftp.is.co.za/rfc/rfc1808.txt", + map[string]any{ + semconv.AttributeURLOriginal: "ftp://ftp.is.co.za/rfc/rfc1808.txt", + semconv.AttributeURLScheme: "ftp", + semconv.AttributeURLPath: "/rfc/rfc1808.txt", + semconv.AttributeURLExtension: "txt", + semconv.AttributeURLDomain: "ftp.is.co.za", + }, + }, + { + "non-http scheme: telnet", + "telnet://192.0.2.16:80/", + map[string]any{ + semconv.AttributeURLOriginal: "telnet://192.0.2.16:80/", + semconv.AttributeURLScheme: "telnet", + semconv.AttributeURLPath: "/", + semconv.AttributeURLPort: 80, + semconv.AttributeURLDomain: "192.0.2.16", + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.Name, func(t *testing.T) { + resMap, err := parseURI(tc.Original, true) + require.NoError(t, err) + + require.Equal(t, len(tc.ExpectedMap), len(resMap)) + for k, v := range tc.ExpectedMap { + actualValue, found := resMap[k] + require.True(t, found, "key not found %q", k) + require.Equal(t, v, actualValue) + } + }) + } +} From ea2ef4f96fef2ac4667958533bbd4c0e9c1dc74f Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 13 Jun 2024 12:23:48 +0200 Subject: [PATCH 20/36] more linting --- processor/logstransformprocessor/go.mod | 1 + processor/logstransformprocessor/go.sum | 2 ++ receiver/filelogreceiver/go.mod | 1 + receiver/filelogreceiver/go.sum | 2 ++ receiver/journaldreceiver/go.mod | 1 + receiver/journaldreceiver/go.sum | 2 ++ receiver/mongodbatlasreceiver/go.mod | 1 + receiver/mongodbatlasreceiver/go.sum | 2 ++ receiver/namedpipereceiver/go.mod | 1 + receiver/namedpipereceiver/go.sum | 2 ++ receiver/otlpjsonfilereceiver/go.mod | 1 + receiver/otlpjsonfilereceiver/go.sum | 2 ++ receiver/sqlqueryreceiver/go.mod | 1 + receiver/sqlqueryreceiver/go.sum | 2 ++ receiver/syslogreceiver/go.mod | 1 + receiver/syslogreceiver/go.sum | 2 ++ receiver/tcplogreceiver/go.mod | 1 + receiver/tcplogreceiver/go.sum | 2 ++ receiver/udplogreceiver/go.mod | 1 + receiver/udplogreceiver/go.sum | 2 ++ receiver/windowseventlogreceiver/go.mod | 1 + receiver/windowseventlogreceiver/go.sum | 2 ++ 22 files changed, 33 insertions(+) diff --git a/processor/logstransformprocessor/go.mod b/processor/logstransformprocessor/go.mod index 949646deb996..56b5177eb84f 100644 --- a/processor/logstransformprocessor/go.mod +++ b/processor/logstransformprocessor/go.mod @@ -13,6 +13,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/processor v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/processor/logstransformprocessor/go.sum b/processor/logstransformprocessor/go.sum index c652f8501872..7961c54febaf 100644 --- a/processor/logstransformprocessor/go.sum +++ b/processor/logstransformprocessor/go.sum @@ -97,6 +97,8 @@ go.opentelemetry.io/collector/processor v0.102.2-0.20240611143128-7dfb57b9ad1c h go.opentelemetry.io/collector/processor v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:81izr5ORy0YdzmhelV5fRUJvV8ElmeodxToRpL0cocY= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/receiver/filelogreceiver/go.mod b/receiver/filelogreceiver/go.mod index 69e8b32eb6de..f0518ae55853 100644 --- a/receiver/filelogreceiver/go.mod +++ b/receiver/filelogreceiver/go.mod @@ -12,6 +12,7 @@ require ( go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/filelogreceiver/go.sum b/receiver/filelogreceiver/go.sum index d1ed25acf50f..a065612cccb0 100644 --- a/receiver/filelogreceiver/go.sum +++ b/receiver/filelogreceiver/go.sum @@ -97,6 +97,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/receiver/journaldreceiver/go.mod b/receiver/journaldreceiver/go.mod index 07facc6d000e..c1a927ba1176 100644 --- a/receiver/journaldreceiver/go.mod +++ b/receiver/journaldreceiver/go.mod @@ -10,6 +10,7 @@ require ( go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/journaldreceiver/go.sum b/receiver/journaldreceiver/go.sum index 6ccf7b0c2930..36053dd7b192 100644 --- a/receiver/journaldreceiver/go.sum +++ b/receiver/journaldreceiver/go.sum @@ -95,6 +95,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/receiver/mongodbatlasreceiver/go.mod b/receiver/mongodbatlasreceiver/go.mod index 7ab56f8c74e9..36158e8592b1 100644 --- a/receiver/mongodbatlasreceiver/go.mod +++ b/receiver/mongodbatlasreceiver/go.mod @@ -22,6 +22,7 @@ require ( go.opentelemetry.io/collector/filter v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/mongodbatlasreceiver/go.sum b/receiver/mongodbatlasreceiver/go.sum index 6044c0e7d05a..43be2ea884c0 100644 --- a/receiver/mongodbatlasreceiver/go.sum +++ b/receiver/mongodbatlasreceiver/go.sum @@ -114,6 +114,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/receiver/namedpipereceiver/go.mod b/receiver/namedpipereceiver/go.mod index 892c1c5d1a3e..c0af87c58d10 100644 --- a/receiver/namedpipereceiver/go.mod +++ b/receiver/namedpipereceiver/go.mod @@ -10,6 +10,7 @@ require ( go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/namedpipereceiver/go.sum b/receiver/namedpipereceiver/go.sum index 5d27a8e52602..169f1922f668 100644 --- a/receiver/namedpipereceiver/go.sum +++ b/receiver/namedpipereceiver/go.sum @@ -97,6 +97,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/receiver/otlpjsonfilereceiver/go.mod b/receiver/otlpjsonfilereceiver/go.mod index 2037296f6353..c0abeb29b96e 100644 --- a/receiver/otlpjsonfilereceiver/go.mod +++ b/receiver/otlpjsonfilereceiver/go.mod @@ -11,6 +11,7 @@ require ( go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata/testdata v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/otlpjsonfilereceiver/go.sum b/receiver/otlpjsonfilereceiver/go.sum index cabadfdeca0b..2591121bea44 100644 --- a/receiver/otlpjsonfilereceiver/go.sum +++ b/receiver/otlpjsonfilereceiver/go.sum @@ -97,6 +97,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.2-0.20240611143128-7dfb57b9a go.opentelemetry.io/collector/pdata/testdata v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:czLc/oKlriUYBB6EZbPLIhWMKaG4viHtxflaSDMjnxg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/receiver/sqlqueryreceiver/go.mod b/receiver/sqlqueryreceiver/go.mod index 4ed7f0578049..9c4b008a2f89 100644 --- a/receiver/sqlqueryreceiver/go.mod +++ b/receiver/sqlqueryreceiver/go.mod @@ -17,6 +17,7 @@ require ( go.opentelemetry.io/collector/extension v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/sqlqueryreceiver/go.sum b/receiver/sqlqueryreceiver/go.sum index fef551fc1397..70e37a491143 100644 --- a/receiver/sqlqueryreceiver/go.sum +++ b/receiver/sqlqueryreceiver/go.sum @@ -314,6 +314,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= diff --git a/receiver/syslogreceiver/go.mod b/receiver/syslogreceiver/go.mod index 3009ec93e0c7..8889f02e5702 100644 --- a/receiver/syslogreceiver/go.mod +++ b/receiver/syslogreceiver/go.mod @@ -11,6 +11,7 @@ require ( go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/syslogreceiver/go.sum b/receiver/syslogreceiver/go.sum index e808a117246e..61a7508acb33 100644 --- a/receiver/syslogreceiver/go.sum +++ b/receiver/syslogreceiver/go.sum @@ -103,6 +103,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/receiver/tcplogreceiver/go.mod b/receiver/tcplogreceiver/go.mod index 2ae65da55c1f..c8d2e89eeeda 100644 --- a/receiver/tcplogreceiver/go.mod +++ b/receiver/tcplogreceiver/go.mod @@ -9,6 +9,7 @@ require ( go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/tcplogreceiver/go.sum b/receiver/tcplogreceiver/go.sum index e808a117246e..61a7508acb33 100644 --- a/receiver/tcplogreceiver/go.sum +++ b/receiver/tcplogreceiver/go.sum @@ -103,6 +103,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/receiver/udplogreceiver/go.mod b/receiver/udplogreceiver/go.mod index 5a6465fbc16b..90ca58820f11 100644 --- a/receiver/udplogreceiver/go.mod +++ b/receiver/udplogreceiver/go.mod @@ -9,6 +9,7 @@ require ( go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/udplogreceiver/go.sum b/receiver/udplogreceiver/go.sum index 6ccf7b0c2930..36053dd7b192 100644 --- a/receiver/udplogreceiver/go.sum +++ b/receiver/udplogreceiver/go.sum @@ -95,6 +95,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= diff --git a/receiver/windowseventlogreceiver/go.mod b/receiver/windowseventlogreceiver/go.mod index 387133021fd1..442288e0f9df 100644 --- a/receiver/windowseventlogreceiver/go.mod +++ b/receiver/windowseventlogreceiver/go.mod @@ -10,6 +10,7 @@ require ( go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel/metric v1.27.0 go.opentelemetry.io/otel/trace v1.27.0 go.uber.org/goleak v1.3.0 diff --git a/receiver/windowseventlogreceiver/go.sum b/receiver/windowseventlogreceiver/go.sum index 6ccf7b0c2930..36053dd7b192 100644 --- a/receiver/windowseventlogreceiver/go.sum +++ b/receiver/windowseventlogreceiver/go.sum @@ -95,6 +95,8 @@ go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4Eegm go.opentelemetry.io/collector/pdata/testdata v0.102.1/go.mod h1:JEoSJTMgeTKyGxoMRy48RMYyhkA5vCCq/abJq9B6vXs= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c h1:FBHGUHAan/LZwzIwxodReDH64HTfaDB1RYH3dD3rwjg= go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:A/oJHfYc+1auPv6gbp0B/kR8DLtFIDCB/Z/3nDlHVQs= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= +go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw= go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg= go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ= go.opentelemetry.io/otel/exporters/prometheus v0.49.0 h1:Er5I1g/YhfYv9Affk9nJLfH/+qCCVVg1f2R9AbJfqDQ= From 800f741bd901484e2bb885f3d10278891bd20b18 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 13 Jun 2024 12:38:56 +0200 Subject: [PATCH 21/36] more linting --- connector/countconnector/go.mod | 6 ++++++ connector/countconnector/go.sum | 10 ++++++++++ connector/datadogconnector/go.mod | 3 +++ connector/routingconnector/go.mod | 6 ++++++ connector/routingconnector/go.sum | 10 ++++++++++ exporter/datadogexporter/integrationtest/go.mod | 3 +++ exporter/honeycombmarkerexporter/go.mod | 4 ++++ exporter/honeycombmarkerexporter/go.sum | 6 ++++++ internal/filter/go.mod | 3 +++ internal/filter/go.sum | 4 ++++ processor/attributesprocessor/go.mod | 3 +++ processor/attributesprocessor/go.sum | 4 ++++ processor/cumulativetodeltaprocessor/go.mod | 2 ++ processor/filterprocessor/go.mod | 3 +++ processor/filterprocessor/go.sum | 4 ++++ processor/routingprocessor/go.mod | 4 ++++ processor/routingprocessor/go.sum | 6 ++++++ processor/spanprocessor/go.mod | 4 ++++ processor/spanprocessor/go.sum | 6 ++++++ processor/tailsamplingprocessor/go.mod | 4 ++++ processor/tailsamplingprocessor/go.sum | 6 ++++++ processor/transformprocessor/go.mod | 4 ++++ processor/transformprocessor/go.sum | 6 ++++++ receiver/hostmetricsreceiver/go.mod | 2 ++ 24 files changed, 113 insertions(+) diff --git a/connector/countconnector/go.mod b/connector/countconnector/go.mod index 7d981561b7cf..8b72510ed5c4 100644 --- a/connector/countconnector/go.mod +++ b/connector/countconnector/go.mod @@ -25,12 +25,14 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -42,6 +44,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.102.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -49,6 +52,7 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect + go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect @@ -81,3 +85,5 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza diff --git a/connector/countconnector/go.sum b/connector/countconnector/go.sum index 723e59ee9ed7..2b28fce3f176 100644 --- a/connector/countconnector/go.sum +++ b/connector/countconnector/go.sum @@ -11,6 +11,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -27,6 +29,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= @@ -69,6 +73,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -86,6 +92,8 @@ go.opentelemetry.io/collector/connector v0.102.2-0.20240611143128-7dfb57b9ad1c h go.opentelemetry.io/collector/connector v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:6GDuB9stoHIRBPr5Kpbk9ztXBu7U4bMp1nYm56zP1Zs= go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c h1:L/FPXl2OoOKniPw1hYzCOk6eljlcwCC681y4plDDE08= go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:4EV8/Rh+KD6z75EjDDWthN50aFeeRqxsC589EpakV5E= +go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c h1:NL1/iU+6NoZZLxnPMgiML/d5nuYjokRKhSs/+YXkTHs= +go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c h1:f8L2r0f684bJAAZDoTvEWccx34C3kQsePNwy8KzTPqM= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4EegmtiSaOuh6wXWatKIui8xU= @@ -152,5 +160,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index 0e40df474a0a..91e57f3423aa 100644 --- a/connector/datadogconnector/go.mod +++ b/connector/datadogconnector/go.mod @@ -33,6 +33,8 @@ require ( google.golang.org/protobuf v1.34.2 ) +require github.com/expr-lang/expr v1.16.9 // indirect + require ( cloud.google.com/go/compute/metadata v0.3.0 // indirect github.com/DataDog/agent-payload/v5 v5.0.121 // indirect @@ -175,6 +177,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.102.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.102.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 7d83813c0d2b..d39a52c33074 100644 --- a/connector/routingconnector/go.mod +++ b/connector/routingconnector/go.mod @@ -21,12 +21,14 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -37,6 +39,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.102.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -44,6 +47,7 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect + go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect @@ -69,3 +73,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/stanza => ../../pkg/stanza diff --git a/connector/routingconnector/go.sum b/connector/routingconnector/go.sum index 749cea76c6a0..f82f8e1e17eb 100644 --- a/connector/routingconnector/go.sum +++ b/connector/routingconnector/go.sum @@ -12,6 +12,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -28,6 +30,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -69,6 +73,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -86,6 +92,8 @@ go.opentelemetry.io/collector/connector v0.102.2-0.20240611143128-7dfb57b9ad1c h go.opentelemetry.io/collector/connector v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:6GDuB9stoHIRBPr5Kpbk9ztXBu7U4bMp1nYm56zP1Zs= go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c h1:L/FPXl2OoOKniPw1hYzCOk6eljlcwCC681y4plDDE08= go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:4EV8/Rh+KD6z75EjDDWthN50aFeeRqxsC589EpakV5E= +go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c h1:NL1/iU+6NoZZLxnPMgiML/d5nuYjokRKhSs/+YXkTHs= +go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c h1:f8L2r0f684bJAAZDoTvEWccx34C3kQsePNwy8KzTPqM= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4EegmtiSaOuh6wXWatKIui8xU= @@ -152,5 +160,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index 7fdabda6a36a..5df3307b58c7 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -27,6 +27,8 @@ require ( google.golang.org/protobuf v1.34.2 ) +require github.com/expr-lang/expr v1.16.9 // indirect + require ( cloud.google.com/go/compute/metadata v0.3.0 // indirect github.com/DataDog/agent-payload/v5 v5.0.121 // indirect @@ -174,6 +176,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.102.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.102.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/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index 541b2aa78dff..c923e82331cd 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -5,6 +5,7 @@ go 1.21.0 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/config/confighttp v0.102.2-0.20240611143128-7dfb57b9ad1c @@ -26,6 +27,7 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect @@ -92,3 +94,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/stanza => ../../pkg/stanza diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index 4fcbb052b58f..fbe960d94933 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -13,6 +13,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -83,6 +85,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -190,5 +194,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/filter/go.mod b/internal/filter/go.mod index cf634359cf2c..43494b3b2100 100644 --- a/internal/filter/go.mod +++ b/internal/filter/go.mod @@ -39,6 +39,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/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -77,3 +78,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/stanza => ../../pkg/stanza diff --git a/internal/filter/go.sum b/internal/filter/go.sum index ac8339746bdc..dd204346b548 100644 --- a/internal/filter/go.sum +++ b/internal/filter/go.sum @@ -73,6 +73,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -150,5 +152,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/attributesprocessor/go.mod b/processor/attributesprocessor/go.mod index bbc49271f570..87d95e59306c 100644 --- a/processor/attributesprocessor/go.mod +++ b/processor/attributesprocessor/go.mod @@ -44,6 +44,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.102.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -85,3 +86,5 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza diff --git a/processor/attributesprocessor/go.sum b/processor/attributesprocessor/go.sum index 1cf56bafd80b..ec0c1e3a6704 100644 --- a/processor/attributesprocessor/go.sum +++ b/processor/attributesprocessor/go.sum @@ -73,6 +73,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -158,5 +160,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/cumulativetodeltaprocessor/go.mod b/processor/cumulativetodeltaprocessor/go.mod index 818a8e5d64a9..0a3dc71a219e 100644 --- a/processor/cumulativetodeltaprocessor/go.mod +++ b/processor/cumulativetodeltaprocessor/go.mod @@ -74,3 +74,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/stanza => ../../pkg/stanza diff --git a/processor/filterprocessor/go.mod b/processor/filterprocessor/go.mod index 2327680fd20a..310a92814819 100644 --- a/processor/filterprocessor/go.mod +++ b/processor/filterprocessor/go.mod @@ -46,6 +46,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.102.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -84,3 +85,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/stanza => ../../pkg/stanza diff --git a/processor/filterprocessor/go.sum b/processor/filterprocessor/go.sum index 1cf56bafd80b..ec0c1e3a6704 100644 --- a/processor/filterprocessor/go.sum +++ b/processor/filterprocessor/go.sum @@ -73,6 +73,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -158,5 +160,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/routingprocessor/go.mod b/processor/routingprocessor/go.mod index d1d5a6d43e4d..785022aea981 100644 --- a/processor/routingprocessor/go.mod +++ b/processor/routingprocessor/go.mod @@ -29,6 +29,7 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -50,6 +51,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.102.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -97,3 +99,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/stanza => ../../pkg/stanza diff --git a/processor/routingprocessor/go.sum b/processor/routingprocessor/go.sum index 4b730b241e29..8a484f605eec 100644 --- a/processor/routingprocessor/go.sum +++ b/processor/routingprocessor/go.sum @@ -13,6 +13,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -81,6 +83,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -214,5 +218,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/spanprocessor/go.mod b/processor/spanprocessor/go.mod index 9656bf633e6e..d8f0e90c121b 100644 --- a/processor/spanprocessor/go.mod +++ b/processor/spanprocessor/go.mod @@ -24,6 +24,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect @@ -42,6 +43,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.102.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -84,3 +86,5 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza diff --git a/processor/spanprocessor/go.sum b/processor/spanprocessor/go.sum index 24029778d96b..ec0c1e3a6704 100644 --- a/processor/spanprocessor/go.sum +++ b/processor/spanprocessor/go.sum @@ -11,6 +11,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -71,6 +73,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -156,5 +160,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/tailsamplingprocessor/go.mod b/processor/tailsamplingprocessor/go.mod index 7f777e050b81..51a746655772 100644 --- a/processor/tailsamplingprocessor/go.mod +++ b/processor/tailsamplingprocessor/go.mod @@ -8,6 +8,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c @@ -30,6 +31,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect @@ -82,3 +84,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/stanza => ../../pkg/stanza diff --git a/processor/tailsamplingprocessor/go.sum b/processor/tailsamplingprocessor/go.sum index 966be72d3d25..d9ab1400403c 100644 --- a/processor/tailsamplingprocessor/go.sum +++ b/processor/tailsamplingprocessor/go.sum @@ -11,6 +11,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -73,6 +75,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -156,5 +160,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/transformprocessor/go.mod b/processor/transformprocessor/go.mod index f28a47b5eed0..86a820d0dec3 100644 --- a/processor/transformprocessor/go.mod +++ b/processor/transformprocessor/go.mod @@ -7,6 +7,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.102.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c @@ -27,6 +28,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect @@ -87,3 +89,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza diff --git a/processor/transformprocessor/go.sum b/processor/transformprocessor/go.sum index 24029778d96b..ec0c1e3a6704 100644 --- a/processor/transformprocessor/go.sum +++ b/processor/transformprocessor/go.sum @@ -11,6 +11,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= +github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= +github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -71,6 +73,8 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -156,5 +160,7 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/receiver/hostmetricsreceiver/go.mod b/receiver/hostmetricsreceiver/go.mod index c97c30638d16..d401993be6ba 100644 --- a/receiver/hostmetricsreceiver/go.mod +++ b/receiver/hostmetricsreceiver/go.mod @@ -155,3 +155,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/stanza => ../../pkg/stanza From 747218bb1782aaeabb438df798c31274d58fe5bf Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 13 Jun 2024 12:46:47 +0200 Subject: [PATCH 22/36] fix typo --- pkg/stanza/operator/parser/uri/parser_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/stanza/operator/parser/uri/parser_test.go b/pkg/stanza/operator/parser/uri/parser_test.go index cbfa372c0fa2..d892c3362f6c 100644 --- a/pkg/stanza/operator/parser/uri/parser_test.go +++ b/pkg/stanza/operator/parser/uri/parser_test.go @@ -838,7 +838,7 @@ func TestParseSemconv(t *testing.T) { for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { - resMap, err := parseURI(tc.Original, true) + resMap, err := ParseURI(tc.Original, true) require.NoError(t, err) require.Equal(t, len(tc.ExpectedMap), len(resMap)) From 29db7eb43dfba51c49512ce56b0328e57ad8cbd3 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 13 Jun 2024 12:59:36 +0200 Subject: [PATCH 23/36] check fixed --- pkg/stanza/operator/parser/uri/parser.go | 2 +- pkg/stanza/operator/parser/uri/parser_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/stanza/operator/parser/uri/parser.go b/pkg/stanza/operator/parser/uri/parser.go index e6b271fb2ace..efad637cc5a5 100644 --- a/pkg/stanza/operator/parser/uri/parser.go +++ b/pkg/stanza/operator/parser/uri/parser.go @@ -10,11 +10,11 @@ import ( "strconv" "strings" + "go.opentelemetry.io/collector/featuregate" semconv "go.opentelemetry.io/collector/semconv/v1.25.0" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper" - "go.opentelemetry.io/collector/featuregate" ) const semconvCompliantFeatureGateID = "parser.uri.ecscompliant" diff --git a/pkg/stanza/operator/parser/uri/parser_test.go b/pkg/stanza/operator/parser/uri/parser_test.go index d892c3362f6c..7abdaed1aea7 100644 --- a/pkg/stanza/operator/parser/uri/parser_test.go +++ b/pkg/stanza/operator/parser/uri/parser_test.go @@ -678,7 +678,7 @@ func BenchmarkURLToMap(b *testing.B) { b.Fatal(err) } for n := 0; n < b.N; n++ { - urlToMap(u, m) + _, _ = urlToMap(u, m) } } From 95b8704d8ec03b3348293f82dc5c74b4a75991ff Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Thu, 13 Jun 2024 12:59:59 +0200 Subject: [PATCH 24/36] crosslink --- connector/countconnector/go.mod | 4 ++++ connector/routingconnector/go.mod | 4 ++++ exporter/honeycombmarkerexporter/go.mod | 4 ++++ internal/filter/go.mod | 4 ++++ pkg/ottl/go.mod | 4 ++++ processor/attributesprocessor/go.mod | 4 ++++ processor/cumulativetodeltaprocessor/go.mod | 4 ++++ processor/filterprocessor/go.mod | 4 ++++ processor/routingprocessor/go.mod | 4 ++++ processor/spanprocessor/go.mod | 4 ++++ processor/tailsamplingprocessor/go.mod | 4 ++++ processor/transformprocessor/go.mod | 2 ++ receiver/hostmetricsreceiver/go.mod | 4 ++++ 13 files changed, 50 insertions(+) diff --git a/connector/countconnector/go.mod b/connector/countconnector/go.mod index 8b72510ed5c4..5b4a6b9efc50 100644 --- a/connector/countconnector/go.mod +++ b/connector/countconnector/go.mod @@ -87,3 +87,7 @@ retract ( replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/connector/routingconnector/go.mod b/connector/routingconnector/go.mod index d39a52c33074..e2321b023204 100644 --- a/connector/routingconnector/go.mod +++ b/connector/routingconnector/go.mod @@ -75,3 +75,7 @@ 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/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index c923e82331cd..b5312e08abd3 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -96,3 +96,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/internal/filter/go.mod b/internal/filter/go.mod index 43494b3b2100..f813ccd3b0c9 100644 --- a/internal/filter/go.mod +++ b/internal/filter/go.mod @@ -80,3 +80,7 @@ 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/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index c24c5433d763..e8f51daaebb6 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -77,3 +77,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../golden replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/attributesprocessor/go.mod b/processor/attributesprocessor/go.mod index 87d95e59306c..9c0d5ac90384 100644 --- a/processor/attributesprocessor/go.mod +++ b/processor/attributesprocessor/go.mod @@ -88,3 +88,7 @@ retract ( replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/cumulativetodeltaprocessor/go.mod b/processor/cumulativetodeltaprocessor/go.mod index 0a3dc71a219e..e3245da2b211 100644 --- a/processor/cumulativetodeltaprocessor/go.mod +++ b/processor/cumulativetodeltaprocessor/go.mod @@ -76,3 +76,7 @@ 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/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/filterprocessor/go.mod b/processor/filterprocessor/go.mod index 310a92814819..f012b2677545 100644 --- a/processor/filterprocessor/go.mod +++ b/processor/filterprocessor/go.mod @@ -87,3 +87,7 @@ 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/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common diff --git a/processor/routingprocessor/go.mod b/processor/routingprocessor/go.mod index 785022aea981..3bd03531e1e3 100644 --- a/processor/routingprocessor/go.mod +++ b/processor/routingprocessor/go.mod @@ -101,3 +101,7 @@ 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/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/spanprocessor/go.mod b/processor/spanprocessor/go.mod index d8f0e90c121b..a3918e03a49d 100644 --- a/processor/spanprocessor/go.mod +++ b/processor/spanprocessor/go.mod @@ -88,3 +88,7 @@ retract ( replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/tailsamplingprocessor/go.mod b/processor/tailsamplingprocessor/go.mod index 51a746655772..614973b01069 100644 --- a/processor/tailsamplingprocessor/go.mod +++ b/processor/tailsamplingprocessor/go.mod @@ -86,3 +86,7 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/corei replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common diff --git a/processor/transformprocessor/go.mod b/processor/transformprocessor/go.mod index 86a820d0dec3..90c324b4944e 100644 --- a/processor/transformprocessor/go.mod +++ b/processor/transformprocessor/go.mod @@ -91,3 +91,5 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/commo replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/receiver/hostmetricsreceiver/go.mod b/receiver/hostmetricsreceiver/go.mod index d401993be6ba..b154bb54ec45 100644 --- a/receiver/hostmetricsreceiver/go.mod +++ b/receiver/hostmetricsreceiver/go.mod @@ -157,3 +157,7 @@ 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/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage From 95e56e07a77d822bbc95456f2e3e1958fe521433 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 14 Jun 2024 09:23:51 +0200 Subject: [PATCH 25/36] move parse uri to separate package, remove stanza dep from ottl --- internal/coreinternal/parseutils/uri.go | 164 +++++ internal/coreinternal/parseutils/uri_test.go | 633 ++++++++++++++++++ pkg/ottl/go.mod | 11 - pkg/ottl/go.sum | 24 - pkg/ottl/ottlfuncs/func_uri.go | 4 +- pkg/stanza/operator/parser/uri/parser.go | 159 +---- pkg/stanza/operator/parser/uri/parser_test.go | 623 ----------------- 7 files changed, 801 insertions(+), 817 deletions(-) create mode 100644 internal/coreinternal/parseutils/uri.go create mode 100644 internal/coreinternal/parseutils/uri_test.go diff --git a/internal/coreinternal/parseutils/uri.go b/internal/coreinternal/parseutils/uri.go new file mode 100644 index 000000000000..f50df032cba1 --- /dev/null +++ b/internal/coreinternal/parseutils/uri.go @@ -0,0 +1,164 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package parseutils + +import ( + "net/url" + "strconv" + "strings" + + semconv "go.opentelemetry.io/collector/semconv/v1.25.0" +) + +const ( + // replace once conventions includes these + AttributeURLUserInfo = "url.user_info" + AttributeURLUsername = "url.username" + AttributeURLPassword = "url.password" +) + +// parseURI takes an absolute or relative uri and returns the parsed values. +func ParseURI(value string, semconvCompliant bool) (map[string]any, error) { + m := make(map[string]any) + + if strings.HasPrefix(value, "?") { + // remove the query string '?' prefix before parsing + v, err := url.ParseQuery(value[1:]) + if err != nil { + return nil, err + } + return queryToMap(v, m), nil + } + + var x *url.URL + var err error + var mappingFn func(*url.URL, map[string]any) (map[string]any, error) + + if semconvCompliant { + mappingFn = urlToSemconvMap + x, err = url.Parse(value) + if err != nil { + return nil, err + } + } else { + x, err = url.ParseRequestURI(value) + if err != nil { + return nil, err + } + + mappingFn = urlToMap + } + return mappingFn(x, m) +} + +// urlToMap converts a url.URL to a map, excludes any values that are not set. +func urlToSemconvMap(parsedURI *url.URL, m map[string]any) (map[string]any, error) { + m[semconv.AttributeURLOriginal] = parsedURI.String() + m[semconv.AttributeURLDomain] = parsedURI.Hostname() + m[semconv.AttributeURLScheme] = parsedURI.Scheme + m[semconv.AttributeURLPath] = parsedURI.Path + + if portString := parsedURI.Port(); len(portString) > 0 { + port, err := strconv.Atoi(portString) + if err != nil { + return nil, err + } + m[semconv.AttributeURLPort] = port + } + + if fragment := parsedURI.Fragment; len(fragment) > 0 { + m[semconv.AttributeURLFragment] = fragment + } + + if parsedURI.User != nil { + m[AttributeURLUserInfo] = parsedURI.User.String() + + if username := parsedURI.User.Username(); len(username) > 0 { + m[AttributeURLUsername] = username + } + + if pwd, isSet := parsedURI.User.Password(); isSet { + m[AttributeURLPassword] = pwd + } + } + + if query := parsedURI.RawQuery; len(query) > 0 { + m[semconv.AttributeURLQuery] = query + } + + if periodIdx := strings.LastIndex(parsedURI.Path, "."); periodIdx != -1 { + if periodIdx < len(parsedURI.Path)-1 { + m[semconv.AttributeURLExtension] = parsedURI.Path[periodIdx+1:] + } + } + + return m, nil +} + +// urlToMap converts a url.URL to a map, excludes any values that are not set. +func urlToMap(p *url.URL, m map[string]any) (map[string]any, error) { + scheme := p.Scheme + if scheme != "" { + m["scheme"] = scheme + } + + user := p.User.Username() + if user != "" { + m["user"] = user + } + + host := p.Hostname() + if host != "" { + m["host"] = host + } + + port := p.Port() + if port != "" { + m["port"] = port + } + + path := p.EscapedPath() + if path != "" { + m["path"] = path + } + + return queryToMap(p.Query(), m), nil +} + +// queryToMap converts a query string url.Values to a map. +func queryToMap(query url.Values, m map[string]any) map[string]any { + // no-op if query is empty, do not create the key m["query"] + if len(query) == 0 { + return m + } + + /* 'parameter' will represent url.Values + map[string]any{ + "parameter-a": []any{ + "a", + "b", + }, + "parameter-b": []any{ + "x", + "y", + }, + } + */ + parameters := map[string]any{} + for param, values := range query { + parameters[param] = queryParamValuesToMap(values) + } + m["query"] = parameters + return m +} + +// queryParamValuesToMap takes query string parameter values and +// returns an []interface populated with the values +func queryParamValuesToMap(values []string) []any { + v := make([]any, len(values)) + for i, value := range values { + v[i] = value + } + return v +} diff --git a/internal/coreinternal/parseutils/uri_test.go b/internal/coreinternal/parseutils/uri_test.go new file mode 100644 index 000000000000..f2cab56aa3bd --- /dev/null +++ b/internal/coreinternal/parseutils/uri_test.go @@ -0,0 +1,633 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package parseutils + +import ( + "net/url" + "testing" + + "github.com/stretchr/testify/require" + semconv "go.opentelemetry.io/collector/semconv/v1.25.0" +) + +// Test all usecases: absolute uri, relative uri, query string +func TestParseURI(t *testing.T) { + cases := []struct { + name string + inputBody string + outputBody map[string]any + expectErr bool + }{ + { + "scheme-http", + "http://", + map[string]any{ + "scheme": "http", + }, + false, + }, + { + "scheme-user", + "http://myuser:mypass@", + map[string]any{ + "scheme": "http", + "user": "myuser", + }, + false, + }, + { + "scheme-host", + "http://golang.com", + map[string]any{ + "scheme": "http", + "host": "golang.com", + }, + false, + }, + { + "scheme-host-root", + "http://golang.com/", + map[string]any{ + "scheme": "http", + "host": "golang.com", + "path": "/", + }, + false, + }, + { + "scheme-host-minimal", + "http://golang", + map[string]any{ + "scheme": "http", + "host": "golang", + }, + false, + }, + { + "host-missing-scheme", + "golang.org", + map[string]any{}, + true, + }, + { + "sheme-port", + "http://:8080", + map[string]any{ + "scheme": "http", + "port": "8080", + }, + false, + }, + { + "port-missing-scheme", + ":8080", + map[string]any{}, + true, + }, + { + "path", + "/docs", + map[string]any{ + "path": "/docs", + }, + false, + }, + { + "path-advanced", + `/x/y%2Fz`, + map[string]any{ + "path": `/x/y%2Fz`, + }, + false, + }, + { + "path-root", + "/", + map[string]any{ + "path": "/", + }, + false, + }, + { + "path-query", + "/v1/app?user=golang", + map[string]any{ + "path": "/v1/app", + "query": map[string]any{ + "user": []any{ + "golang", + }, + }, + }, + false, + }, + { + "invalid-query", + "?q;go", + map[string]any{}, + true, + }, + { + "scheme-path", + "http:///v1/app", + map[string]any{ + "scheme": "http", + "path": "/v1/app", + }, + false, + }, + { + "scheme-host-query", + "https://app.com?token=0000&env=prod&env=stage", + map[string]any{ + "scheme": "https", + "host": "app.com", + "query": map[string]any{ + "token": []any{ + "0000", + }, + "env": []any{ + "prod", + "stage", + }, + }, + }, + false, + }, + { + "minimal", + "http://golang.org", + map[string]any{ + "scheme": "http", + "host": "golang.org", + }, + false, + }, + { + "advanced", + "https://go:password@golang.org:8443/v2/app?env=stage&token=456&index=105838&env=prod", + map[string]any{ + "scheme": "https", + "user": "go", + "host": "golang.org", + "port": "8443", + "path": "/v2/app", + "query": map[string]any{ + "token": []any{ + "456", + }, + "index": []any{ + "105838", + }, + "env": []any{ + "stage", + "prod", + }, + }, + }, + false, + }, + { + "magnet", + "magnet:?xt=urn:sha1:HNCKHTQCWBTRNJIV4WNAE52SJUQCZO6C", + map[string]any{ + "scheme": "magnet", + "query": map[string]any{ + "xt": []any{ + "urn:sha1:HNCKHTQCWBTRNJIV4WNAE52SJUQCZO6C", + }, + }, + }, + false, + }, + { + "sftp", + "sftp://ftp.com//home/name/employee.csv", + map[string]any{ + "scheme": "sftp", + "host": "ftp.com", + "path": "//home/name/employee.csv", + }, + false, + }, + { + "missing-schema", + "golang.org/app", + map[string]any{}, + true, + }, + { + "query-advanced", + "?token=0000&env=prod&env=stage&task=update&task=new&action=update", + map[string]any{ + "query": map[string]any{ + "token": []any{ + "0000", + }, + "env": []any{ + "prod", + "stage", + }, + "task": []any{ + "update", + "new", + }, + "action": []any{ + "update", + }, + }, + }, + false, + }, + { + "query", + "?token=0000", + map[string]any{ + "query": map[string]any{ + "token": []any{ + "0000", + }, + }, + }, + false, + }, + { + "query-empty", + "?", + map[string]any{}, + false, + }, + { + "query-empty-key", + "?user=", + map[string]any{ + "query": map[string]any{ + "user": []any{ + "", // no value + }, + }, + }, + false, + }, + // Query string without a ? prefix is treated as a URI, therefor + // an error will be returned by url.Parse("user=dev") + { + "query-no-?-prefix", + "user=dev", + map[string]any{}, + true, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + x, err := ParseURI(tc.inputBody, false) + if tc.expectErr { + require.Error(t, err) + return + } + require.NoError(t, err) + require.Equal(t, tc.outputBody, x) + }) + } +} + +func TestURLToMap(t *testing.T) { + cases := []struct { + name string + inputBody *url.URL + outputBody map[string]any + }{ + { + "absolute-uri", + &url.URL{ + Scheme: "https", + Host: "google.com:8443", + Path: "/app", + RawQuery: "stage=prod&stage=dev", + }, + map[string]any{ + "scheme": "https", + "host": "google.com", + "port": "8443", + "path": "/app", + "query": map[string]any{ + "stage": []any{ + "prod", + "dev", + }, + }, + }, + }, + { + "absolute-uri-simple", + &url.URL{ + Scheme: "http", + Host: "google.com", + }, + map[string]any{ + "scheme": "http", + "host": "google.com", + }, + }, + { + "path", + &url.URL{ + Path: "/app", + RawQuery: "stage=prod&stage=dev", + }, + map[string]any{ + "path": "/app", + "query": map[string]any{ + "stage": []any{ + "prod", + "dev", + }, + }, + }, + }, + { + "path-simple", + &url.URL{ + Path: "/app", + }, + map[string]any{ + "path": "/app", + }, + }, + { + "query", + &url.URL{ + RawQuery: "stage=prod&stage=dev", + }, + map[string]any{ + "query": map[string]any{ + "stage": []any{ + "prod", + "dev", + }, + }, + }, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + m := make(map[string]any) + resMap, err := urlToMap(tc.inputBody, m) + require.NoError(t, err) + require.Equal(t, tc.outputBody, resMap) + }) + } +} + +func TestQueryToMap(t *testing.T) { + cases := []struct { + name string + inputBody url.Values + outputBody map[string]any + }{ + { + "query", + url.Values{ + "stage": []string{ + "prod", + "dev", + }, + }, + map[string]any{ + "query": map[string]any{ + "stage": []any{ + "prod", + "dev", + }, + }, + }, + }, + { + "empty", + url.Values{}, + map[string]any{}, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + m := make(map[string]any) + require.Equal(t, tc.outputBody, queryToMap(tc.inputBody, m)) + }) + } +} + +func TestQueryParamValuesToMap(t *testing.T) { + cases := []struct { + name string + inputBody []string + outputBody []any + }{ + { + "simple", + []string{ + "prod", + "dev", + }, + []any{ + "prod", + "dev", + }, + }, + { + "empty", + []string{}, + []any{}, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + require.Equal(t, tc.outputBody, queryParamValuesToMap(tc.inputBody)) + }) + } +} + +func BenchmarkURLToMap(b *testing.B) { + m := make(map[string]any) + v := "https://dev:password@www.golang.org:8443/v1/app/stage?token=d9e28b1d-2c7b-4853-be6a-d94f34a5d4ab&env=prod&env=stage&token=c6fa29f9-a31b-4584-b98d-aa8473b0e18d®ion=us-east1b&mode=fast" + u, err := url.ParseRequestURI(v) + if err != nil { + b.Fatal(err) + } + for n := 0; n < b.N; n++ { + _, _ = urlToMap(u, m) + } +} + +func BenchmarkQueryToMap(b *testing.B) { + m := make(map[string]any) + v := "?token=d9e28b1d-2c7b-4853-be6a-d94f34a5d4ab&env=prod&env=stage&token=c6fa29f9-a31b-4584-b98d-aa8473b0e18d®ion=us-east1b&mode=fast" + u, err := url.ParseQuery(v) + if err != nil { + b.Fatal(err) + } + for n := 0; n < b.N; n++ { + queryToMap(u, m) + } +} + +func BenchmarkQueryParamValuesToMap(b *testing.B) { + v := []string{ + "d9e28b1d-2c7b-4853-be6a-d94f34a5d4ab", + "c6fa29f9-a31b-4584-b98d-aa8473b0e18", + } + for n := 0; n < b.N; n++ { + queryParamValuesToMap(v) + } +} + +func TestParseSemconv(t *testing.T) { + testCases := []struct { + Name string + Original string + ExpectedMap map[string]any + }{ + { + "complete example", + "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + map[string]any{ + semconv.AttributeURLPath: "/foo.gif", + semconv.AttributeURLFragment: "fragment", + semconv.AttributeURLExtension: "gif", + AttributeURLPassword: "mypassword", + semconv.AttributeURLOriginal: "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLPort: 80, + AttributeURLUserInfo: "myusername:mypassword", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLQuery: "key1=val1&key2=val2", + AttributeURLUsername: "myusername", + }, + }, + { + "simple example", + "http://www.example.com", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "", + }, + }, + { + "custom port", + "http://www.example.com:77", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com:77", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "", + semconv.AttributeURLPort: 77, + }, + }, + { + "file", + "http://www.example.com:77/file.png", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com:77/file.png", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/file.png", + semconv.AttributeURLPort: 77, + semconv.AttributeURLExtension: "png", + }, + }, + { + "fragment", + "http://www.example.com:77/foo#bar", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com:77/foo#bar", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + semconv.AttributeURLFragment: "bar", + }, + }, + { + "query example", + "https://www.example.com:77/foo?key=val", + map[string]any{ + semconv.AttributeURLOriginal: "https://www.example.com:77/foo?key=val", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + semconv.AttributeURLQuery: "key=val", + }, + }, + { + "user info", + "https://user:pw@www.example.com:77/foo", + map[string]any{ + semconv.AttributeURLOriginal: "https://user:pw@www.example.com:77/foo", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + AttributeURLUserInfo: "user:pw", + AttributeURLUsername: "user", + AttributeURLPassword: "pw", + }, + }, + { + "user info - no password", + "https://user:@www.example.com:77/foo", + map[string]any{ + semconv.AttributeURLOriginal: "https://user:@www.example.com:77/foo", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + AttributeURLUserInfo: "user:", + AttributeURLUsername: "user", + AttributeURLPassword: "", + }, + }, + { + "non-http scheme: ftp", + "ftp://ftp.is.co.za/rfc/rfc1808.txt", + map[string]any{ + semconv.AttributeURLOriginal: "ftp://ftp.is.co.za/rfc/rfc1808.txt", + semconv.AttributeURLScheme: "ftp", + semconv.AttributeURLPath: "/rfc/rfc1808.txt", + semconv.AttributeURLExtension: "txt", + semconv.AttributeURLDomain: "ftp.is.co.za", + }, + }, + { + "non-http scheme: telnet", + "telnet://192.0.2.16:80/", + map[string]any{ + semconv.AttributeURLOriginal: "telnet://192.0.2.16:80/", + semconv.AttributeURLScheme: "telnet", + semconv.AttributeURLPath: "/", + semconv.AttributeURLPort: 80, + semconv.AttributeURLDomain: "192.0.2.16", + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.Name, func(t *testing.T) { + resMap, err := ParseURI(tc.Original, true) + require.NoError(t, err) + + require.Equal(t, len(tc.ExpectedMap), len(resMap)) + for k, v := range tc.ExpectedMap { + actualValue, found := resMap[k] + require.True(t, found, "key not found %q", k) + require.Equal(t, v, actualValue) + } + }) + } +} diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index e8f51daaebb6..a1dfc76f4754 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -10,7 +10,6 @@ require ( github.com/json-iterator/go v1.1.12 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.102.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c @@ -26,17 +25,9 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect - github.com/knadh/koanf/maps v0.1.1 // indirect - github.com/knadh/koanf/providers/confmap v0.1.0 // indirect - github.com/knadh/koanf/v2 v2.1.1 // indirect - github.com/mitchellh/copystructure v1.2.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/pkg/pdatautil v0.102.0 // indirect @@ -46,8 +37,6 @@ require ( github.com/prometheus/common v0.54.0 // indirect github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect - go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect - go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/metric v1.27.0 // indirect diff --git a/pkg/ottl/go.sum b/pkg/ottl/go.sum index 542630e1a5ba..2dbe86234179 100644 --- a/pkg/ottl/go.sum +++ b/pkg/ottl/go.sum @@ -11,15 +11,11 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= -github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= -github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= -github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -29,8 +25,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -39,20 +33,10 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= -github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= -github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU= -github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= -github.com/knadh/koanf/v2 v2.1.1 h1:/R8eXqasSTsmDCsAyYj+81Wteg8AqrV9CP6gvsTsOmM= -github.com/knadh/koanf/v2 v2.1.1/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -71,8 +55,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -82,10 +64,6 @@ go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c h go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:AM5c/Ohhxj2j/vfCZrwKUD7PrcMpuCbo68rSBibV9U4= go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c h1:biIHEgJgIFabkzjRrxyiGs3ZyoJ8jPiJyU8dorKaPWg= go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:WxWKNVAQJg/Io1nA3xLgn/DWLE/W1QOB2+/Js3ACi40= -go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c h1:LOhGPowRmdpv7HU6HAFkdRvys41RWaijhGmWa7YBOsg= -go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:KgpS7UxH5rkd69CzAzlY2I1heH8Z7eNCZlHmwQBMxNg= -go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c h1:NL1/iU+6NoZZLxnPMgiML/d5nuYjokRKhSs/+YXkTHs= -go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c h1:f8L2r0f684bJAAZDoTvEWccx34C3kQsePNwy8KzTPqM= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c h1:uNEgGegvb9zVQ9i70Kit3oldAOP4FJkCuOmtswOjLUk= @@ -150,7 +128,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index 79b089e54f4d..55f7a0e39317 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -7,8 +7,8 @@ import ( "context" "fmt" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/parseutils" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" - uriparser "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/parser/uri" ) type URIArguments[K any] struct { @@ -39,6 +39,6 @@ func uri[K any](uriSource ottl.StringGetter[K]) ottl.ExprFunc[K] { //revive:disa return nil, fmt.Errorf("uri cannot be nil") } - return uriparser.ParseURI(uriString, true) + return parseutils.ParseURI(uriString, true) } } diff --git a/pkg/stanza/operator/parser/uri/parser.go b/pkg/stanza/operator/parser/uri/parser.go index efad637cc5a5..4d290b9afcc0 100644 --- a/pkg/stanza/operator/parser/uri/parser.go +++ b/pkg/stanza/operator/parser/uri/parser.go @@ -6,26 +6,16 @@ package uri // import "github.com/open-telemetry/opentelemetry-collector-contrib import ( "context" "fmt" - "net/url" - "strconv" - "strings" "go.opentelemetry.io/collector/featuregate" - semconv "go.opentelemetry.io/collector/semconv/v1.25.0" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/parseutils" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper" ) const semconvCompliantFeatureGateID = "parser.uri.ecscompliant" -const ( - // replace once conventions includes these - AttributeURLUserInfo = "url.user_info" - AttributeURLUsername = "url.username" - AttributeURLPassword = "url.password" -) - var semconvCompliantFeatureGate *featuregate.Gate func init() { @@ -51,153 +41,8 @@ func (p *Parser) Process(ctx context.Context, entry *entry.Entry) error { func (p *Parser) parse(value any) (any, error) { switch m := value.(type) { case string: - return ParseURI(m, semconvCompliantFeatureGate.IsEnabled()) + return parseutils.ParseURI(m, semconvCompliantFeatureGate.IsEnabled()) default: return nil, fmt.Errorf("type '%T' cannot be parsed as URI", value) } } - -// parseURI takes an absolute or relative uri and returns the parsed values. -func ParseURI(value string, semconvCompliant bool) (map[string]any, error) { - m := make(map[string]any) - - if strings.HasPrefix(value, "?") { - // remove the query string '?' prefix before parsing - v, err := url.ParseQuery(value[1:]) - if err != nil { - return nil, err - } - return queryToMap(v, m), nil - } - - var x *url.URL - var err error - var mappingFn func(*url.URL, map[string]any) (map[string]any, error) - - if semconvCompliant { - mappingFn = urlToSemconvMap - x, err = url.Parse(value) - if err != nil { - return nil, err - } - } else { - x, err = url.ParseRequestURI(value) - if err != nil { - return nil, err - } - - mappingFn = urlToMap - } - return mappingFn(x, m) -} - -// urlToMap converts a url.URL to a map, excludes any values that are not set. -func urlToSemconvMap(parsedURI *url.URL, m map[string]any) (map[string]any, error) { - m[semconv.AttributeURLOriginal] = parsedURI.String() - m[semconv.AttributeURLDomain] = parsedURI.Hostname() - m[semconv.AttributeURLScheme] = parsedURI.Scheme - m[semconv.AttributeURLPath] = parsedURI.Path - - if portString := parsedURI.Port(); len(portString) > 0 { - port, err := strconv.Atoi(portString) - if err != nil { - return nil, err - } - m[semconv.AttributeURLPort] = port - } - - if fragment := parsedURI.Fragment; len(fragment) > 0 { - m[semconv.AttributeURLFragment] = fragment - } - - if parsedURI.User != nil { - m[AttributeURLUserInfo] = parsedURI.User.String() - - if username := parsedURI.User.Username(); len(username) > 0 { - m[AttributeURLUsername] = username - } - - if pwd, isSet := parsedURI.User.Password(); isSet { - m[AttributeURLPassword] = pwd - } - } - - if query := parsedURI.RawQuery; len(query) > 0 { - m[semconv.AttributeURLQuery] = query - } - - if periodIdx := strings.LastIndex(parsedURI.Path, "."); periodIdx != -1 { - if periodIdx < len(parsedURI.Path)-1 { - m[semconv.AttributeURLExtension] = parsedURI.Path[periodIdx+1:] - } - } - - return m, nil -} - -// urlToMap converts a url.URL to a map, excludes any values that are not set. -func urlToMap(p *url.URL, m map[string]any) (map[string]any, error) { - scheme := p.Scheme - if scheme != "" { - m["scheme"] = scheme - } - - user := p.User.Username() - if user != "" { - m["user"] = user - } - - host := p.Hostname() - if host != "" { - m["host"] = host - } - - port := p.Port() - if port != "" { - m["port"] = port - } - - path := p.EscapedPath() - if path != "" { - m["path"] = path - } - - return queryToMap(p.Query(), m), nil -} - -// queryToMap converts a query string url.Values to a map. -func queryToMap(query url.Values, m map[string]any) map[string]any { - // no-op if query is empty, do not create the key m["query"] - if len(query) == 0 { - return m - } - - /* 'parameter' will represent url.Values - map[string]any{ - "parameter-a": []any{ - "a", - "b", - }, - "parameter-b": []any{ - "x", - "y", - }, - } - */ - parameters := map[string]any{} - for param, values := range query { - parameters[param] = queryParamValuesToMap(values) - } - m["query"] = parameters - return m -} - -// queryParamValuesToMap takes query string parameter values and -// returns an []interface populated with the values -func queryParamValuesToMap(values []string) []any { - v := make([]any, len(values)) - for i, value := range values { - v[i] = value - } - return v -} diff --git a/pkg/stanza/operator/parser/uri/parser_test.go b/pkg/stanza/operator/parser/uri/parser_test.go index 7abdaed1aea7..f6c0290b3f2a 100644 --- a/pkg/stanza/operator/parser/uri/parser_test.go +++ b/pkg/stanza/operator/parser/uri/parser_test.go @@ -5,12 +5,10 @@ package uri import ( "context" - "net/url" "testing" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" - semconv "go.opentelemetry.io/collector/semconv/v1.25.0" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator" @@ -205,288 +203,6 @@ func TestParserParse(t *testing.T) { } } -// Test all usecases: absolute uri, relative uri, query string -func TestParseURI(t *testing.T) { - cases := []struct { - name string - inputBody string - outputBody map[string]any - expectErr bool - }{ - { - "scheme-http", - "http://", - map[string]any{ - "scheme": "http", - }, - false, - }, - { - "scheme-user", - "http://myuser:mypass@", - map[string]any{ - "scheme": "http", - "user": "myuser", - }, - false, - }, - { - "scheme-host", - "http://golang.com", - map[string]any{ - "scheme": "http", - "host": "golang.com", - }, - false, - }, - { - "scheme-host-root", - "http://golang.com/", - map[string]any{ - "scheme": "http", - "host": "golang.com", - "path": "/", - }, - false, - }, - { - "scheme-host-minimal", - "http://golang", - map[string]any{ - "scheme": "http", - "host": "golang", - }, - false, - }, - { - "host-missing-scheme", - "golang.org", - map[string]any{}, - true, - }, - { - "sheme-port", - "http://:8080", - map[string]any{ - "scheme": "http", - "port": "8080", - }, - false, - }, - { - "port-missing-scheme", - ":8080", - map[string]any{}, - true, - }, - { - "path", - "/docs", - map[string]any{ - "path": "/docs", - }, - false, - }, - { - "path-advanced", - `/x/y%2Fz`, - map[string]any{ - "path": `/x/y%2Fz`, - }, - false, - }, - { - "path-root", - "/", - map[string]any{ - "path": "/", - }, - false, - }, - { - "path-query", - "/v1/app?user=golang", - map[string]any{ - "path": "/v1/app", - "query": map[string]any{ - "user": []any{ - "golang", - }, - }, - }, - false, - }, - { - "invalid-query", - "?q;go", - map[string]any{}, - true, - }, - { - "scheme-path", - "http:///v1/app", - map[string]any{ - "scheme": "http", - "path": "/v1/app", - }, - false, - }, - { - "scheme-host-query", - "https://app.com?token=0000&env=prod&env=stage", - map[string]any{ - "scheme": "https", - "host": "app.com", - "query": map[string]any{ - "token": []any{ - "0000", - }, - "env": []any{ - "prod", - "stage", - }, - }, - }, - false, - }, - { - "minimal", - "http://golang.org", - map[string]any{ - "scheme": "http", - "host": "golang.org", - }, - false, - }, - { - "advanced", - "https://go:password@golang.org:8443/v2/app?env=stage&token=456&index=105838&env=prod", - map[string]any{ - "scheme": "https", - "user": "go", - "host": "golang.org", - "port": "8443", - "path": "/v2/app", - "query": map[string]any{ - "token": []any{ - "456", - }, - "index": []any{ - "105838", - }, - "env": []any{ - "stage", - "prod", - }, - }, - }, - false, - }, - { - "magnet", - "magnet:?xt=urn:sha1:HNCKHTQCWBTRNJIV4WNAE52SJUQCZO6C", - map[string]any{ - "scheme": "magnet", - "query": map[string]any{ - "xt": []any{ - "urn:sha1:HNCKHTQCWBTRNJIV4WNAE52SJUQCZO6C", - }, - }, - }, - false, - }, - { - "sftp", - "sftp://ftp.com//home/name/employee.csv", - map[string]any{ - "scheme": "sftp", - "host": "ftp.com", - "path": "//home/name/employee.csv", - }, - false, - }, - { - "missing-schema", - "golang.org/app", - map[string]any{}, - true, - }, - { - "query-advanced", - "?token=0000&env=prod&env=stage&task=update&task=new&action=update", - map[string]any{ - "query": map[string]any{ - "token": []any{ - "0000", - }, - "env": []any{ - "prod", - "stage", - }, - "task": []any{ - "update", - "new", - }, - "action": []any{ - "update", - }, - }, - }, - false, - }, - { - "query", - "?token=0000", - map[string]any{ - "query": map[string]any{ - "token": []any{ - "0000", - }, - }, - }, - false, - }, - { - "query-empty", - "?", - map[string]any{}, - false, - }, - { - "query-empty-key", - "?user=", - map[string]any{ - "query": map[string]any{ - "user": []any{ - "", // no value - }, - }, - }, - false, - }, - // Query string without a ? prefix is treated as a URI, therefor - // an error will be returned by url.Parse("user=dev") - { - "query-no-?-prefix", - "user=dev", - map[string]any{}, - true, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - x, err := ParseURI(tc.inputBody, false) - if tc.expectErr { - require.Error(t, err) - return - } - require.NoError(t, err) - require.Equal(t, tc.outputBody, x) - }) - } -} - func TestBuildParserURL(t *testing.T) { newBasicParser := func() *Config { cfg := NewConfigWithID("test") @@ -502,164 +218,6 @@ func TestBuildParserURL(t *testing.T) { }) } -func TestURLToMap(t *testing.T) { - cases := []struct { - name string - inputBody *url.URL - outputBody map[string]any - }{ - { - "absolute-uri", - &url.URL{ - Scheme: "https", - Host: "google.com:8443", - Path: "/app", - RawQuery: "stage=prod&stage=dev", - }, - map[string]any{ - "scheme": "https", - "host": "google.com", - "port": "8443", - "path": "/app", - "query": map[string]any{ - "stage": []any{ - "prod", - "dev", - }, - }, - }, - }, - { - "absolute-uri-simple", - &url.URL{ - Scheme: "http", - Host: "google.com", - }, - map[string]any{ - "scheme": "http", - "host": "google.com", - }, - }, - { - "path", - &url.URL{ - Path: "/app", - RawQuery: "stage=prod&stage=dev", - }, - map[string]any{ - "path": "/app", - "query": map[string]any{ - "stage": []any{ - "prod", - "dev", - }, - }, - }, - }, - { - "path-simple", - &url.URL{ - Path: "/app", - }, - map[string]any{ - "path": "/app", - }, - }, - { - "query", - &url.URL{ - RawQuery: "stage=prod&stage=dev", - }, - map[string]any{ - "query": map[string]any{ - "stage": []any{ - "prod", - "dev", - }, - }, - }, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - m := make(map[string]any) - resMap, err := urlToMap(tc.inputBody, m) - require.NoError(t, err) - require.Equal(t, tc.outputBody, resMap) - }) - } -} - -func TestQueryToMap(t *testing.T) { - cases := []struct { - name string - inputBody url.Values - outputBody map[string]any - }{ - { - "query", - url.Values{ - "stage": []string{ - "prod", - "dev", - }, - }, - map[string]any{ - "query": map[string]any{ - "stage": []any{ - "prod", - "dev", - }, - }, - }, - }, - { - "empty", - url.Values{}, - map[string]any{}, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - m := make(map[string]any) - require.Equal(t, tc.outputBody, queryToMap(tc.inputBody, m)) - }) - } -} - -func TestQueryParamValuesToMap(t *testing.T) { - cases := []struct { - name string - inputBody []string - outputBody []any - }{ - { - "simple", - []string{ - "prod", - "dev", - }, - []any{ - "prod", - "dev", - }, - }, - { - "empty", - []string{}, - []any{}, - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - require.Equal(t, tc.outputBody, queryParamValuesToMap(tc.inputBody)) - }) - } -} - func BenchmarkParserParse(b *testing.B) { v := "https://dev:password@www.golang.org:8443/v1/app/stage?token=d9e28b1d-2c7b-4853-be6a-d94f34a5d4ab&env=prod&env=stage&token=c6fa29f9-a31b-4584-b98d-aa8473b0e18d®ion=us-east1b&mode=fast" parser := Parser{} @@ -669,184 +227,3 @@ func BenchmarkParserParse(b *testing.B) { } } } - -func BenchmarkURLToMap(b *testing.B) { - m := make(map[string]any) - v := "https://dev:password@www.golang.org:8443/v1/app/stage?token=d9e28b1d-2c7b-4853-be6a-d94f34a5d4ab&env=prod&env=stage&token=c6fa29f9-a31b-4584-b98d-aa8473b0e18d®ion=us-east1b&mode=fast" - u, err := url.ParseRequestURI(v) - if err != nil { - b.Fatal(err) - } - for n := 0; n < b.N; n++ { - _, _ = urlToMap(u, m) - } -} - -func BenchmarkQueryToMap(b *testing.B) { - m := make(map[string]any) - v := "?token=d9e28b1d-2c7b-4853-be6a-d94f34a5d4ab&env=prod&env=stage&token=c6fa29f9-a31b-4584-b98d-aa8473b0e18d®ion=us-east1b&mode=fast" - u, err := url.ParseQuery(v) - if err != nil { - b.Fatal(err) - } - for n := 0; n < b.N; n++ { - queryToMap(u, m) - } -} - -func BenchmarkQueryParamValuesToMap(b *testing.B) { - v := []string{ - "d9e28b1d-2c7b-4853-be6a-d94f34a5d4ab", - "c6fa29f9-a31b-4584-b98d-aa8473b0e18", - } - for n := 0; n < b.N; n++ { - queryParamValuesToMap(v) - } -} - -func TestParseSemconv(t *testing.T) { - testCases := []struct { - Name string - Original string - ExpectedMap map[string]any - }{ - { - "complete example", - "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", - map[string]any{ - semconv.AttributeURLPath: "/foo.gif", - semconv.AttributeURLFragment: "fragment", - semconv.AttributeURLExtension: "gif", - AttributeURLPassword: "mypassword", - semconv.AttributeURLOriginal: "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLPort: 80, - AttributeURLUserInfo: "myusername:mypassword", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLQuery: "key1=val1&key2=val2", - AttributeURLUsername: "myusername", - }, - }, - { - "simple example", - "http://www.example.com", - map[string]any{ - semconv.AttributeURLOriginal: "http://www.example.com", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "", - }, - }, - { - "custom port", - "http://www.example.com:77", - map[string]any{ - semconv.AttributeURLOriginal: "http://www.example.com:77", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "", - semconv.AttributeURLPort: 77, - }, - }, - { - "file", - "http://www.example.com:77/file.png", - map[string]any{ - semconv.AttributeURLOriginal: "http://www.example.com:77/file.png", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/file.png", - semconv.AttributeURLPort: 77, - semconv.AttributeURLExtension: "png", - }, - }, - { - "fragment", - "http://www.example.com:77/foo#bar", - map[string]any{ - semconv.AttributeURLOriginal: "http://www.example.com:77/foo#bar", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/foo", - semconv.AttributeURLPort: 77, - semconv.AttributeURLFragment: "bar", - }, - }, - { - "query example", - "https://www.example.com:77/foo?key=val", - map[string]any{ - semconv.AttributeURLOriginal: "https://www.example.com:77/foo?key=val", - semconv.AttributeURLScheme: "https", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/foo", - semconv.AttributeURLPort: 77, - semconv.AttributeURLQuery: "key=val", - }, - }, - { - "user info", - "https://user:pw@www.example.com:77/foo", - map[string]any{ - semconv.AttributeURLOriginal: "https://user:pw@www.example.com:77/foo", - semconv.AttributeURLScheme: "https", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/foo", - semconv.AttributeURLPort: 77, - AttributeURLUserInfo: "user:pw", - AttributeURLUsername: "user", - AttributeURLPassword: "pw", - }, - }, - { - "user info - no password", - "https://user:@www.example.com:77/foo", - map[string]any{ - semconv.AttributeURLOriginal: "https://user:@www.example.com:77/foo", - semconv.AttributeURLScheme: "https", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/foo", - semconv.AttributeURLPort: 77, - AttributeURLUserInfo: "user:", - AttributeURLUsername: "user", - AttributeURLPassword: "", - }, - }, - { - "non-http scheme: ftp", - "ftp://ftp.is.co.za/rfc/rfc1808.txt", - map[string]any{ - semconv.AttributeURLOriginal: "ftp://ftp.is.co.za/rfc/rfc1808.txt", - semconv.AttributeURLScheme: "ftp", - semconv.AttributeURLPath: "/rfc/rfc1808.txt", - semconv.AttributeURLExtension: "txt", - semconv.AttributeURLDomain: "ftp.is.co.za", - }, - }, - { - "non-http scheme: telnet", - "telnet://192.0.2.16:80/", - map[string]any{ - semconv.AttributeURLOriginal: "telnet://192.0.2.16:80/", - semconv.AttributeURLScheme: "telnet", - semconv.AttributeURLPath: "/", - semconv.AttributeURLPort: 80, - semconv.AttributeURLDomain: "192.0.2.16", - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.Name, func(t *testing.T) { - resMap, err := ParseURI(tc.Original, true) - require.NoError(t, err) - - require.Equal(t, len(tc.ExpectedMap), len(resMap)) - for k, v := range tc.ExpectedMap { - actualValue, found := resMap[k] - require.True(t, found, "key not found %q", k) - require.Equal(t, v, actualValue) - } - }) - } -} From 308c533652500fd9c044cae4f1ca71494d9645fb Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 14 Jun 2024 09:24:59 +0200 Subject: [PATCH 26/36] ottl crosslink --- pkg/ottl/go.mod | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index a1dfc76f4754..08abab513060 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -64,9 +64,3 @@ 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/stanza => ../stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage From 2cde9d7503c785e5415762e248395ea2afdd70d8 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 14 Jun 2024 09:26:39 +0200 Subject: [PATCH 27/36] stanza indirect dependencies removed --- connector/countconnector/go.mod | 10 ---------- connector/countconnector/go.sum | 10 ---------- connector/datadogconnector/go.mod | 3 --- connector/routingconnector/go.mod | 10 ---------- connector/routingconnector/go.sum | 10 ---------- exporter/datadogexporter/integrationtest/go.mod | 3 --- exporter/honeycombmarkerexporter/go.mod | 8 -------- exporter/honeycombmarkerexporter/go.sum | 6 ------ internal/filter/go.mod | 7 ------- internal/filter/go.sum | 4 ---- processor/attributesprocessor/go.mod | 7 ------- processor/attributesprocessor/go.sum | 4 ---- processor/cumulativetodeltaprocessor/go.mod | 6 ------ processor/filterprocessor/go.mod | 7 ------- processor/filterprocessor/go.sum | 4 ---- processor/routingprocessor/go.mod | 8 -------- processor/routingprocessor/go.sum | 6 ------ processor/spanprocessor/go.mod | 8 -------- processor/spanprocessor/go.sum | 6 ------ processor/tailsamplingprocessor/go.mod | 8 -------- processor/tailsamplingprocessor/go.sum | 6 ------ processor/transformprocessor/go.mod | 6 ------ processor/transformprocessor/go.sum | 6 ------ receiver/hostmetricsreceiver/go.mod | 6 ------ 24 files changed, 159 deletions(-) diff --git a/connector/countconnector/go.mod b/connector/countconnector/go.mod index 5b4a6b9efc50..7d981561b7cf 100644 --- a/connector/countconnector/go.mod +++ b/connector/countconnector/go.mod @@ -25,14 +25,12 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -44,7 +42,6 @@ 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.102.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -52,7 +49,6 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect - go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect @@ -85,9 +81,3 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/connector/countconnector/go.sum b/connector/countconnector/go.sum index 2b28fce3f176..723e59ee9ed7 100644 --- a/connector/countconnector/go.sum +++ b/connector/countconnector/go.sum @@ -11,8 +11,6 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= -github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= -github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -29,8 +27,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= @@ -73,8 +69,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -92,8 +86,6 @@ go.opentelemetry.io/collector/connector v0.102.2-0.20240611143128-7dfb57b9ad1c h go.opentelemetry.io/collector/connector v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:6GDuB9stoHIRBPr5Kpbk9ztXBu7U4bMp1nYm56zP1Zs= go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c h1:L/FPXl2OoOKniPw1hYzCOk6eljlcwCC681y4plDDE08= go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:4EV8/Rh+KD6z75EjDDWthN50aFeeRqxsC589EpakV5E= -go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c h1:NL1/iU+6NoZZLxnPMgiML/d5nuYjokRKhSs/+YXkTHs= -go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c h1:f8L2r0f684bJAAZDoTvEWccx34C3kQsePNwy8KzTPqM= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4EegmtiSaOuh6wXWatKIui8xU= @@ -160,7 +152,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index 91e57f3423aa..0e40df474a0a 100644 --- a/connector/datadogconnector/go.mod +++ b/connector/datadogconnector/go.mod @@ -33,8 +33,6 @@ require ( google.golang.org/protobuf v1.34.2 ) -require github.com/expr-lang/expr v1.16.9 // indirect - require ( cloud.google.com/go/compute/metadata v0.3.0 // indirect github.com/DataDog/agent-payload/v5 v5.0.121 // indirect @@ -177,7 +175,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.102.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.102.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 e2321b023204..7d83813c0d2b 100644 --- a/connector/routingconnector/go.mod +++ b/connector/routingconnector/go.mod @@ -21,14 +21,12 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/hashicorp/go-version v1.7.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -39,7 +37,6 @@ 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.102.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -47,7 +44,6 @@ require ( github.com/prometheus/procfs v0.15.0 // indirect go.opentelemetry.io/collector v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect - go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect @@ -73,9 +69,3 @@ 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/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/connector/routingconnector/go.sum b/connector/routingconnector/go.sum index f82f8e1e17eb..749cea76c6a0 100644 --- a/connector/routingconnector/go.sum +++ b/connector/routingconnector/go.sum @@ -12,8 +12,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= -github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -30,8 +28,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -73,8 +69,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -92,8 +86,6 @@ go.opentelemetry.io/collector/connector v0.102.2-0.20240611143128-7dfb57b9ad1c h go.opentelemetry.io/collector/connector v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:6GDuB9stoHIRBPr5Kpbk9ztXBu7U4bMp1nYm56zP1Zs= go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c h1:L/FPXl2OoOKniPw1hYzCOk6eljlcwCC681y4plDDE08= go.opentelemetry.io/collector/consumer v0.102.2-0.20240611143128-7dfb57b9ad1c/go.mod h1:4EV8/Rh+KD6z75EjDDWthN50aFeeRqxsC589EpakV5E= -go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c h1:NL1/iU+6NoZZLxnPMgiML/d5nuYjokRKhSs/+YXkTHs= -go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:PsOINaGgTiFc+Tzu2K/X2jP+Ngmlp7YKGV1XrnBkH7U= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c h1:f8L2r0f684bJAAZDoTvEWccx34C3kQsePNwy8KzTPqM= go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c/go.mod h1:IHxHsp+Jq/xfjORQMDJjSH6jvedOSTOyu3nbxqhWSYE= go.opentelemetry.io/collector/pdata/testdata v0.102.1 h1:S3idZaJxy8M7mCC4PG4EegmtiSaOuh6wXWatKIui8xU= @@ -160,7 +152,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index 5df3307b58c7..7fdabda6a36a 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -27,8 +27,6 @@ require ( google.golang.org/protobuf v1.34.2 ) -require github.com/expr-lang/expr v1.16.9 // indirect - require ( cloud.google.com/go/compute/metadata v0.3.0 // indirect github.com/DataDog/agent-payload/v5 v5.0.121 // indirect @@ -176,7 +174,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.102.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.102.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/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index b5312e08abd3..541b2aa78dff 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -5,7 +5,6 @@ go 1.21.0 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/config/confighttp v0.102.2-0.20240611143128-7dfb57b9ad1c @@ -27,7 +26,6 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/expr-lang/expr v1.16.9 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect @@ -94,9 +92,3 @@ 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/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index fbe960d94933..4fcbb052b58f 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -13,8 +13,6 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= -github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= -github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -85,8 +83,6 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -194,7 +190,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/filter/go.mod b/internal/filter/go.mod index f813ccd3b0c9..cf634359cf2c 100644 --- a/internal/filter/go.mod +++ b/internal/filter/go.mod @@ -39,7 +39,6 @@ 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/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -78,9 +77,3 @@ 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/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/internal/filter/go.sum b/internal/filter/go.sum index dd204346b548..ac8339746bdc 100644 --- a/internal/filter/go.sum +++ b/internal/filter/go.sum @@ -73,8 +73,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -152,7 +150,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/attributesprocessor/go.mod b/processor/attributesprocessor/go.mod index 9c0d5ac90384..bbc49271f570 100644 --- a/processor/attributesprocessor/go.mod +++ b/processor/attributesprocessor/go.mod @@ -44,7 +44,6 @@ 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.102.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -86,9 +85,3 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/attributesprocessor/go.sum b/processor/attributesprocessor/go.sum index ec0c1e3a6704..1cf56bafd80b 100644 --- a/processor/attributesprocessor/go.sum +++ b/processor/attributesprocessor/go.sum @@ -73,8 +73,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -160,7 +158,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/cumulativetodeltaprocessor/go.mod b/processor/cumulativetodeltaprocessor/go.mod index e3245da2b211..818a8e5d64a9 100644 --- a/processor/cumulativetodeltaprocessor/go.mod +++ b/processor/cumulativetodeltaprocessor/go.mod @@ -74,9 +74,3 @@ 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/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/filterprocessor/go.mod b/processor/filterprocessor/go.mod index f012b2677545..2327680fd20a 100644 --- a/processor/filterprocessor/go.mod +++ b/processor/filterprocessor/go.mod @@ -46,7 +46,6 @@ 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.102.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -85,9 +84,3 @@ 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/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common diff --git a/processor/filterprocessor/go.sum b/processor/filterprocessor/go.sum index ec0c1e3a6704..1cf56bafd80b 100644 --- a/processor/filterprocessor/go.sum +++ b/processor/filterprocessor/go.sum @@ -73,8 +73,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -160,7 +158,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/routingprocessor/go.mod b/processor/routingprocessor/go.mod index 3bd03531e1e3..d1d5a6d43e4d 100644 --- a/processor/routingprocessor/go.mod +++ b/processor/routingprocessor/go.mod @@ -29,7 +29,6 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/expr-lang/expr v1.16.9 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -51,7 +50,6 @@ 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.102.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -99,9 +97,3 @@ 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/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/routingprocessor/go.sum b/processor/routingprocessor/go.sum index 8a484f605eec..4b730b241e29 100644 --- a/processor/routingprocessor/go.sum +++ b/processor/routingprocessor/go.sum @@ -13,8 +13,6 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= -github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= -github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -83,8 +81,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -218,7 +214,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/spanprocessor/go.mod b/processor/spanprocessor/go.mod index a3918e03a49d..9656bf633e6e 100644 --- a/processor/spanprocessor/go.mod +++ b/processor/spanprocessor/go.mod @@ -24,7 +24,6 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect @@ -43,7 +42,6 @@ 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.102.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect @@ -86,9 +84,3 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/spanprocessor/go.sum b/processor/spanprocessor/go.sum index ec0c1e3a6704..24029778d96b 100644 --- a/processor/spanprocessor/go.sum +++ b/processor/spanprocessor/go.sum @@ -11,8 +11,6 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= -github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= -github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -73,8 +71,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -160,7 +156,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/tailsamplingprocessor/go.mod b/processor/tailsamplingprocessor/go.mod index 614973b01069..7f777e050b81 100644 --- a/processor/tailsamplingprocessor/go.mod +++ b/processor/tailsamplingprocessor/go.mod @@ -8,7 +8,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c @@ -31,7 +30,6 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect @@ -84,9 +82,3 @@ 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/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common diff --git a/processor/tailsamplingprocessor/go.sum b/processor/tailsamplingprocessor/go.sum index d9ab1400403c..966be72d3d25 100644 --- a/processor/tailsamplingprocessor/go.sum +++ b/processor/tailsamplingprocessor/go.sum @@ -11,8 +11,6 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= -github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= -github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -75,8 +73,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -160,7 +156,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/processor/transformprocessor/go.mod b/processor/transformprocessor/go.mod index 90c324b4944e..f28a47b5eed0 100644 --- a/processor/transformprocessor/go.mod +++ b/processor/transformprocessor/go.mod @@ -7,7 +7,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.102.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.0.0-00010101000000-000000000000 // indirect github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/confmap v0.102.2-0.20240611143128-7dfb57b9ad1c @@ -28,7 +27,6 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/expr-lang/expr v1.16.9 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect @@ -89,7 +87,3 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter => ../../internal/filter - -replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage diff --git a/processor/transformprocessor/go.sum b/processor/transformprocessor/go.sum index ec0c1e3a6704..24029778d96b 100644 --- a/processor/transformprocessor/go.sum +++ b/processor/transformprocessor/go.sum @@ -11,8 +11,6 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= -github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI= -github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -73,8 +71,6 @@ github.com/prometheus/procfs v0.15.0/go.mod h1:Y0RJ/Y5g5wJpkTisOtqwDSo4HwhGmLB4V github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= @@ -160,7 +156,5 @@ google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWn gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/receiver/hostmetricsreceiver/go.mod b/receiver/hostmetricsreceiver/go.mod index b154bb54ec45..c97c30638d16 100644 --- a/receiver/hostmetricsreceiver/go.mod +++ b/receiver/hostmetricsreceiver/go.mod @@ -155,9 +155,3 @@ 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/stanza => ../../pkg/stanza - -replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/common => ../../internal/common - -replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage From 41b5ea42bb8b578be1f815cebf3d8993fcdbd79a Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 14 Jun 2024 09:43:44 +0200 Subject: [PATCH 28/36] import added to parseutils/uri.go --- internal/coreinternal/parseutils/uri.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/coreinternal/parseutils/uri.go b/internal/coreinternal/parseutils/uri.go index f50df032cba1..048e90e38389 100644 --- a/internal/coreinternal/parseutils/uri.go +++ b/internal/coreinternal/parseutils/uri.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package parseutils +package parseutils // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/parseutils" import ( "net/url" From 7155d02f0d1bfac7ca3b6f1d2e66059f9232acd3 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Fri, 14 Jun 2024 10:10:26 +0200 Subject: [PATCH 29/36] stanza go mod --- pkg/stanza/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/stanza/go.mod b/pkg/stanza/go.mod index 7ec689c87c90..e626cebb3d70 100644 --- a/pkg/stanza/go.mod +++ b/pkg/stanza/go.mod @@ -23,7 +23,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/pdata v1.9.1-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/collector/receiver v0.102.2-0.20240611143128-7dfb57b9ad1c - go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c go.opentelemetry.io/otel/metric v1.27.0 go.uber.org/goleak v1.3.0 go.uber.org/multierr v1.11.0 @@ -62,6 +61,7 @@ require ( go.opentelemetry.io/collector v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/config/configopaque v1.9.1-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect + go.opentelemetry.io/collector/semconv v0.102.2-0.20240611143128-7dfb57b9ad1c // indirect go.opentelemetry.io/otel v1.27.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect go.opentelemetry.io/otel/sdk v1.27.0 // indirect From 69b674544359a9a2b650901e5dcb01ce95877730 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Mon, 17 Jun 2024 09:13:12 +0200 Subject: [PATCH 30/36] Update pkg/stanza/operator/parser/uri/parser.go Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> --- pkg/stanza/operator/parser/uri/parser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/stanza/operator/parser/uri/parser.go b/pkg/stanza/operator/parser/uri/parser.go index 4d290b9afcc0..9762c3655951 100644 --- a/pkg/stanza/operator/parser/uri/parser.go +++ b/pkg/stanza/operator/parser/uri/parser.go @@ -23,7 +23,7 @@ func init() { semconvCompliantFeatureGateID, featuregate.StageAlpha, featuregate.WithRegisterDescription("When enabled resulting map will be in semconv compliant format."), - featuregate.WithRegisterFromVersion("0.103.0"), + featuregate.WithRegisterFromVersion("v0.103.0"), ) } From 80773dfdc24392c2ae7247e4f2c3941f2463ff69 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Mon, 17 Jun 2024 09:13:22 +0200 Subject: [PATCH 31/36] Update pkg/ottl/ottlfuncs/func_uri.go Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> --- pkg/ottl/ottlfuncs/func_uri.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go index 55f7a0e39317..c4b4ed4a32cb 100644 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ b/pkg/ottl/ottlfuncs/func_uri.go @@ -36,7 +36,7 @@ func uri[K any](uriSource ottl.StringGetter[K]) ottl.ExprFunc[K] { //revive:disa } if uriString == "" { - return nil, fmt.Errorf("uri cannot be nil") + return nil, fmt.Errorf("uri cannot be empty") } return parseutils.ParseURI(uriString, true) From da2bc40f10da205b8d5db0ba58b1c3822aeab6b2 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Mon, 17 Jun 2024 09:13:30 +0200 Subject: [PATCH 32/36] Update pkg/ottl/ottlfuncs/README.md Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> --- pkg/ottl/ottlfuncs/README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/ottl/ottlfuncs/README.md b/pkg/ottl/ottlfuncs/README.md index 44b8dba63303..628c2cda81e9 100644 --- a/pkg/ottl/ottlfuncs/README.md +++ b/pkg/ottl/ottlfuncs/README.md @@ -1395,17 +1395,17 @@ results in results in ``` - "path": "/foo.gif", - "fragment": "fragment", - "extension": "gif", - "password": "mypassword", - "original": "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", - "scheme": "http", - "port": 80, - "user_info": "myusername:mypassword", - "domain": "www.example.com", - "query": "key1=val1&key2=val2", - "username": "myusername", + "url.path": "/foo.gif", + "url.fragment": "fragment", + "url.extension": "gif", + "url.password": "mypassword", + "url.original": "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + "url.scheme": "http", + "url.port": 80, + "url.user_info": "myusername:mypassword", + "url.domain": "www.example.com", + "url.query": "key1=val1&key2=val2", + "url.username": "myusername", ``` ### UUID From d6a7114c6bff8c9d3533d3fc4ca77431376076a5 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Mon, 17 Jun 2024 09:13:41 +0200 Subject: [PATCH 33/36] Update pkg/ottl/ottlfuncs/README.md Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> --- pkg/ottl/ottlfuncs/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/ottl/ottlfuncs/README.md b/pkg/ottl/ottlfuncs/README.md index 628c2cda81e9..a69fe5a7b357 100644 --- a/pkg/ottl/ottlfuncs/README.md +++ b/pkg/ottl/ottlfuncs/README.md @@ -1385,10 +1385,10 @@ This URI object includes properties for the URI’s domain, path, fragment, port results in ``` - "original": "http://www.example.com", - "scheme": "http", - "domain": "www.example.com", - "path": "", + "url.original": "http://www.example.com", + "url.scheme": "http", + "url.domain": "www.example.com", + "url.path": "", ``` - `URI("http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment")` From 6236224e0e49ecde1317917c4cf76be7418ac557 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Mon, 17 Jun 2024 09:16:39 +0200 Subject: [PATCH 34/36] proper naming, URI vs URL --- pkg/ottl/ottlfuncs/func_uri.go | 44 ------- pkg/ottl/ottlfuncs/func_uri_test.go | 178 ---------------------------- pkg/ottl/ottlfuncs/functions.go | 2 +- 3 files changed, 1 insertion(+), 223 deletions(-) delete mode 100644 pkg/ottl/ottlfuncs/func_uri.go delete mode 100644 pkg/ottl/ottlfuncs/func_uri_test.go diff --git a/pkg/ottl/ottlfuncs/func_uri.go b/pkg/ottl/ottlfuncs/func_uri.go deleted file mode 100644 index c4b4ed4a32cb..000000000000 --- a/pkg/ottl/ottlfuncs/func_uri.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package ottlfuncs // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs" - -import ( - "context" - "fmt" - - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/parseutils" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" -) - -type URIArguments[K any] struct { - URI ottl.StringGetter[K] -} - -func NewURIFactory[K any]() ottl.Factory[K] { - return ottl.NewFactory("URI", &URIArguments[K]{}, createURIFunction[K]) -} - -func createURIFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { - args, ok := oArgs.(*URIArguments[K]) - if !ok { - return nil, fmt.Errorf("URIFactory args must be of type *URIArguments[K]") - } - - return uri(args.URI), nil //revive:disable-line:var-naming -} - -func uri[K any](uriSource ottl.StringGetter[K]) ottl.ExprFunc[K] { //revive:disable-line:var-naming - return func(ctx context.Context, tCtx K) (any, error) { - uriString, err := uriSource.Get(ctx, tCtx) - if err != nil { - return nil, err - } - - if uriString == "" { - return nil, fmt.Errorf("uri cannot be empty") - } - - return parseutils.ParseURI(uriString, true) - } -} diff --git a/pkg/ottl/ottlfuncs/func_uri_test.go b/pkg/ottl/ottlfuncs/func_uri_test.go deleted file mode 100644 index 8e0a45fd9d2f..000000000000 --- a/pkg/ottl/ottlfuncs/func_uri_test.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package ottlfuncs - -import ( - "context" - "testing" - - "github.com/stretchr/testify/require" - semconv "go.opentelemetry.io/collector/semconv/v1.25.0" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" -) - -const ( - // replace once conventions includes these - AttributeURLUserInfo = "url.user_info" - AttributeURLUsername = "url.username" - AttributeURLPassword = "url.password" -) - -func TestURIParser(t *testing.T) { - testCases := []struct { - Name string - Original string - ExpectedMap map[string]any - }{ - { - "complete example", - "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", - map[string]any{ - semconv.AttributeURLPath: "/foo.gif", - semconv.AttributeURLFragment: "fragment", - semconv.AttributeURLExtension: "gif", - AttributeURLPassword: "mypassword", - semconv.AttributeURLOriginal: "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLPort: 80, - AttributeURLUserInfo: "myusername:mypassword", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLQuery: "key1=val1&key2=val2", - AttributeURLUsername: "myusername", - }, - }, - { - "simple example", - "http://www.example.com", - map[string]any{ - semconv.AttributeURLOriginal: "http://www.example.com", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "", - }, - }, - { - "custom port", - "http://www.example.com:77", - map[string]any{ - semconv.AttributeURLOriginal: "http://www.example.com:77", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "", - semconv.AttributeURLPort: 77, - }, - }, - { - "file", - "http://www.example.com:77/file.png", - map[string]any{ - semconv.AttributeURLOriginal: "http://www.example.com:77/file.png", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/file.png", - semconv.AttributeURLPort: 77, - semconv.AttributeURLExtension: "png", - }, - }, - { - "fragment", - "http://www.example.com:77/foo#bar", - map[string]any{ - semconv.AttributeURLOriginal: "http://www.example.com:77/foo#bar", - semconv.AttributeURLScheme: "http", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/foo", - semconv.AttributeURLPort: 77, - semconv.AttributeURLFragment: "bar", - }, - }, - { - "query example", - "https://www.example.com:77/foo?key=val", - map[string]any{ - semconv.AttributeURLOriginal: "https://www.example.com:77/foo?key=val", - semconv.AttributeURLScheme: "https", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/foo", - semconv.AttributeURLPort: 77, - semconv.AttributeURLQuery: "key=val", - }, - }, - { - "user info", - "https://user:pw@www.example.com:77/foo", - map[string]any{ - semconv.AttributeURLOriginal: "https://user:pw@www.example.com:77/foo", - semconv.AttributeURLScheme: "https", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/foo", - semconv.AttributeURLPort: 77, - AttributeURLUserInfo: "user:pw", - AttributeURLUsername: "user", - AttributeURLPassword: "pw", - }, - }, - { - "user info - no password", - "https://user:@www.example.com:77/foo", - map[string]any{ - semconv.AttributeURLOriginal: "https://user:@www.example.com:77/foo", - semconv.AttributeURLScheme: "https", - semconv.AttributeURLDomain: "www.example.com", - semconv.AttributeURLPath: "/foo", - semconv.AttributeURLPort: 77, - AttributeURLUserInfo: "user:", - AttributeURLUsername: "user", - AttributeURLPassword: "", - }, - }, - { - "non-http scheme: ftp", - "ftp://ftp.is.co.za/rfc/rfc1808.txt", - map[string]any{ - semconv.AttributeURLOriginal: "ftp://ftp.is.co.za/rfc/rfc1808.txt", - semconv.AttributeURLScheme: "ftp", - semconv.AttributeURLPath: "/rfc/rfc1808.txt", - semconv.AttributeURLExtension: "txt", - semconv.AttributeURLDomain: "ftp.is.co.za", - }, - }, - { - "non-http scheme: telnet", - "telnet://192.0.2.16:80/", - map[string]any{ - semconv.AttributeURLOriginal: "telnet://192.0.2.16:80/", - semconv.AttributeURLScheme: "telnet", - semconv.AttributeURLPath: "/", - semconv.AttributeURLPort: 80, - semconv.AttributeURLDomain: "192.0.2.16", - }, - }, - } - - for _, tc := range testCases { - t.Run(tc.Name, func(t *testing.T) { - source := &ottl.StandardStringGetter[any]{ - Getter: func(_ context.Context, _ any) (any, error) { - return tc.Original, nil - }, - } - - exprFunc := uri(source) //revive:disable-line:var-naming - res, err := exprFunc(context.Background(), nil) - require.NoError(t, err) - - resMap, ok := res.(map[string]any) - require.True(t, ok) - - require.Equal(t, len(tc.ExpectedMap), len(resMap)) - for k, v := range tc.ExpectedMap { - actualValue, found := resMap[k] - require.True(t, found, "key not found %q", k) - require.Equal(t, v, actualValue) - } - }) - } -} diff --git a/pkg/ottl/ottlfuncs/functions.go b/pkg/ottl/ottlfuncs/functions.go index 9ff7a407bb1a..a4a635a7d591 100644 --- a/pkg/ottl/ottlfuncs/functions.go +++ b/pkg/ottl/ottlfuncs/functions.go @@ -83,7 +83,7 @@ func converters[K any]() []ottl.Factory[K] { NewUnixNanoFactory[K](), NewUnixSecondsFactory[K](), NewUUIDFactory[K](), - NewURIFactory[K](), + NewURLFactory[K](), NewAppendFactory[K](), NewYearFactory[K](), } From 1e2c2daf14b1eb484e7dfbc127546b0b21e754b7 Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Mon, 17 Jun 2024 09:18:13 +0200 Subject: [PATCH 35/36] updated docs --- pkg/ottl/ottlfuncs/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/ottl/ottlfuncs/README.md b/pkg/ottl/ottlfuncs/README.md index a69fe5a7b357..1562a17e5573 100644 --- a/pkg/ottl/ottlfuncs/README.md +++ b/pkg/ottl/ottlfuncs/README.md @@ -1370,18 +1370,18 @@ Examples: - `UnixSeconds(Time("02/04/2023", "%m/%d/%Y"))` -### URI +### URL -`URI(uri_string)` +`URL(url_string)` -Parses a Uniform Resource Identifier (URI) string and extracts its components as an object. -This URI object includes properties for the URI’s domain, path, fragment, port, query, scheme, user info, username, and password. +Parses a Uniform Resource Locator (URL) string and extracts its components as an object. +This URL object includes properties for the URL’s domain, path, fragment, port, query, scheme, user info, username, and password. `original`, `domain`, `scheme`, and `path` are always present. Other properties are present only if they have corresponding values. -`uri_string` is a `string`. +`url_string` is a `string`. -- `URI("http://www.example.com")` +- `URL("http://www.example.com")` results in ``` @@ -1391,7 +1391,7 @@ results in "url.path": "", ``` -- `URI("http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment")` +- `URL("http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment")` results in ``` From e925180ba65899ee94f5fb81e40bd8aebe88532e Mon Sep 17 00:00:00 2001 From: Michal Pristas Date: Mon, 17 Jun 2024 09:43:45 +0200 Subject: [PATCH 36/36] missing files after rename --- pkg/ottl/ottlfuncs/func_url.go | 44 +++++++ pkg/ottl/ottlfuncs/func_url_test.go | 178 ++++++++++++++++++++++++++++ 2 files changed, 222 insertions(+) create mode 100644 pkg/ottl/ottlfuncs/func_url.go create mode 100644 pkg/ottl/ottlfuncs/func_url_test.go diff --git a/pkg/ottl/ottlfuncs/func_url.go b/pkg/ottl/ottlfuncs/func_url.go new file mode 100644 index 000000000000..371576bb0249 --- /dev/null +++ b/pkg/ottl/ottlfuncs/func_url.go @@ -0,0 +1,44 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package ottlfuncs // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottlfuncs" + +import ( + "context" + "fmt" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/parseutils" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" +) + +type URLArguments[K any] struct { + URI ottl.StringGetter[K] +} + +func NewURLFactory[K any]() ottl.Factory[K] { + return ottl.NewFactory("URL", &URLArguments[K]{}, createURIFunction[K]) +} + +func createURIFunction[K any](_ ottl.FunctionContext, oArgs ottl.Arguments) (ottl.ExprFunc[K], error) { + args, ok := oArgs.(*URLArguments[K]) + if !ok { + return nil, fmt.Errorf("URLFactory args must be of type *URLArguments[K]") + } + + return url(args.URI), nil //revive:disable-line:var-naming +} + +func url[K any](uriSource ottl.StringGetter[K]) ottl.ExprFunc[K] { //revive:disable-line:var-naming + return func(ctx context.Context, tCtx K) (any, error) { + urlString, err := uriSource.Get(ctx, tCtx) + if err != nil { + return nil, err + } + + if urlString == "" { + return nil, fmt.Errorf("url cannot be empty") + } + + return parseutils.ParseURI(urlString, true) + } +} diff --git a/pkg/ottl/ottlfuncs/func_url_test.go b/pkg/ottl/ottlfuncs/func_url_test.go new file mode 100644 index 000000000000..5990a3693ba4 --- /dev/null +++ b/pkg/ottl/ottlfuncs/func_url_test.go @@ -0,0 +1,178 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package ottlfuncs + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + semconv "go.opentelemetry.io/collector/semconv/v1.25.0" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" +) + +const ( + // replace once conventions includes these + AttributeURLUserInfo = "url.user_info" + AttributeURLUsername = "url.username" + AttributeURLPassword = "url.password" +) + +func TestURLParser(t *testing.T) { + testCases := []struct { + Name string + Original string + ExpectedMap map[string]any + }{ + { + "complete example", + "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + map[string]any{ + semconv.AttributeURLPath: "/foo.gif", + semconv.AttributeURLFragment: "fragment", + semconv.AttributeURLExtension: "gif", + AttributeURLPassword: "mypassword", + semconv.AttributeURLOriginal: "http://myusername:mypassword@www.example.com:80/foo.gif?key1=val1&key2=val2#fragment", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLPort: 80, + AttributeURLUserInfo: "myusername:mypassword", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLQuery: "key1=val1&key2=val2", + AttributeURLUsername: "myusername", + }, + }, + { + "simple example", + "http://www.example.com", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "", + }, + }, + { + "custom port", + "http://www.example.com:77", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com:77", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "", + semconv.AttributeURLPort: 77, + }, + }, + { + "file", + "http://www.example.com:77/file.png", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com:77/file.png", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/file.png", + semconv.AttributeURLPort: 77, + semconv.AttributeURLExtension: "png", + }, + }, + { + "fragment", + "http://www.example.com:77/foo#bar", + map[string]any{ + semconv.AttributeURLOriginal: "http://www.example.com:77/foo#bar", + semconv.AttributeURLScheme: "http", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + semconv.AttributeURLFragment: "bar", + }, + }, + { + "query example", + "https://www.example.com:77/foo?key=val", + map[string]any{ + semconv.AttributeURLOriginal: "https://www.example.com:77/foo?key=val", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + semconv.AttributeURLQuery: "key=val", + }, + }, + { + "user info", + "https://user:pw@www.example.com:77/foo", + map[string]any{ + semconv.AttributeURLOriginal: "https://user:pw@www.example.com:77/foo", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + AttributeURLUserInfo: "user:pw", + AttributeURLUsername: "user", + AttributeURLPassword: "pw", + }, + }, + { + "user info - no password", + "https://user:@www.example.com:77/foo", + map[string]any{ + semconv.AttributeURLOriginal: "https://user:@www.example.com:77/foo", + semconv.AttributeURLScheme: "https", + semconv.AttributeURLDomain: "www.example.com", + semconv.AttributeURLPath: "/foo", + semconv.AttributeURLPort: 77, + AttributeURLUserInfo: "user:", + AttributeURLUsername: "user", + AttributeURLPassword: "", + }, + }, + { + "non-http scheme: ftp", + "ftp://ftp.is.co.za/rfc/rfc1808.txt", + map[string]any{ + semconv.AttributeURLOriginal: "ftp://ftp.is.co.za/rfc/rfc1808.txt", + semconv.AttributeURLScheme: "ftp", + semconv.AttributeURLPath: "/rfc/rfc1808.txt", + semconv.AttributeURLExtension: "txt", + semconv.AttributeURLDomain: "ftp.is.co.za", + }, + }, + { + "non-http scheme: telnet", + "telnet://192.0.2.16:80/", + map[string]any{ + semconv.AttributeURLOriginal: "telnet://192.0.2.16:80/", + semconv.AttributeURLScheme: "telnet", + semconv.AttributeURLPath: "/", + semconv.AttributeURLPort: 80, + semconv.AttributeURLDomain: "192.0.2.16", + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.Name, func(t *testing.T) { + source := &ottl.StandardStringGetter[any]{ + Getter: func(_ context.Context, _ any) (any, error) { + return tc.Original, nil + }, + } + + exprFunc := url(source) //revive:disable-line:var-naming + res, err := exprFunc(context.Background(), nil) + require.NoError(t, err) + + resMap, ok := res.(map[string]any) + require.True(t, ok) + + require.Equal(t, len(tc.ExpectedMap), len(resMap)) + for k, v := range tc.ExpectedMap { + actualValue, found := resMap[k] + require.True(t, found, "key not found %q", k) + require.Equal(t, v, actualValue) + } + }) + } +}