Skip to content

Commit

Permalink
sample more metrics (#1304)
Browse files Browse the repository at this point in the history
  • Loading branch information
dydxwill authored Apr 1, 2024
1 parent e953077 commit fc59d23
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions indexer/services/socks/src/websocket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
);
}

/**
Expand Down

0 comments on commit fc59d23

Please sign in to comment.