diff --git a/indexer/services/socks/src/websocket/index.ts b/indexer/services/socks/src/websocket/index.ts index ebdf4120d8..08c05bd39c 100644 --- a/indexer/services/socks/src/websocket/index.ts +++ b/indexer/services/socks/src/websocket/index.ts @@ -214,7 +214,11 @@ export class Index { * @returns */ private onMessage(connectionId: string, message: WebSocket.Data): void { - stats.increment(`${config.SERVICE_NAME}.on_message`, 1); + stats.increment( + `${config.SERVICE_NAME}.on_message`, + 1, + config.MESSAGE_FORWARDER_STATSD_SAMPLE_RATE, + ); if (!this.connections[connectionId]) { logger.info({ at: 'index#onMessage', @@ -318,7 +322,11 @@ export class Index { return; } } - stats.increment(`${config.SERVICE_NAME}.message_received_${parsed.type}`, 1); + stats.increment( + `${config.SERVICE_NAME}.message_received_${parsed.type}`, + 1, + config.MESSAGE_FORWARDER_STATSD_SAMPLE_RATE, + ); } /**