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 support for breakdowns ingestion #934

Merged
merged 79 commits into from
Mar 25, 2021

Conversation

dashed
Copy link
Member

@dashed dashed commented Feb 22, 2021

Reference: https://getsentry.atlassian.net/browse/VIS-617

Breakdowns are product-defined numbers that are indirectly reported by the client, and are materialized during ingestion. (credit to @jan-auer for this definition)

This PR contains the following changes:

  1. Add breakdowns as a top-level optional field to the event schema.
  2. Normalize events to materialize and emit breakdowns based on a given project breakdown configuration.
  3. For the initial implementation, span ops breakdowns will be emitted for transaction events.A default list will be provided in feat: Return default operation breakdown list from project options sentry#24025

TODO

@dashed dashed requested a review from a team February 22, 2021 21:40
@dashed dashed self-assigned this Feb 22, 2021
@dashed dashed requested a review from a team February 23, 2021 00:50
@dashed dashed force-pushed the generate-operation-breakdowns branch 2 times, most recently from 7af00e6 to 05f7067 Compare February 24, 2021 18:49
@dashed dashed force-pushed the generate-operation-breakdowns branch from 05f7067 to ad5f422 Compare February 26, 2021 21:18
@dashed dashed marked this pull request as ready for review February 26, 2021 22:54
@dashed
Copy link
Member Author

dashed commented Mar 18, 2021

@untitaker @jan-auer A heads up, I've updated the Measurements type to be generic. In addition, the span op breakdowns will emit timestamp deltas in nanoseconds.

@jan-auer jan-auer changed the title feat(server): Add support for breakdowns ingestion. feat(server): Add support for breakdowns ingestion Mar 22, 2021
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.

Alright, this looks good. A number of suggestions below, and then going for the final review pass.

relay-general/src/protocol/breakdowns.rs Outdated Show resolved Hide resolved
relay-general/src/protocol/breakdowns.rs Outdated Show resolved Hide resolved
relay-general/src/protocol/breakdowns.rs Outdated Show resolved Hide resolved
relay-general/src/protocol/breakdowns.rs Outdated Show resolved Hide resolved
relay-general/src/protocol/breakdowns.rs Outdated Show resolved Hide resolved
relay-general/src/protocol/breakdowns.rs Outdated Show resolved Hide resolved
relay-general/src/protocol/breakdowns.rs Outdated Show resolved Hide resolved
relay-general/src/store/mod.rs Outdated Show resolved Hide resolved
relay-general/src/protocol/breakdowns.rs Outdated Show resolved Hide resolved
transaction_item = generate_transaction_item()
transaction_item.update(
{
"breakdowns": {"span_ops": {"lcp": {"value": 202.1},}},
Copy link
Member

Choose a reason for hiding this comment

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

Why are you setting this above just to override it here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@k-fish Unsure what you mean. Events might arrive to Relay with breakdown values; this test is to demonstrate that breakdown objects are recursively merged instead of overwritten.

Copy link
Member

Choose a reason for hiding this comment

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

Ahhh I see. I didn't know the intent was to test the recursive merge. That makes sense then 👍

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.

Thank you, @dashed!

impl Breakdowns {
pub fn is_valid_breakdown_name(name: &str) -> bool {
name.chars()
.all(|c| matches!(c, 'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' | '.'))
Copy link
Member

Choose a reason for hiding this comment

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

Note that this doesn't require the first character to be a letter, which would be a usual requirement.

relay-general/src/protocol/measurements.rs Outdated Show resolved Hide resolved
@dashed dashed merged commit 810d953 into master Mar 25, 2021
@dashed dashed deleted the generate-operation-breakdowns branch March 25, 2021 13:57
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.

6 participants