From c7418d9e1a28c9f29eb33287e64870d768677013 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Fri, 20 Feb 2026 15:37:15 +0000 Subject: [PATCH] feat(dcrouter): Wire DNS server query events to MetricsManager for time-series tracking and bump @push.rocks/smartdns to ^7.9.0 --- changelog.md | 7 +++++++ package.json | 2 +- pnpm-lock.yaml | 26 +++++++++----------------- ts/00_commitinfo_data.ts | 2 +- ts/classes.dcrouter.ts | 14 ++++++++++++++ ts_web/00_commitinfo_data.ts | 2 +- 6 files changed, 33 insertions(+), 20 deletions(-) diff --git a/changelog.md b/changelog.md index f541755..8674abf 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2026-02-20 - 7.3.0 - feat(dcrouter) +Wire DNS server 'query' events to MetricsManager for time-series tracking and bump @push.rocks/smartdns to ^7.9.0 + +- Add dnsServer 'query' event listener that iterates event.questions and calls metricsManager.trackDnsQuery(question.type, question.name, false, event.responseTimeMs). +- Listener is guarded by a metricsManager existence check to avoid runtime errors when metrics are not configured. +- Bump dependency @push.rocks/smartdns from ^7.8.1 to ^7.9.0 in package.json. + ## 2026-02-20 - 7.2.0 - feat(logs) replace custom logs list with dees-chart-log component and push logs to chart, add log mapping and lifecycle sync, and bump smartlog dependency diff --git a/package.json b/package.json index ef7c353..c094909 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@push.rocks/qenv": "^6.1.3", "@push.rocks/smartacme": "^9.1.3", "@push.rocks/smartdata": "^7.0.15", - "@push.rocks/smartdns": "^7.8.1", + "@push.rocks/smartdns": "^7.9.0", "@push.rocks/smartfile": "^13.1.2", "@push.rocks/smartguard": "^3.1.0", "@push.rocks/smartjwt": "^2.2.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0cf07df..447f09d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -42,8 +42,8 @@ importers: specifier: ^7.0.15 version: 7.0.15(socks@2.8.7) '@push.rocks/smartdns': - specifier: ^7.8.1 - version: 7.8.1 + specifier: ^7.9.0 + version: 7.9.0 '@push.rocks/smartfile': specifier: ^13.1.2 version: 13.1.2 @@ -894,8 +894,8 @@ packages: '@push.rocks/smartdelay@3.0.5': resolution: {integrity: sha512-mUuI7kj2f7ztjpic96FvRIlf2RsKBa5arw81AHNsndbxO6asRcxuWL8dTVxouEIK8YsBUlj0AsrCkHhMbLQdHw==} - '@push.rocks/smartdns@7.8.1': - resolution: {integrity: sha512-qEizM9dFzhq4XGICDC8Im7JLjwdokHdDZ6wLufBInaEOupq+8XOa9bC6EGlBQVsCXFUyrKzsFk6eBa9BSZMKPw==} + '@push.rocks/smartdns@7.9.0': + resolution: {integrity: sha512-1nDUfyXQo6j9HTUfcjE+BLeAv9QZ7WtAsM1V28zIoFdUpjNg/5g382L024H73PHsxh6lSYNhYYmFvWqzFQhXKg==} '@push.rocks/smartenv@5.0.13': resolution: {integrity: sha512-ACXmUcHZHl2CF2jnVuRw9saRRrZvJblCRs2d+K5aLR1DfkYFX3eA21kcMlKeLisI3aGNbIj9vz/rowN5qkRkfA==} @@ -3221,10 +3221,6 @@ packages: resolution: {integrity: sha512-fu656aJ0n2kcXwsnwnv9g24tkU5uSmOlTjd6WyyaKm2Z+h1qmY6bAjrcaIxF/BslFqbZ8UBtbJi7KgQOZD2PTw==} engines: {node: 20 || >=22} - minimatch@10.2.0: - resolution: {integrity: sha512-ugkC31VaVg9cF0DFVoADH12k6061zNZkZON+aX8AWsR9GhPcErkcMBceb6znR8wLERM2AkkOxy2nWRLpT9Jq5w==} - engines: {node: 20 || >=22} - minimatch@10.2.1: resolution: {integrity: sha512-MClCe8IL5nRRmawL6ib/eT4oLyeKMGCghibcDWK+J0hh0Q8kqSdia6BvbRMVk6mPa6WqUa5uR2oxt6C5jd533A==} engines: {node: 20 || >=22} @@ -5745,7 +5741,7 @@ snapshots: '@push.rocks/lik': 6.2.2 '@push.rocks/smartdata': 7.0.15(socks@2.8.7) '@push.rocks/smartdelay': 3.0.5 - '@push.rocks/smartdns': 7.8.1 + '@push.rocks/smartdns': 7.9.0 '@push.rocks/smartlog': 3.2.1 '@push.rocks/smartnetwork': 4.4.0 '@push.rocks/smartstring': 4.1.0 @@ -5939,7 +5935,7 @@ snapshots: dependencies: '@push.rocks/smartpromise': 4.2.3 - '@push.rocks/smartdns@7.8.1': + '@push.rocks/smartdns@7.9.0': dependencies: '@push.rocks/smartdelay': 3.0.5 '@push.rocks/smartenv': 6.0.0 @@ -5947,7 +5943,7 @@ snapshots: '@push.rocks/smartrust': 1.2.1 '@tsclass/tsclass': 9.3.0 acme-client: 5.4.0 - minimatch: 10.2.0 + minimatch: 10.2.1 transitivePeerDependencies: - supports-color @@ -6117,7 +6113,7 @@ snapshots: '@push.rocks/smartmail@2.2.0': dependencies: - '@push.rocks/smartdns': 7.8.1 + '@push.rocks/smartdns': 7.9.0 '@push.rocks/smartfile': 13.1.2 '@push.rocks/smartmustache': 3.0.2 '@push.rocks/smartpath': 6.0.0 @@ -6235,7 +6231,7 @@ snapshots: '@push.rocks/smartnetwork@4.4.0': dependencies: - '@push.rocks/smartdns': 7.8.1 + '@push.rocks/smartdns': 7.9.0 '@push.rocks/smartping': 1.0.8 '@push.rocks/smartpromise': 4.2.3 '@push.rocks/smartstring': 4.1.0 @@ -9120,10 +9116,6 @@ snapshots: dependencies: '@isaacs/brace-expansion': 5.0.1 - minimatch@10.2.0: - dependencies: - brace-expansion: 5.0.2 - minimatch@10.2.1: dependencies: brace-expansion: 5.0.2 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 8b5d8bd..e0b2f90 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/dcrouter', - version: '7.2.0', + version: '7.3.0', description: 'A multifaceted routing service handling mail and SMS delivery functions.' } diff --git a/ts/classes.dcrouter.ts b/ts/classes.dcrouter.ts index 7059a1e..2db8441 100644 --- a/ts/classes.dcrouter.ts +++ b/ts/classes.dcrouter.ts @@ -1256,6 +1256,20 @@ export class DcRouter { // Start the DNS server (UDP only) await this.dnsServer.start(); logger.log('info', `DNS server started on UDP ${vmIpAddress}:53`); + + // Wire DNS query events to MetricsManager for time-series tracking + if (this.metricsManager && this.dnsServer) { + this.dnsServer.on('query', (event: plugins.smartdns.dnsServerMod.IDnsQueryCompletedEvent) => { + for (const question of event.questions) { + this.metricsManager.trackDnsQuery( + question.type, + question.name, + false, + event.responseTimeMs, + ); + } + }); + } // Validate DNS configuration await this.validateDnsConfiguration(); diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index 8b5d8bd..e0b2f90 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/dcrouter', - version: '7.2.0', + version: '7.3.0', description: 'A multifaceted routing service handling mail and SMS delivery functions.' }