Skip to content

Commit

Permalink
chore(blob): add recording_blob_ingestion_session_info_bytes summary
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed Apr 16, 2024
1 parent 2e4547c commit 1d7add3
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import crypto from 'crypto'
import { Redis } from 'ioredis'
import { mkdirSync, rmSync } from 'node:fs'
import { CODES, features, KafkaConsumer, librdkafkaVersion, Message, TopicPartition } from 'node-rdkafka'
import { Counter, Gauge, Histogram } from 'prom-client'
import { Counter, Gauge, Histogram, Summary } from 'prom-client'

import { sessionRecordingConsumerConfig } from '../../../config/config'
import {
Expand Down Expand Up @@ -113,6 +113,12 @@ const histogramActiveSessionsWhenCommitIsBlocked = new Histogram({
buckets: [0, 1, 2, 3, 4, 5, 10, 20, 50, 100, 1000, 10000, Infinity],
})

export const sessionInfoSummary = new Summary({
name: 'recording_blob_ingestion_session_info_bytes',
help: 'Size of aggregated session information being processed',
percentiles: [0.1, 0.25, 0.5, 0.9, 0.99],
})

type PartitionMetrics = {
lastMessageTimestamp?: number
lastMessageOffset?: number
Expand Down Expand Up @@ -313,6 +319,8 @@ export class SessionRecordingIngester {
)
}

sessionInfoSummary.observe(event.metadata.rawSize)

await Promise.allSettled([
this.sessions[key]?.add(event),
this.overflowDetection?.observe(session_id, event.metadata.rawSize, event.metadata.timestamp),
Expand Down

0 comments on commit 1d7add3

Please sign in to comment.