fix(metrics): improve metrics

This commit is contained in:
Juergen Kunz
2025-06-22 22:28:37 +00:00
parent de1269665a
commit 131a454b28
16 changed files with 1389 additions and 502 deletions

View File

@ -10,7 +10,7 @@ import type {
TPortRange,
INfTablesOptions
} from './models/route-types.js';
import type { ISmartProxyOptions } from './models/interfaces.js';
import type { SmartProxy } from './smart-proxy.js';
/**
* Manages NFTables rules based on SmartProxy route configurations
@ -25,9 +25,9 @@ export class NFTablesManager {
/**
* Creates a new NFTablesManager
*
* @param options The SmartProxy options
* @param smartProxy The SmartProxy instance
*/
constructor(private options: ISmartProxyOptions) {}
constructor(private smartProxy: SmartProxy) {}
/**
* Provision NFTables rules for a route
@ -166,10 +166,10 @@ export class NFTablesManager {
protocol: action.nftables?.protocol || 'tcp',
preserveSourceIP: action.nftables?.preserveSourceIP !== undefined ?
action.nftables.preserveSourceIP :
this.options.preserveSourceIP,
this.smartProxy.settings.preserveSourceIP,
useIPSets: action.nftables?.useIPSets !== false,
useAdvancedNAT: action.nftables?.useAdvancedNAT,
enableLogging: this.options.enableDetailedLogging,
enableLogging: this.smartProxy.settings.enableDetailedLogging,
deleteOnExit: true,
tableName: action.nftables?.tableName || 'smartproxy'
};