Skip to content

feat(metrics): add Prometheus metrics endpoint with traffic and DNS s…#30

Merged
MaurUppi merged 3 commits into
mainfrom
feat/metrics-endpoint-v3
Apr 25, 2026
Merged

feat(metrics): add Prometheus metrics endpoint with traffic and DNS s…#30
MaurUppi merged 3 commits into
mainfrom
feat/metrics-endpoint-v3

Conversation

@MaurUppi
Copy link
Copy Markdown
Owner

…tats

Adds a /metrics HTTP endpoint serving Prometheus metrics including:

  • TCP/UDP connection counts and traffic totals per outbound
  • DNS cache hit ratio and request counters
  • Node latency probing via alive dialer set exposure

Depends on PR#968 runtime_stats foundation already in origin/main.

Background

Checklist

Full Changelogs

  • [Implement ...]

Issue Reference

Closes #[issue number]

Test Result

…tats

Adds a /metrics HTTP endpoint serving Prometheus metrics including:
- TCP/UDP connection counts and traffic totals per outbound
- DNS cache hit ratio and request counters
- Node latency probing via alive dialer set exposure

Depends on PR#968 runtime_stats foundation already in origin/main.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

DNS Benchmark Compare

  • Base ref: origin/main
  • Head ref: 4307e09fd8e03077a9e65096dcf8a1f05a3b6b4f
  • Base strategy: merge-base
  • Suite profile: dns-module
  • Benchmark count: 3
  • Benchmark time: 200ms

Suite Status

  • control_dns_cache: failed
  • component_upstream_hotpath: failed

control_dns_cache

DNS Benchmark Compare (control_dns_cache)

  • Status: failed
  • Exit code: 1
  • Base ref: origin/main
  • Head ref: 4307e09fd8e03077a9e65096dcf8a1f05a3b6b4f
  • Base strategy: merge-base
  • Package: ./control

Failure Log (tail)

[dns-bench] base ref: origin/main (8b52a2a59d4a5ab1b97733f530092c23540f8090)
[dns-bench] head ref: 4307e09fd8e03077a9e65096dcf8a1f05a3b6b4f (4307e09fd8e03077a9e65096dcf8a1f05a3b6b4f)
Preparing worktree (detached HEAD 8b52a2a)
Preparing worktree (detached HEAD 4307e09)
go: downloading github.com/cilium/ebpf v0.20.0
go: downloading golang.org/x/sys v0.41.0
Error: flag provided but not defined: -strip-debug
exit status 1
control/control.go:8: running "go": exit status 1

component_upstream_hotpath

DNS Benchmark Compare (component_upstream_hotpath)

  • Status: failed
  • Exit code: 1
  • Base ref: origin/main
  • Head ref: 4307e09fd8e03077a9e65096dcf8a1f05a3b6b4f
  • Base strategy: merge-base
  • Package: ./component/dns

Failure Log (tail)

[dns-bench] base ref: origin/main (8b52a2a59d4a5ab1b97733f530092c23540f8090)
[dns-bench] head ref: 4307e09fd8e03077a9e65096dcf8a1f05a3b6b4f (4307e09fd8e03077a9e65096dcf8a1f05a3b6b4f)
Preparing worktree (detached HEAD 8b52a2a)
Preparing worktree (detached HEAD 4307e09)
go: downloading github.com/miekg/dns v1.1.72
go: downloading github.com/sirupsen/logrus v1.9.4
go: downloading github.com/stretchr/testify v1.11.1
go: downloading github.com/olicesx/outbound v0.0.0-sticky-ip.0.20260421051008-8de5a31bdbe1
go: downloading github.com/vishvananda/netlink v1.3.1
go: downloading github.com/v2rayA/ahocorasick-domain v0.0.0-20231231085011-99ceb8ef3208
go: downloading github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
go: downloading golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa
go: downloading github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df
go: downloading github.com/daeuniverse/dae-config-dist/go/dae_config v0.0.0-20230604120805-1c27619b592d
go: downloading github.com/adrg/xdg v0.5.3
go: downloading github.com/json-iterator/go v1.1.12
go: downloading golang.org/x/net v0.50.0
go: downloading github.com/eknkc/basex v1.0.1
go: downloading github.com/olicesx/quic-go v0.0.0-20260226044315-bb65418d151a
go: downloading github.com/awnumar/fastrand v0.0.0-20210315215012-30ee0990fa2d
go: downloading google.golang.org/protobuf v1.36.11
go: downloading github.com/vishvananda/netns v0.0.5
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/awnumar/memguard v0.23.0
go: downloading golang.org/x/crypto v0.48.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading github.com/awnumar/memcall v0.5.0
# github.com/daeuniverse/dae/component/dns [github.com/daeuniverse/dae/component/dns.test]
component/dns/upstream_hotpath_bench_test.go:71:13: not enough arguments in call to r.GetUpstream
	have ()
	want (context.Context)
component/dns/upstream_hotpath_bench_test.go:85:14: not enough arguments in call to r.GetUpstream
	have ()
	want (context.Context)

Codex added 2 commits April 25, 2026 10:12
Conflict resolution kept HEAD's `(err error)` return signature but left
two return statements from PR#29's `(cacheHit bool, err error)` signature
as dead code in the shared post-conflict body.

Lines fixed:
  - `return true, nil`       → `return nil`
  - `return false, fmt.Errorf(...)` → `return fmt.Errorf(...)`
dns_control.go:2490/2506 - handleWithResponseWriter_ declared (err error)
but two return statements still returned (bool, error) from PR#29's old
signature. Stripped the dead bool values.

cmd/run.go:866 - newEndpointCfg declared inside the reload goroutine but
referenced in the outer main loop's <-runStateChanges case (different
scope). Moved endpointConfigChanged block into the reload goroutine where
the variable is in scope.

scripts/ci/benchmarks/**/*_test.go - overlay benchmark files have package
declarations matching their target packages (control, component/dns) but
live in standalone directories with no source files. go test ./... tries
to compile them standalone and fails on undefined types. Added
//go:build ignore to exclude from go test ./... while apply_overlay() in
dns-benchmark-compare.sh now strips the tag when copying to the target
package directory so benchmarks still compile correctly there.
@MaurUppi MaurUppi merged commit 6d6d05f into main Apr 25, 2026
36 of 41 checks passed
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.

1 participant