diff --git a/nsqadmin/templates/channel.html.go b/nsqadmin/templates/channel.html.go index ef3f5a5ac..79adeb4c9 100644 --- a/nsqadmin/templates/channel.html.go +++ b/nsqadmin/templates/channel.html.go @@ -200,7 +200,7 @@ func init() { {{range .ChannelStats.Clients}} - {{.ClientID}} + {{.ClientID}} {{.Version}} {{if .HasUserAgent}}({{.UserAgent}}){{end}} {{if .HasSampleRate}} @@ -215,6 +215,9 @@ func init() { {{if .Snappy}} Snappy {{end}} + {{if .Authed}} + {{if .AuthIdentityUrl}}{{end}}{{if .AuthIdentityUrl}}{{end}} + {{end}} {{.HostAddress}} {{.InFlightCount | commafy}} diff --git a/nsqd/client_v2.go b/nsqd/client_v2.go index dbaae0b1b..de55d5a67 100644 --- a/nsqd/client_v2.go +++ b/nsqd/client_v2.go @@ -249,6 +249,7 @@ func (c *clientV2) Stats() ClientStats { TLS: atomic.LoadInt32(&c.TLS) == 1, Deflate: atomic.LoadInt32(&c.Deflate) == 1, Snappy: atomic.LoadInt32(&c.Snappy) == 1, + Authed: c.HasAuthorizations(), AuthIdentity: identity, AuthIdentityURL: identityUrl, } diff --git a/nsqd/stats.go b/nsqd/stats.go index c15ada6d9..0348fe356 100644 --- a/nsqd/stats.go +++ b/nsqd/stats.go @@ -82,6 +82,7 @@ type ClientStats struct { Deflate bool `json:"deflate"` Snappy bool `json:"snappy"` UserAgent string `json:"user_agent"` + Authed bool `json:"authed,omitempty"` AuthIdentity string `json:"auth_identity,omitempty"` AuthIdentityURL string `json:"auth_identity_url,omitempty"` } diff --git a/util/lookupd/lookupd.go b/util/lookupd/lookupd.go index f94c2e7d0..794174605 100644 --- a/util/lookupd/lookupd.go +++ b/util/lookupd/lookupd.go @@ -439,6 +439,7 @@ func GetNSQDStats(nsqdHTTPAddrs []string, selectedTopic string) ([]*TopicStats, clientStats := &ClientStats{ HostAddress: addr, + RemoteAddress: client.Get("remote_address").MustString(), Version: client.Get("version").MustString(), ClientID: clientId, Hostname: client.Get("hostname").MustString(), @@ -453,6 +454,9 @@ func GetNSQDStats(nsqdHTTPAddrs []string, selectedTopic string) ([]*TopicStats, TLS: client.Get("tls").MustBool(), Deflate: client.Get("deflate").MustBool(), Snappy: client.Get("snappy").MustBool(), + Authed: client.Get("authed").MustBool(), + AuthIdentity: client.Get("auth_identity").MustString(), + AuthIdentityUrl: client.Get("auth_identity_url").MustString(), } hostChannelStats.Clients = append(hostChannelStats.Clients, clientStats) channelStats.Clients = append(channelStats.Clients, clientStats) diff --git a/util/lookupd/types.go b/util/lookupd/types.go index f2cb96e78..ce406d4fa 100644 --- a/util/lookupd/types.go +++ b/util/lookupd/types.go @@ -155,6 +155,7 @@ func (c *ChannelStats) Host() string { type ClientStats struct { HostAddress string + RemoteAddress string Version string ClientID string Hostname string @@ -169,6 +170,9 @@ type ClientStats struct { TLS bool Deflate bool Snappy bool + Authed bool + AuthIdentity string + AuthIdentityUrl string } func (c *ClientStats) HasUserAgent() bool {