@@ -122,8 +122,28 @@ func Collect() error {
122122
123123 pollError := err
124124 if pollStatus {
125- if config .cf .CC .UseStatus {
126- err := mqmetric .CollectChannelStatus (config .cf .MonitoredChannels )
125+
126+ // Always collect the queue and qmgr status info regardless of the UseStatus flag, so that we keep
127+ // the known attribute values for tagging.
128+ if err == nil {
129+ err = mqmetric .CollectQueueStatus (config .cf .MonitoredQueues )
130+ if err != nil {
131+ log .Errorf ("Error collecting queue status: %v" , err )
132+ pollError = err
133+ } else {
134+ log .Debugf ("Collected all queue status" )
135+ }
136+ err = mqmetric .CollectQueueManagerStatus ()
137+ if err != nil {
138+ log .Errorf ("Error collecting queue manager status: %v" , err )
139+ pollError = err
140+ } else {
141+ log .Debugf ("Collected all queue manager status" )
142+ }
143+ }
144+
145+ if config .cf .CC .UseStatus && err == nil {
146+ err = mqmetric .CollectChannelStatus (config .cf .MonitoredChannels )
127147 if err != nil {
128148 log .Errorf ("Error collecting channel status: %v" , err )
129149 pollError = err
@@ -147,14 +167,6 @@ func Collect() error {
147167 log .Debugf ("Collected all subscription status" )
148168 }
149169
150- err = mqmetric .CollectQueueStatus (config .cf .MonitoredQueues )
151- if err != nil {
152- log .Errorf ("Error collecting queue status: %v" , err )
153- pollError = err
154- } else {
155- log .Debugf ("Collected all queue status" )
156- }
157-
158170 err = mqmetric .CollectClusterStatus ()
159171 if err != nil {
160172 log .Errorf ("Error collecting cluster status: %v" , err )
@@ -163,14 +175,6 @@ func Collect() error {
163175 log .Debugf ("Collected all cluster status" )
164176 }
165177
166- err = mqmetric .CollectQueueManagerStatus ()
167- if err != nil {
168- log .Errorf ("Error collecting queue manager status: %v" , err )
169- pollError = err
170- } else {
171- log .Debugf ("Collected all queue manager status" )
172- }
173-
174178 if mqmetric .GetPlatform () == ibmmq .MQPL_ZOS {
175179 err = mqmetric .CollectUsageStatus ()
176180 if err != nil {
0 commit comments