Skip to content

Commit

Permalink
autorelay: add metrics
Browse files Browse the repository at this point in the history
metrics added:
relay finder status

reservation request outcomes
current reservations

candidate circuit v2 support
current candidates

relay addresses updated
num relay address

scheduled work times
  • Loading branch information
sukunrt committed Mar 16, 2023
1 parent ed96a64 commit bb3a62c
Show file tree
Hide file tree
Showing 7 changed files with 1,273 additions and 14 deletions.
6 changes: 6 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ func (cfg *Config) NewNode() (host.Host, error) {
h.Close()
return nil, fmt.Errorf("cannot enable autorelay; relay is not enabled")
}
if !cfg.DisableMetrics {
mt := autorelay.WithMetricsTracer(
autorelay.NewMetricsTracer(autorelay.WithRegisterer(cfg.PrometheusRegisterer)))
mtOpts := []autorelay.Option{mt}
cfg.AutoRelayOpts = append(mtOpts, cfg.AutoRelayOpts...)
}

ar, err = autorelay.NewAutoRelay(h, cfg.AutoRelayOpts...)
if err != nil {
Expand Down
Loading

0 comments on commit bb3a62c

Please sign in to comment.