Add opt-in local Prometheus metrics endpoint to the client

This commit is contained in:
Viktor Liu
2026-07-15 21:46:45 +02:00
parent e1a24376ab
commit 9d2a7e330a
16 changed files with 1735 additions and 29 deletions
+12
View File
@@ -1172,6 +1172,18 @@ func (d *Status) GetResolvedDomainsStates() map[domain.Domain]ResolvedDomainInfo
return maps.Clone(d.resolvedDomainsStates)
}
// GetPeerStates returns a snapshot of all known peer states.
func (d *Status) GetPeerStates() []State {
d.mux.RLock()
defer d.mux.RUnlock()
states := make([]State, 0, len(d.peers))
for _, state := range d.peers {
states = append(states, state)
}
return states
}
// GetFullStatus gets full status
func (d *Status) GetFullStatus() FullStatus {
fullStatus := FullStatus{