diff --git a/tunnel-server/src/metrics.ts b/tunnel-server/src/metrics.ts index 0a318e4f..ad8d05e5 100644 --- a/tunnel-server/src/metrics.ts +++ b/tunnel-server/src/metrics.ts @@ -4,7 +4,7 @@ import { Gauge, Counter, register } from 'prom-client' export const sshConnectionsGauge = new Gauge({ name: 'sshConnections', help: 'Current number of open SSH connections', - labelNames: ['envId'], + labelNames: ['clientId'], }) export const tunnelsGauge = new Gauge({ diff --git a/tunnel-server/src/ssh/index.ts b/tunnel-server/src/ssh/index.ts index 270d7e02..7197e2fa 100644 --- a/tunnel-server/src/ssh/index.ts +++ b/tunnel-server/src/ssh/index.ts @@ -28,8 +28,8 @@ export const createSshServer = ({ }) => { const onClient = (client: BaseSshClient) => { const { clientId, publicKey, envId, connectionId, publicKeyThumbprint, log } = client - sshConnectionsGauge.inc({ envId }) - const cleanupClient = once(() => { sshConnectionsGauge.dec({ envId }) }) + sshConnectionsGauge.inc({ clientId }) + const cleanupClient = once(() => { sshConnectionsGauge.dec({ clientId }) }) const tunnels = new Map() client .on('forward', async (requestId, { path: tunnelPath, access, meta, inject }, localSocketPath, accept, reject) => {