Skip to content

feat: Remove sessions#3271

Merged
lynnagara merged 18 commits intomasterfrom
cleanup-sessions
Mar 25, 2024
Merged

feat: Remove sessions#3271
lynnagara merged 18 commits intomasterfrom
cleanup-sessions

Conversation

@lynnagara
Copy link
Member

@lynnagara lynnagara commented Mar 14, 2024

Sessions does not exist anymore

@lynnagara lynnagara requested a review from a team as a code owner March 14, 2024 20:55
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

@lynnagara thank you for picking this up!

We cannot get rid of sessions entirely, because SDKs still send them. But we can remove the Kafka topic and hard-code the decision to drop sessions after converting them to metrics, essentially everything around:

/// Returns `true` if the session should be dropped after extracting metrics.
pub fn should_drop(&self) -> bool {
self.drop
}

transactions: "ingest-transactions".to_owned().into(),
outcomes: "outcomes".to_owned().into(),
outcomes_billing: None,
sessions: "ingest-sessions".to_owned().into(),
Copy link
Member

Choose a reason for hiding this comment

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

Does the ops repo still have configuration for this? We don't want Relay to crash because of an unknown topic parameter.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. https://github.com/getsentry/ops/blob/master/k8s/clusters/us/default.yaml#L3256-L3257. Though is this comment actually backwards and it needs to be removed from ops first?

Comment on lines -99 to -102
/// Session update data.
Session,
/// Aggregated session data.
Sessions,
Copy link
Member

Choose a reason for hiding this comment

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

Relay now converts session items from SDKs to metrics, but we still need to accept these incoming item types.

@lynnagara
Copy link
Member Author

thanks for the feedback @jjbayer! i tried to pared this down to the minimum now -- removed the envelope changes and just taking out the part that produces to kafka. I'm not sure why the metrics extraction tests are failing now though - is it possible metrics are not being properly extracted anymore?

Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

Though is this comment actually backwards and it needs to be removed from ops first?

I think the comment is mostly about single tenant, are the kafka topics empty there as well? I just checked my local relay and it seems like it's fine with an unknown topic key in the config, so this should be safe to merge.

https://github.com/getsentry/ops/blob/b5a4fb9c0f0a2e2d2eaf50799d1907a593ad5f80/k8s/clusters/us/default.yaml#L3262-L3264

/// Session is dropped after extracting metrics.
pub fn should_drop(&self) -> bool {
self.drop
true
Copy link
Member

Choose a reason for hiding this comment

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

Personally I would just remove this method.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

client,
item,
)?;
// Do nothing
Copy link
Member

Choose a reason for hiding this comment

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

There's a catch-all at the bottom of this match, so we can just remove this branch.

"sdk": "raven-node/2.6.3",
}

sessions_consumer.assert_empty()
Copy link
Member

Choose a reason for hiding this comment

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

Shall we just remove the entire test case (same below)?

CHANGELOG.md Outdated
Comment on lines +19 to +20
- Stop producing to sessions topic, the feature is now fully migrated to metrics ([#3271](https://github.com/getsentry/relay/pull/3271))

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Stop producing to sessions topic, the feature is now fully migrated to metrics ([#3271](https://github.com/getsentry/relay/pull/3271))
- Stop producing to sessions topic, the feature is now fully migrated to metrics. ([#3271](https://github.com/getsentry/relay/pull/3271))

Dav1dde added a commit to getsentry/sentry that referenced this pull request Apr 3, 2024
Makes cardinality limits for Relay more configurable, to be able to test
and roll them out more easily.

`drop` from the sessions config was removed in
getsentry/relay#3271 - required for the librelay
update to work
Dav1dde added a commit to getsentry/sentry that referenced this pull request Apr 30, 2024
Relay can no longer ingest sessions into Kafka after
getsentry/relay#3271 making these feature flags
obsolete.

See also: getsentry/relay#3368 and
getsentry/relay#3492
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.

3 participants