Skip to content

Commit

Permalink
add inbox label for when multiple subscriptions on single connection (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazyshot authored and wallyqs committed Mar 28, 2019
1 parent f200f7f commit 62c5bdd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions collector/streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,19 @@ func newChannelsCollector(servers []*CollectedServer) prometheus.Collector {
subsLastSent: prometheus.NewDesc(
prometheus.BuildFQName("nss", "chan", "subs_last_sent"),
"Last message sent",
[]string{"server", "channel", "client_id"},
[]string{"server", "channel", "client_id", "inbox"},
nil,
),
subsPendingCount: prometheus.NewDesc(
prometheus.BuildFQName("nss", "chan", "subs_pending_count"),
"Pending message count",
[]string{"server", "channel", "client_id"},
[]string{"server", "channel", "client_id", "inbox"},
nil,
),
subsMaxInFlight: prometheus.NewDesc(
prometheus.BuildFQName("nss", "chan", "subs_max_inflight"),
"Max in flight message count",
[]string{"server", "channel", "client_id"},
[]string{"server", "channel", "client_id", "inbox"},
nil,
),
}
Expand Down Expand Up @@ -208,9 +208,9 @@ func (nc *channelsCollector) Collect(ch chan<- prometheus.Metric) {
ch <- prometheus.MustNewConstMetric(nc.chanLastSeq, prometheus.GaugeValue, float64(channel.LastSeq), server.ID, channel.Name)

for _, sub := range channel.Subscriptions {
ch <- prometheus.MustNewConstMetric(nc.subsLastSent, prometheus.GaugeValue, float64(sub.LastSent), server.ID, channel.Name, sub.ClientID)
ch <- prometheus.MustNewConstMetric(nc.subsPendingCount, prometheus.GaugeValue, float64(sub.PendingCount), server.ID, channel.Name, sub.ClientID)
ch <- prometheus.MustNewConstMetric(nc.subsMaxInFlight, prometheus.GaugeValue, float64(sub.MaxInflight), server.ID, channel.Name, sub.ClientID)
ch <- prometheus.MustNewConstMetric(nc.subsLastSent, prometheus.GaugeValue, float64(sub.LastSent), server.ID, channel.Name, sub.ClientID, sub.Inbox)
ch <- prometheus.MustNewConstMetric(nc.subsPendingCount, prometheus.GaugeValue, float64(sub.PendingCount), server.ID, channel.Name, sub.ClientID, sub.Inbox)
ch <- prometheus.MustNewConstMetric(nc.subsMaxInFlight, prometheus.GaugeValue, float64(sub.MaxInflight), server.ID, channel.Name, sub.ClientID, sub.Inbox)
}
}
}
Expand Down

0 comments on commit 62c5bdd

Please sign in to comment.