-
Notifications
You must be signed in to change notification settings - Fork 103
feat(server): parametrize dsc transaction #3141
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
Conversation
if !self.name_config.rules.is_empty() { | ||
self.apply_transaction_rename_rule(&mut event.transaction); | ||
} | ||
normalize_transaction_name(&mut event.transaction, self.name_config.rules); |
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.
extracted for re-use with dsc
/// | ||
/// Note: we add `/` at the end of the transaction name if there isn't one, to make sure that | ||
/// patterns like `/<something>/*/**` where we have `**` at the end are a match. | ||
pub fn apply_transaction_rename_rules( |
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.
unchanged, just moved
&self, | ||
state: &mut ProcessEnvelopeState<G>, | ||
) -> Result<(), ProcessingError> { | ||
let project_state = Arc::clone(&state.project_state); |
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.
Do we need the clone here?
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.
In the current setup, yes, because we need mutable reference to ProcessEnvelopeState
to mutate the envelope, and the rules are inside the project state, so we'd get a cannot borrow mutable because its also borrowed as immutable
error
Co-authored-by: Joris Bayer <[email protected]>
envelope = Envelope() | ||
transaction_event, trace_id, _ = _create_transaction_item() | ||
envelope.add_transaction(transaction_event) | ||
_add_trace_info(envelope, trace_id, public_key, transaction=original_transaction) |
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 should add a second project config that contains the txNameRules and pass its project key here, to test that the normalization uses the correct config.
sampling_config["config"]["txNameRules"] = [ | ||
{ | ||
"pattern": pattern, | ||
"expiry": "3022-11-30T00:00:00.000000Z", |
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.
note: test will fail 998 years from now
#2068
Parametrizes the root transaction of a DSC so that trace rules can match on the parametrized version of transaction names