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: better ingestion timestamp warning #27122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { KafkaProducerWrapper } from '../../../../utils/db/kafka-producer-wrappe
import { status } from '../../../../utils/status'
import { captureIngestionWarning } from '../../../../worker/ingestion/utils'
import { eventDroppedCounter } from '../../metrics'
import { createSessionReplayEvent } from '../process-event'
import { createSessionReplayEvent, RRWebEventType } from '../process-event'
import { IncomingRecordingMessage } from '../types'
import { OffsetHighWaterMarker } from './offset-high-water-marker'

Expand Down Expand Up @@ -138,6 +138,11 @@ export class ReplayEventsIngester {
if (replayRecord !== null) {
const asDate = DateTime.fromSQL(replayRecord.first_timestamp)
if (!asDate.isValid || Math.abs(asDate.diffNow('day').days) >= 7) {
const eventTypes = rrwebEvents.map((event) => ({
type: event.type,
timestamp: event.timestamp,
Comment on lines +142 to +143
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 will hopefully let me spot any patterns in the bad data, and figure out how I can safely capture a custom event instead of dropping here

}))
const customEvents = rrwebEvents.filter((event) => event.type === RRWebEventType.Custom)
await captureIngestionWarning(
new KafkaProducerWrapper(this.producer),
event.team_id,
Expand All @@ -148,6 +153,8 @@ export class ReplayEventsIngester {
isValid: asDate.isValid,
daysFromNow: Math.round(Math.abs(asDate.diffNow('day').days)),
processingTimestamp: DateTime.now().toISO(),
eventTypes,
customEvents,
Copy link
Member Author

Choose a reason for hiding this comment

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

these all have small controlled payloads we create so are safe to capture here

},
{ key: event.session_id }
)
Expand Down
Loading