diff --git a/.changelog/17084.txt b/.changelog/17084.txt new file mode 100644 index 000000000..f1a7aea22 --- /dev/null +++ b/.changelog/17084.txt @@ -0,0 +1,3 @@ +```release-note:improvement +agent: Display server node ID in agent configuration at startup +``` diff --git a/command/agent/command.go b/command/agent/command.go index 6d72dc79d..4a99a53fc 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -781,6 +781,12 @@ func (c *Command) Run(args []string) int { info["region"] = fmt.Sprintf("%s (DC: %s)", config.Region, config.Datacenter) info["bind addrs"] = c.getBindAddrSynopsis() info["advertise addrs"] = c.getAdvertiseAddrSynopsis() + if config.Server.Enabled { + serverConfig, err := c.agent.serverConfig() + if err == nil { + info["node id"] = serverConfig.NodeID + } + } // Sort the keys for output infoKeys := make([]string, 0, len(info))