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: drop console log events when disabled #18210

Merged
merged 4 commits into from
Oct 26, 2023

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Oct 26, 2023

We had a team sending very large/numerous console logs in a very few session recordings. They also had long sessions.

The sessions were causing problems at ingestion and so we disabled the console log ingestion. But because their sessions were long-lived and this only affects new sessions it didn't relieve ingestion pressure.

So, we had to disable all recording for the team. So that when the teams refresher next updated we'd start dropping their recordings.

This PR amends the teams refresher to pick out (some) config for the teams so that we can still check if a team exist and is enabled for general replay ingestion - but also in the console log ingester check if a team is enabled and when there are console logs in an event drop them if the team is disabled

@@ -95,6 +95,11 @@ type PartitionMetrics = {
lastKnownCommit?: number
}

export interface TeamIDWithConfig {
Copy link
Member Author

Choose a reason for hiding this comment

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

added with structure since if/when we start ingesting network performance events to ClickHouse we'll want the same control

Copy link
Contributor

@benjackwhite benjackwhite 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 - always a bit worried if we start adding more values that we are holding in memory but this should be fine.

@pauldambra
Copy link
Member Author

always a bit worried if we start adding more values that we are holding in memory

Yep, I nearly added a refresher in the console log ingester 🙈 before realising we only want a little more data not twice as much 📈

@@ -30,9 +30,10 @@ function deduplicateConsoleLogEvents(consoleLogEntries: ConsoleLogEntry[]): Cons
const deduped: ConsoleLogEntry[] = []

for (const cle of consoleLogEntries) {
if (!seen.has(cle.message)) {
const fingerPrint = `${cle.log_level}-${cle.message}`
Copy link
Member Author

Choose a reason for hiding this comment

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

the only real change since last review...

Deduplication didn't work at all 🙈 🤦

@pauldambra pauldambra merged commit a9a4eea into master Oct 26, 2023
65 checks passed
@pauldambra pauldambra deleted the feat/drop-console-log-events-when-disabled branch October 26, 2023 14:15
Gilbert09 pushed a commit that referenced this pull request Oct 30, 2023
* feat: drop console log events when disabled

* don't process logs before dropping them

* write tests and as a result fix de-duplication

* overwriting default with default is unnecessary
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