fix(metrics): fix metrics
This commit is contained in:
@ -347,6 +347,12 @@ export class RouteConnectionHandler {
|
||||
}
|
||||
const alert = Buffer.from([0x15, 0x03, 0x03, 0x00, 0x02, 0x01, 0x70]);
|
||||
try {
|
||||
// Count the alert bytes being sent
|
||||
record.bytesSent += alert.length;
|
||||
if (this.smartProxy.metricsCollector) {
|
||||
this.smartProxy.metricsCollector.recordBytes(record.id, 0, alert.length);
|
||||
}
|
||||
|
||||
socket.cork();
|
||||
socket.write(alert);
|
||||
socket.uncork();
|
||||
@ -1208,6 +1214,9 @@ export class RouteConnectionHandler {
|
||||
|
||||
const proxyHeader = ProxyProtocolParser.generate(proxyInfo);
|
||||
|
||||
// Note: PROXY protocol headers are sent to the backend, not to the client
|
||||
// They are internal protocol overhead and shouldn't be counted in client-facing metrics
|
||||
|
||||
// Send PROXY protocol header first
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
targetSocket.write(proxyHeader, (err) => {
|
||||
|
Reference in New Issue
Block a user