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

ref(breakdowns): All fields in breakdown config should be camelCase, and rename the breakdown key name in project options. #1020

Merged
merged 13 commits into from
Jun 16, 2021

Conversation

dashed
Copy link
Member

@dashed dashed commented Jun 14, 2021

Replacement for #993 with applied suggestions:

  • Hard rename the breakdown key in project state options from breakdown to breakdown_v2 (Sentry will provide the config using its camel-case name breakdownV2).

  • I've added the serde attribute to catch for all unknown enum variants for enum BreakdownConfig.

@dashed dashed requested review from untitaker and a team June 14, 2021 20:14
@dashed dashed self-assigned this Jun 14, 2021
@@ -202,15 +202,19 @@ impl EmitBreakdowns for SpanOperationsConfig {

/// Configuration to define breakdown to be generated based on properties and breakdown type.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
#[serde(tag = "type", rename_all = "camelCase")]
pub enum BreakdownConfig {
Copy link
Member Author

Choose a reason for hiding this comment

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

@untitaker I couldn't really use enum ErrorBoundary<T> in the project config (

pub breakdowns: Option<normalize::breakdowns::BreakdownsConfig>,
) as it's in a different crate (https://github.com/getsentry/relay/blob/a231a2b17a71304a19710cf9a49b21fa06e25f71/relay-server/src/utils/error_boundary.rs).

I'm assuming this is what you had in mind.

If so, we might need to consolidate enum ErrorBoundary<T> somewhere, and implement Default for enum ErrorBoundary<T>.

@dashed dashed changed the title ref(breakdowns): Rename all fields in span operation breakdown config to camel case take 2 ref(breakdowns): All fields in breakdown config should be camelCase, and rename the breakdown key name in project options. Jun 14, 2021
@untitaker untitaker requested a review from jan-auer June 15, 2021 14:34
Co-authored-by: Markus Unterwaditzer <markus-honeypot@unterwaditzer.net>
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.

Looks good. The "V2" looks a bit strange at first, but is a good and explicit solution.

One change requested below, since this PR touches more places than required.

Note that once you merge and deploy this, Relay will no longer compute breakdowns until the corresponding Sentry PR is merged.

@@ -90,7 +90,7 @@ fn bench_store_processor(c: &mut Criterion) {
user_agent: None,
sent_at: None,
received_at: None,
breakdowns: None,
breakdowns_v2: None,
Copy link
Member

Choose a reason for hiding this comment

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

The store config does not have to be renamed, since this is just an internal type.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right. I've renamed this back to breakdowns.

@dashed
Copy link
Member Author

dashed commented Jun 16, 2021

@jan-auer Note that once you merge and deploy this, Relay will no longer compute breakdowns until the corresponding Sentry PR is merged.

Yep, I'm aware. That should be fine as the computed breakdown are not critical to the product.

@dashed dashed requested a review from jan-auer June 16, 2021 07:22
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.

Thanks!

@untitaker can you please also confirm that you're +1 on keeping StoreConfig as-is?

@jan-auer jan-auer requested a review from untitaker June 16, 2021 07:29
@untitaker
Copy link
Member

I presume the places where we still have this as public API don't get breakdowns anyway

@dashed dashed merged commit 9fd1a43 into master Jun 16, 2021
@dashed dashed deleted the camelCase-breakdowns-take-2 branch June 16, 2021 16:25
jan-auer added a commit that referenced this pull request Jun 17, 2021
* master:
  ref(breakdowns): All fields in breakdown config should be camelCase, and rename the breakdown key name in project options. (#1020)
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.

None yet

3 participants