-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pkg/ottl] parse uri string to url.* SemConv attributes #32906
[pkg/ottl] parse uri string to url.* SemConv attributes #32906
Conversation
Co-authored-by: Tiffany Hrabusa <[email protected]>
…tor-contrib into ottl/uri-parser
…try-collector-contrib into ottl/uri-parser
Co-authored-by: Evan Bradley <[email protected]>
…tor-contrib into ottl/uri-parser
…try-collector-contrib into ottl/uri-parser
…tor-contrib into ottl/uri-parser
@djaglowski i moved implementation of the uri parser to stanza uri parser with a conditional for current behavior and new semconv aligned behavior. please let me know if this is ok or we should extract even more outside |
The implementation looks good to me but in the past we've avoided making ottl dependent on stanza by moving code to a shared package. e.g. https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/internal/coreinternal/parseutils |
will move it somewhere there, thanks |
@djaglowski moved it to |
Co-authored-by: Evan Bradley <[email protected]>
Co-authored-by: Evan Bradley <[email protected]>
Co-authored-by: Evan Bradley <[email protected]>
Co-authored-by: Evan Bradley <[email protected]>
Description:
This ottl converter converts uri string into SemConv attributes.
Instead of using regex it uses
uri.Parse
providing nicer shorthand.Link to tracking Issue: #32433
Testing: unit test added
Documentation: readme updated with:
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
andpath
are always present, other are present only if they have corresponding values.uri_string
is astring
.Uri("http://www.example.com")
results in
Uri("http://myusername:[email protected]:80/foo.gif?key1=val1&key2=val2#fragment")
results in