Skip to content
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] add User Agent parsing #34172

Merged
merged 20 commits into from
Aug 21, 2024

Conversation

pchila
Copy link
Contributor

@pchila pchila commented Jul 19, 2024

Description:

Added a new ottl converter UserAgent: it parses an input string and matches against a set of known UA regexes to correctly identify user agent and its version
Link to tracking Issue: #32434

Testing: Unit tests, E2E tests

Documentation: Added UserAgent description in pkg/ottl/ottlfuncs/README.md

Copy link

linux-foundation-easycla bot commented Jul 19, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@ycombinator
Copy link
Contributor

Hi @atoulme, @TylerHelmuth, @bogdandrutu, or @evan-bradley, this PR is failing CI on the license/snyk and security/snyk checks. I'm unable to view the details for either. I tried to auth into Snyk using GitHub but it says I'm not a member of the organization. Just a heads up that I've requested access. Thanks.

Copy link
Contributor

github-actions bot commented Aug 9, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Aug 9, 2024
@TylerHelmuth
Copy link
Member

@pchila please handle the merge conflicts and merge in the latest from main

@pchila
Copy link
Contributor Author

pchila commented Aug 9, 2024

@pchila please handle the merge conflicts and merge in the latest from main
Done and pushed

pkg/ottl/ottlfuncs/README.md Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/func_useragent.go Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/func_useragent.go Outdated Show resolved Hide resolved
pkg/ottl/ottlfuncs/func_useragent_test.go Show resolved Hide resolved
pkg/ottl/go.mod Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the Stale label Aug 10, 2024
pchila and others added 6 commits August 12, 2024 13:52
Initialize a `uaparser.Parser` instance at the first UserAgent call and
reuse it instead of creating a new parser for every invocation.
Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
This reverts commit 6ac23c0. going for
a simpler solution where the useragent parser is instantiated just
before returning the anonymous ottl.ExprFunc[K] that uses it.
This will prevent re-instantating the parser at each `UserAgent(...)`
invocation.
@TylerHelmuth
Copy link
Member

@pchila we just had a release so there is a new merge conflict to handle.

@TylerHelmuth
Copy link
Member

@pchila needs a changelog then we'll be good to go

@pchila
Copy link
Contributor Author

pchila commented Aug 20, 2024

@TylerHelmuth added the changelog and now all the checks are green 🎉

@TylerHelmuth
Copy link
Member

Looks like your new dependency is conflicting with a renovatebot update that was merged.

@andrzej-stencel andrzej-stencel merged commit 19e447e into open-telemetry:main Aug 21, 2024
156 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 21, 2024
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
Added a new ottl converter `UserAgent`: it parses an input string and
matches against a [set of known UA
regexes](https://github.com/ua-parser/uap-core/blob/master/regexes.yaml)
to correctly identify user agent and its version
**Link to tracking Issue:** open-telemetry#32434 

**Testing:** Unit tests, E2E tests

**Documentation:** <Describe the documentation added.> Added UserAgent
description in `pkg/ottl/ottlfuncs/README.md`

---------

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants