Skip to content

Conversation

@pieterlexis
Copy link
Contributor

Short description

This PR adds the option to set a stable "ServerID" for the running dnsdist instance by either using general.server_id in YAML or the (runtime) setServerID function. By default (and unset), the server's hostname is used.

Having this means that no matter how metrics, logs, or traces are sent to different collectors, they can always be attributed to a single dnsdist instance and hence, be correlated.

This ID can (for now) be used by Prometheus, Carbon, and remote logging. Once the structured logging PR (#16691) is merged, the ability to use this identifier in a log-field should be added.

This PR is an attempt to implement #16261.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • read and accepted the Developer Certificate of Origin document, including the AI Policy, and added a "Signed-off-by" to my commits
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

@pieterlexis pieterlexis added this to the dnsdist-2.1.0 milestone Jan 15, 2026
@pieterlexis pieterlexis requested a review from rgacogne January 15, 2026 10:24
@coveralls
Copy link

coveralls commented Jan 15, 2026

Pull Request Test Coverage Report for Build 21038114534

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 78 of 130 (60.0%) changed or added relevant lines in 8 files are covered.
  • 13 unchanged lines in 6 files lost coverage.
  • Overall coverage remained the same at 73.353%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pdns/dnsdistdist/dnsdist-configuration-yaml.cc 8 9 88.89%
pdns/dnsdistdist/dnsdist-actions-factory.cc 8 10 80.0%
pdns/dnsdistdist/dnsdist-lua-bindings.cc 1 3 33.33%
pdns/dnsdistdist/dnsdist-carbon.cc 8 11 72.73%
pdns/dnsdistdist/dnsdist-web.cc 32 50 64.0%
pdns/dnsdistdist/dnsdist-lua-actions.cc 15 41 36.59%
Files with Coverage Reduction New Missed Lines %
pdns/backends/gsql/gsqlbackend.hh 1 97.77%
pdns/misc.cc 1 61.34%
pdns/ueberbackend.cc 1 78.87%
pdns/recursordist/rec-eventtrace.hh 2 58.41%
pdns/recursordist/test-syncres_cc2.cc 3 89.18%
pdns/recursordist/test-syncres_cc1.cc 5 90.26%
Totals Coverage Status
Change from base Build 21037860535: 0.0%
Covered Lines: 129087
Relevant Lines: 165164

💛 - Coveralls

Copy link
Member

@rgacogne rgacogne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, I have a couple nits but I love it!

rgacogne
rgacogne previously approved these changes Jan 15, 2026
@pieterlexis pieterlexis merged commit 74324e7 into PowerDNS:master Jan 16, 2026
91 of 92 checks passed
@pieterlexis pieterlexis deleted the dnsdist-serverid branch January 16, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants