-
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
use pathname as transaction name for route change #297
Comments
In case anyone else comes here looking for a quick workaround; apmAgent.observe('transaction:start', (transaction) => {
if (transaction.type === 'route-change' && transaction.name === 'Unknown') {
transaction.name = window.location.pathname
}
}); |
@pgross41 Yeah thats a nice workaround and it should work. But its required only if you are not using one of our supported framework integrations https://www.elastic.co/guide/en/apm/agent/rum-js/current/framework-integrations.html If you use the framework integrations, the path would be automatically picked up by the RUM agent and transaction names would be set accordingly. const routes - [blog/122, blog/214, blog/342]
// 3 transactions with workaround
/blog/122
/blog/214
/blog/342
// framework integrations
/blog/:id |
I'm also having the same issue and I'm using the react implementation and I have tried with both |
title
from thehistory.pushState
as the transaction name. Instead we need to usepath
as the default transaction name.Scenario (SPA)
www.example.com
Note: Title is also ignored by some browsers(FF)
Right now our transactions are named as UNKNOWN which does not give much benefit for the user. Instead we could have transaction name as /a. To handle cardinality problems, We can remove query params and other hashes from the URL. We can add the full URL to the context object.
If you want to test real website.
/cc @jahtalab @roncohen
The text was updated successfully, but these errors were encountered: