Skip to content
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(server): Add rule id to outcomes coming from transaction sampling #953

Merged
merged 7 commits into from
Mar 22, 2021

Conversation

RaduW
Copy link
Contributor

@RaduW RaduW commented Mar 18, 2021

This PR adds rule ids to outcomes for transactions that were dropped due to transaction sampling.
The outcomes from these events has also changed from 3 (Invalid) to 1 (Filtered).

@RaduW RaduW marked this pull request as ready for review March 19, 2021 16:08
@RaduW RaduW requested review from a team and jan-auer March 19, 2021 16:08
Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied a few simplifications while reviewing. G2G 👍

@@ -211,6 +215,46 @@ mod tests {
}
}

/// ugly hack to build an envelope with an optional trace context
fn new_envelope(with_trace_context: bool) -> Envelope {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a follow-up: Constructing a raw envelope like this for tests is not very ergonomic. I think we should invest more in the testing facilities.

We have a few envelope tests that already create envelopes like this one.

The same goes for project configuration above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I toyed with the idea making some members public in order to construct what I needed easier, but I decided that it would need a bit more careful consideration and went for a brute force approach in tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, rather than making members public we should create a good interface. We'll need similar facilities for testing metrics, so I can look into that.

if !should_sample {
// finally we decided that we should sample the transaction
if let SamplingResult::Drop(rule_id) = trace_context.should_keep(client_ip, sampling_config) {
// TODO: Remove event-dependent items similar to `EnvelopeLimiter`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that we don't drop dependents when we drop the transaction. It is unrelated to this change, however, so let's fix this in a follow-up.

@RaduW RaduW merged commit 1bd6764 into master Mar 22, 2021
@RaduW RaduW deleted the feat/sampling-outcome-2 branch March 22, 2021 17:35
jan-auer added a commit that referenced this pull request Mar 26, 2021
* master:
  fix(server): Remove dependent items from envelope when dropping transaction item (#960)
  fix(clippy): Fix clippy 1.51.0 warnings (#965)
  feat(server): Add support for breakdowns ingestion (#934)
  build: Update schemars and remove workarounds (#961)
  feat(server): Add rule id to outcomes coming from transaction sampling (#953)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants