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(metrics): Extract session metrics from session aggregates [INGEST-678] [INGEST-253] #1140

Merged
merged 13 commits into from
Dec 2, 2021

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Nov 26, 2021

Extract session metrics from session aggregates, just like we do for individual session updates.

Also in this PR: Apply the same validation (timestamp, attributes) to aggregates as to individual session updates.

@jjbayer jjbayer changed the title feat(metrics): Extract session metrics from session aggregates feat(metrics): Extract session metrics from session aggregates [INGEST-678] [INGEST-253] Nov 26, 2021
fn abnormal_count(&self) -> u32;
fn crashed_count(&self) -> u32;
fn errors(&self) -> Option<SessionError>;
fn final_duration(&self) -> Option<(f64, SessionStatus)>;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is now an interface tailored specifically for extract_session_metrics (especially errors and final_duration), which has little to do with the protocol. But I still think it makes sense to have only a single function for metrics extraction, such that changes apply to both types of sessions.

true
}

fn process_session_aggregates(
Copy link
Member Author

Choose a reason for hiding this comment

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

It might make sense to create a common interface for Session and SessionAggregate (similar to but different from SessionLike) instead, so that we only have to define process_session once.

@jjbayer jjbayer marked this pull request as ready for review November 29, 2021 11:12
@jjbayer jjbayer requested a review from a team November 29, 2021 11:12
@jjbayer jjbayer requested a review from untitaker November 30, 2021 07:22
Copy link
Member

@untitaker untitaker left a comment

Choose a reason for hiding this comment

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

this is fine as-is. i agree with your remarks about code duplication (make them jira tickets for now). before merging, can you open a PR on the sentry side for the sessions test harness that does the same thing?

I would like to have the python and rust impl look the same, roughly, i am not sure if that can be achieved

@jjbayer jjbayer merged commit e632019 into master Dec 2, 2021
@jjbayer jjbayer deleted the feat/extract-metrics-from-aggregate-sessions branch December 2, 2021 10:56
jan-auer added a commit that referenced this pull request Dec 2, 2021
* master:
  fix: Clippy lints 1.57.0 (#1144)
  feat(metrics): Extract session metrics from session aggregates (#1140)
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