question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve paramaterization of transaction names

See original GitHub issue

Describe the idea

We need to revisit how the JS SDK captures transactions (URL routes) and sends them to sentry.

Reasons for doing this and things we need to consider:

  • parameterization: We should parameterize URLs whenever possible

Because

  • grouping: transaction name influences transaction grouping; raw URL names lead to ungroupted transactions
  • indexing and high cardinality: Raw URL transaction names lead to a high cardinality of transactions (because they’re not grouped)
  • PII: Raw URL transaction names can contain sensitive data/PII (e.g. IDs, auth tokens, etc.)
  • Dynamic Sampling: Propagating raw URLs in DSC vs. showing parameterized routes in the Sentry UI (and the DS settings) creates a lot of user confusion

Best effort has been decent so far, but the fallback to unparameterized or whole URL maybe sub-optimal.

Examples:

  • Low-cardinality transaction name:
    • {"transaction": "/users/{username}", "transaction_source": "route"}
  • Presumably a high-cardinality transaction name:
    • {"transaction": "/users/123235", "transaction_source": "uri"}
  • User-defined transaction name, cardinality unknown:
    • {"transaction": "my_transaction_name", "transaction_source": "custom"}

Requirement:

what should be sent and where?

baggage header

  • error envelope payload
  • in the envelope header

Possible implementation

There’s a couple of things we can do or at least check:

Existing Routing Instrumentations with parameterization

As listed in #5345, we have a lot of popular routers covered with routing instrumentations. However, we might be able to improve paramenterizations in some of them. Hence, for each instrumentation

  • check if there is a way to parameterize earlier
  • try to match routes better (if it turns out that there are cases where our current matching fails)
  • (send source information; tracked in #5345)

Existing Routing Instrumentations without parameterization

TODO: Check to which routers this applies

There are some routing instrumentations that don’t parameterize currently.

  • add parameterization whenever possible

TBD: Approximative Parameterization

This has been discussed quite a bit in the past but given that we have to make our best effort for parameterization, let’s revisit this topic. The idea is seemingly simple: We could try to add a mechanism that takes a raw URL and tries to guess parts of that URL that might be parameters (e.g. IDs, tokens, etc). The mechanism would then replace these parts with a generic param placeholder.

Example:

/users/1235/credentials ==> users/:id/credentials

There are a lot of possible issues with this because obviously, there are going to be loads of edge cases, where this approximation might be off or miss parameters completely.

Why is this challenging?

  • In the product, we have to explain why DSC might have another (or no) transaction name than what’s visible in the UI
  • We have to explain why unparameterized routes are sent and even full URLs.
  • Some frameworks and routers provide unique challenges
  • What about custom routing instrumentations we don’t control?

Places to improve parameterization

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Lms24commented, Jul 27, 2022

Hi @jamesbvaughan, would you mind opening a dedicated issue for this? Makes it easier to track this for us. cc @AbhiPrasad maybe you have a quick idea?

1reaction
Lms24commented, Jul 6, 2022

Always happy to refine/discuss this. Since this became a very important issue, we should sync with everyone here who has context on how transaction names/parameterization/routing instrumentation currently works

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transactions names with parameters - Micro Focus Community
I stored the names in a data file, linked it through a parameter, and used the parameter to define the transactions names.
Read more >
Parameterization, Functions, Transactions in LoadRunner
Parameterization is useful in sending dynamic (or unique) values to the server, for example; a business process is desired to run 10 iterations ......
Read more >
Parameterization of Transaction Groups - Inductive Automation
Allow for parameterization of tags within a transaction group similar to a Data Type so that it is easy to duplicate transaction groups...
Read more >
How to increase Processes, Sessions and Transactions ...
select name, value FROM v$parameter where name in ('sessions','processes','transactions') order by name;. If we are planning to increase ...
Read more >
VuGen: Dynamic Transactions Created From A Parameter File
Based on the search item I choose, I want a different transaction. This pulls the transaction name from parameter file and generates the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found