-
Notifications
You must be signed in to change notification settings - Fork 135
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
feat(rum): categorize transactions based on current url #827
Conversation
💚 Build SucceededExpand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a decent approach to me, particularly because it's easy to override in cases where this approach doesn't work.
What do you think about adding the function to the agent API, so folks can call it directly with a greater depth as needed?
@axw Good suggestion, I am just worried about one thing though. If it creates too much cardinality in transaction name and our metrics based approach in APM UI might suffer due to the consequence of this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vigneshshanmugam , I'm a bit concerned about the performance impacts of this, we should run some benchmarks to make sure. we should probably use 3 url parts instead of 2, it's only my gut feeling that 2 is too small 😃
Also I think we can move this into utils, I don't think a separate file is needed.
@axw , We've discussed the approach here and it seems there are some benefits on putting this logic in APM server. Since the logic here is used in aggregation and that should be tied to the stack version. WDYT? This logic is also useful for replacing the unknown transactions, maybe that can also be done in the apm server or we can keep it in the agent. |
Fair enough. I'm a bit worried that people who can't use this approach, with a fixed depth of 2 (or 3), will revert to using the whole path. I guess we can deal with that if it later though, if it does become a problem.
What are those benefits? Performance? I'd be interested to know what the overhead of this is; it's only for page loads, so doesn't seem like it would be significant. On the other hand, pushing it to the server means concentrating the performance cost, which might end up very expensive when your application has many users. To me it feels simpler overall to set it in the agent, as it's just another agent as far as the server is concerned. Setting it in the agent provides greater flexibility, whereas the server would have only limited configuration; we wouldn't be adding arbitrary script execution. I'd also be a bit wary of creating an expectation of transaction name overriding for non-RUM, which won't work because of client-side breakdown aggregations. |
@axw , the main benefit of having this on the Apm server is alignment with the stack version release, in other words since this is used by the apm server for aggregation, any changes to this logic will affect the results that are stored in ES and therefore should be released with proper versioning (e.g. if there's a breaking change). If this doesn't seem like an issue to you, I'm ok with moving forward with the current implementation. The performance on the agent side is not a big concern (although we will verify this with numbers) |
Transaction names have always been used for grouping and aggregation (in the UI), so I don't see a need to tie this to a stack version. I'm happy to continue with the current approach. |
Yeah we can detect the whole path usage and can apply the same
I will post the numbers. But last time i checked, it wasn't hitting us hard. |
Benchmark numbers
Here are the results {
mean: 0.004329631194898993,
median: 0.001528,
p75: 2.633728,
p90: 2.633728,
p99: 2.633728
} The impact is super minimal and it will not affect the agent code that much as we still would ask the user to set the |
625d80d
to
3bce98b
Compare
📦 Bundlesize report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vigneshshanmugam what do you think about moving slugify into utils?
@jahtalab I thought about it, Utils file in itself is so huge and putting this functionality there would increase it more and makes it bit harder to glimpse through. I am in favor of keeping it separate file as its more cleaner. |
Codecov Report
@@ Coverage Diff @@
## master #827 +/- ##
==========================================
+ Coverage 92.94% 92.99% +0.04%
==========================================
Files 50 51 +1
Lines 2283 2311 +28
Branches 458 466 +8
==========================================
+ Hits 2122 2149 +27
- Misses 158 159 +1
Partials 3 3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We decided to move slugify to url.js
I will do the docs change on a separate PR. |
* upstream/master: feat(rum): categorize transactions based on current url (elastic#827)
* feat(rum): categorize transactions based on current url * chore: address review * chore: fix redefined transactions * chore: move slug to url.js
UNKNOWN
.2
which means/a/b/c/d
would become/a/b/*
. The reasoning for depth to be 2 and not 1 is because most websites uses locale as the first depth in the URL tree so we want to categorize them better upfront than just printing locales in transaction./1234/product
->/:id/*
Please see the test cases for more in-depth overview.
The algorithm seems to be work for most of the websites i have tested by using a crawler. The setup is here if you want to play around.