-
Notifications
You must be signed in to change notification settings - Fork 104
Description
Description:
The goal of this improvement is to prevent transactions from being incorrectly linked to dropped profiles in continuous profiling.
Problem:
When a project is rate-limited for profile-chunk items, the incoming profile is dropped. However, the associated transaction payload, which is sent separately, still contains the profile context. This leads to a poor user experience:
- The transaction appears in the profiling dashboard as having an associated profile.
- When the user clicks on the transaction, they are redirected to a profile page that fails to load because the profile was dropped.
This issue is specific to continuous profiling, as the profile and transaction payloads are sent independently. In contrast, for transaction-based profiling, the profile and transaction are sent in the same envelope, allowing the profile context to be stripped out if the profile is dropped.
Proposed Solution:
To address this, we should strip the profile context from the transaction payload whenever the project's profile-chunk item type is rate-limited. This will ensure that transactions are not incorrectly linked to profiles that have been dropped.
A key consideration for the implementation is that the profile context is propagated from the transaction to all spans. Therefore, removing the context at the transaction level is the most efficient approach, as it prevents the need for removing it from individual spans later in the processing pipeline.
This change will not solve all cases where a profile might be dropped, but it provides a reliable and clear solution for a common scenario.
Example of Profile Context:
"contexts": {
"profile": {
"profiler_id": "f432f65a05ff4b0ba2b3ea66f0cb9964",
"type": "profile"
}
}