Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ func init() {
platformEndpoints(u)
}

if *MetricsEndpoint != nil {
if *MetricsEndpoint != nil && *ListenAddress == defaultListenAddress {
// In remote-write mode the built-in HTTP server is only needed for the
// agent's own metrics, so bind it to loopback by default. Respect an
// explicitly configured --listen/LISTEN so /metrics can also be scraped
// directly (e.g. by an external Prometheus alongside remote write).
*ListenAddress = "127.0.0.1:10300"
}
}