Skip to content

Commit f0348e1

Browse files
committed
cmd/litewitness: log metrics server error and document -listen-metrics flag
1 parent 825b3e4 commit f0348e1

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

cmd/litewitness/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,16 @@ Note that the c2sp.org/tlog-witness protocol is not designed to keep the
7575
supported logs or their tree states secret. Moreover, litewitness has no access
7676
to any secrets (because the private key is in ssh-agent) except arguably the IP
7777
addresses of its clients (which are always redacted from /logz). Obscurity mode
78-
disables the `/` and `/logz` and `/metrics` endpoints to make it harder to enumerate the logs
79-
known to the witness.
78+
disables the `/` and `/logz` and `/metrics` endpoints to make it harder to
79+
enumerate the logs known to the witness.
80+
81+
-listen-metrics string
82+
address to listen for metrics requests, separate from main listener
83+
84+
If `-listen-metrics` is used, the `/metrics` endpoint is served on a separate
85+
listener, regardless of the presence of `-obscurity`. This flag is not
86+
recommended, public metrics allow ecosystem-wide monitoring and cross-operator
87+
debugging, and they're used successfully in the CT ecosystem.
8088

8189
## witnessctl
8290

cmd/litewitness/litewitness.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ func main() {
156156
}
157157
go func() {
158158
slog.Info("listening for metrics", "addr", *listenMetricsFlag)
159-
metricsSrv.ListenAndServe()
159+
err := metricsSrv.ListenAndServe()
160+
if err != nil && err != http.ErrServerClosed {
161+
slog.Error("metrics server error", "err", err)
162+
}
160163
}()
161164
}
162165

0 commit comments

Comments
 (0)