Skip to content

this fixes the issue where single kresd doesnt provide metrics on htt… - #145

Open
adaryorg wants to merge 1 commit into
CZ-NIC:masterfrom
adaryorg:feature/fix-metrics
Open

this fixes the issue where single kresd doesnt provide metrics on htt…#145
adaryorg wants to merge 1 commit into
CZ-NIC:masterfrom
adaryorg:feature/fix-metrics

Conversation

@adaryorg

@adaryorg adaryorg commented Jun 3, 2026

Copy link
Copy Markdown

this one should be quite straightforward but it took me an hour to find it.
i recently started upgrading my quite unique 5.7.6 setup to 6.3 and i'm running instances with the old kresd@.service, and i noticed that after configuring the http interface only two metrics were emmited.
this fixed the issue in my environment

@vcunat

vcunat commented Jun 3, 2026

Copy link
Copy Markdown
Member

running instances with the old kresd@.service

Running 6.x without the new manager component (knot-resolver.service normally) isn't really supported. It's not well documented (the YAML config is) and you could run into various issues.

Still, we'll try to have a look at this diff properly at some point.

@adaryorg

adaryorg commented Jun 3, 2026

Copy link
Copy Markdown
Author

Yes I know it's not supported but I have a very unique use case for it where 5.x worked perfectly, and I need 6.x for the fallback feature. I would be more than happy to chat about the implementation if you would like to hear about the use case

@vcunat

vcunat commented Jun 4, 2026

Copy link
Copy Markdown
Member

Sure, it is interesting to read about the use case, i.e. why you need it set up this way.

@adaryorg

adaryorg commented Jun 4, 2026

Copy link
Copy Markdown
Author

In a nutshell, we provide a service where each customer (very small customer0 has a dedicated DNS server with rules to block or allow resolution of certain domains, or to have certain domains forwarded to specific resolvers, and this all works inside one physical server where each 'server' is a kresd instance with its own configuration and it serves on a dedicated port on 127.0.0.1. we have dnat rules set up to direct the traffic from customer source IP's to their dedicated kresd instance.
Internally I run as kresd@, and a snippet from configuration is:

local systemd_instance=os.getenv("SYSTEMD_INSTANCE")
if string.match(systemd_instance, '^<customer name>') then
    net.listen('127.0.0.1, <some port>, {kind = "dns"})
    net.listen('127.0.0.1, <some other port>, {kind = "webmgmt"})

    -- the rest of customer configuration like custom forwards, custom blocklist, etc ...
end

@vcunat

vcunat commented Jun 4, 2026

Copy link
Copy Markdown
Member

Note: if forwarding differs between them in a sense which is expected to affect returned answers, you most likely don't want them sharing the cache.

@adaryorg

adaryorg commented Jun 4, 2026

Copy link
Copy Markdown
Author

oh they are not sharing the cache. i configure a small cache folder for each instance and each uses its own cache. that was one of the first things I figured out how to do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants