| 1 | // Code generated by metricgen; DO NOT EDIT. |
| 2 | // source: contexts.yaml |
| 3 | |
| 4 | package contexts |
| 5 | |
| 6 | import ( |
| 7 | module "github.com/netdata/netdata/go/plugins/plugin/framework/collectorapi" |
| 8 | "github.com/netdata/netdata/go/plugins/plugin/ibm.d/framework" |
| 9 | "strings" |
| 10 | ) |
| 11 | |
| 12 | // cleanLabelValue cleans a label value for use in instance/dimension IDs |
| 13 | func cleanLabelValue(value string) string { |
| 14 | // Replace problematic characters |
| 15 | r := strings.NewReplacer( |
| 16 | " ", "_", |
| 17 | ".", "_", |
| 18 | "-", "_", |
| 19 | "/", "_", |
| 20 | ":", "_", |
| 21 | "=", "_", |
| 22 | ",", "_", |
| 23 | "(", "_", |
| 24 | ")", "_", |
| 25 | ) |
| 26 | return strings.ToLower(r.Replace(value)) |
| 27 | } |
| 28 | |
| 29 | // EmptyLabels is used for contexts without labels |
| 30 | type EmptyLabels struct{} |
| 31 | |
| 32 | // InstanceID for empty labels just returns the context name |
| 33 | func (EmptyLabels) InstanceID(contextName string) string { |
| 34 | return contextName |
| 35 | } |
| 36 | |
| 37 | // --- Channel --- |
| 38 | |
| 39 | // ChannelStatusValues defines the type-safe values for Channel.Status context |
| 40 | type ChannelStatusValues struct { |
| 41 | Inactive int64 |
| 42 | Binding int64 |
| 43 | Starting int64 |
| 44 | Running int64 |
| 45 | Stopping int64 |
| 46 | Retrying int64 |
| 47 | Stopped int64 |
| 48 | Requesting int64 |
| 49 | Paused int64 |
| 50 | Disconnected int64 |
| 51 | Initializing int64 |
| 52 | Switching int64 |
| 53 | } |
| 54 | |
| 55 | // ChannelStatusContext provides type-safe operations for Channel.Status context |
| 56 | type ChannelStatusContext struct { |
| 57 | framework.Context[ChannelLabels] |
| 58 | } |
| 59 | |
| 60 | // Set provides type-safe dimension setting for Channel.Status context |
| 61 | func (c ChannelStatusContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelStatusValues) { |
| 62 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 63 | "inactive": values.Inactive, |
| 64 | "binding": values.Binding, |
| 65 | "starting": values.Starting, |
| 66 | "running": values.Running, |
| 67 | "stopping": values.Stopping, |
| 68 | "retrying": values.Retrying, |
| 69 | "stopped": values.Stopped, |
| 70 | "requesting": values.Requesting, |
| 71 | "paused": values.Paused, |
| 72 | "disconnected": values.Disconnected, |
| 73 | "initializing": values.Initializing, |
| 74 | "switching": values.Switching, |
| 75 | }) |
| 76 | } |
| 77 | |
| 78 | // SetUpdateEvery sets the update interval for this instance |
| 79 | func (c ChannelStatusContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 80 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 81 | } |
| 82 | |
| 83 | // ChannelMessagesValues defines the type-safe values for Channel.Messages context |
| 84 | type ChannelMessagesValues struct { |
| 85 | Messages int64 |
| 86 | } |
| 87 | |
| 88 | // ChannelMessagesContext provides type-safe operations for Channel.Messages context |
| 89 | type ChannelMessagesContext struct { |
| 90 | framework.Context[ChannelLabels] |
| 91 | } |
| 92 | |
| 93 | // Set provides type-safe dimension setting for Channel.Messages context |
| 94 | func (c ChannelMessagesContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelMessagesValues) { |
| 95 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 96 | "messages": values.Messages, |
| 97 | }) |
| 98 | } |
| 99 | |
| 100 | // SetUpdateEvery sets the update interval for this instance |
| 101 | func (c ChannelMessagesContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 102 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 103 | } |
| 104 | |
| 105 | // ChannelBytesValues defines the type-safe values for Channel.Bytes context |
| 106 | type ChannelBytesValues struct { |
| 107 | Bytes int64 |
| 108 | } |
| 109 | |
| 110 | // ChannelBytesContext provides type-safe operations for Channel.Bytes context |
| 111 | type ChannelBytesContext struct { |
| 112 | framework.Context[ChannelLabels] |
| 113 | } |
| 114 | |
| 115 | // Set provides type-safe dimension setting for Channel.Bytes context |
| 116 | func (c ChannelBytesContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelBytesValues) { |
| 117 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 118 | "bytes": values.Bytes, |
| 119 | }) |
| 120 | } |
| 121 | |
| 122 | // SetUpdateEvery sets the update interval for this instance |
| 123 | func (c ChannelBytesContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 124 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 125 | } |
| 126 | |
| 127 | // ChannelBatchesValues defines the type-safe values for Channel.Batches context |
| 128 | type ChannelBatchesValues struct { |
| 129 | Batches int64 |
| 130 | } |
| 131 | |
| 132 | // ChannelBatchesContext provides type-safe operations for Channel.Batches context |
| 133 | type ChannelBatchesContext struct { |
| 134 | framework.Context[ChannelLabels] |
| 135 | } |
| 136 | |
| 137 | // Set provides type-safe dimension setting for Channel.Batches context |
| 138 | func (c ChannelBatchesContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelBatchesValues) { |
| 139 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 140 | "batches": values.Batches, |
| 141 | }) |
| 142 | } |
| 143 | |
| 144 | // SetUpdateEvery sets the update interval for this instance |
| 145 | func (c ChannelBatchesContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 146 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 147 | } |
| 148 | |
| 149 | // ChannelBatchSizeValues defines the type-safe values for Channel.BatchSize context |
| 150 | type ChannelBatchSizeValues struct { |
| 151 | Batch_size int64 |
| 152 | } |
| 153 | |
| 154 | // ChannelBatchSizeContext provides type-safe operations for Channel.BatchSize context |
| 155 | type ChannelBatchSizeContext struct { |
| 156 | framework.Context[ChannelLabels] |
| 157 | } |
| 158 | |
| 159 | // Set provides type-safe dimension setting for Channel.BatchSize context |
| 160 | func (c ChannelBatchSizeContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelBatchSizeValues) { |
| 161 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 162 | "batch_size": values.Batch_size, |
| 163 | }) |
| 164 | } |
| 165 | |
| 166 | // SetUpdateEvery sets the update interval for this instance |
| 167 | func (c ChannelBatchSizeContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 168 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 169 | } |
| 170 | |
| 171 | // ChannelBatchIntervalValues defines the type-safe values for Channel.BatchInterval context |
| 172 | type ChannelBatchIntervalValues struct { |
| 173 | Batch_interval int64 |
| 174 | } |
| 175 | |
| 176 | // ChannelBatchIntervalContext provides type-safe operations for Channel.BatchInterval context |
| 177 | type ChannelBatchIntervalContext struct { |
| 178 | framework.Context[ChannelLabels] |
| 179 | } |
| 180 | |
| 181 | // Set provides type-safe dimension setting for Channel.BatchInterval context |
| 182 | func (c ChannelBatchIntervalContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelBatchIntervalValues) { |
| 183 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 184 | "batch_interval": values.Batch_interval, |
| 185 | }) |
| 186 | } |
| 187 | |
| 188 | // SetUpdateEvery sets the update interval for this instance |
| 189 | func (c ChannelBatchIntervalContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 190 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 191 | } |
| 192 | |
| 193 | // ChannelIntervalsValues defines the type-safe values for Channel.Intervals context |
| 194 | type ChannelIntervalsValues struct { |
| 195 | Disc_interval int64 |
| 196 | Hb_interval int64 |
| 197 | Keep_alive_interval int64 |
| 198 | } |
| 199 | |
| 200 | // ChannelIntervalsContext provides type-safe operations for Channel.Intervals context |
| 201 | type ChannelIntervalsContext struct { |
| 202 | framework.Context[ChannelLabels] |
| 203 | } |
| 204 | |
| 205 | // Set provides type-safe dimension setting for Channel.Intervals context |
| 206 | func (c ChannelIntervalsContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelIntervalsValues) { |
| 207 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 208 | "disc_interval": values.Disc_interval, |
| 209 | "hb_interval": values.Hb_interval, |
| 210 | "keep_alive_interval": values.Keep_alive_interval, |
| 211 | }) |
| 212 | } |
| 213 | |
| 214 | // SetUpdateEvery sets the update interval for this instance |
| 215 | func (c ChannelIntervalsContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 216 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 217 | } |
| 218 | |
| 219 | // ChannelShortRetryCountValues defines the type-safe values for Channel.ShortRetryCount context |
| 220 | type ChannelShortRetryCountValues struct { |
| 221 | Short_retry int64 |
| 222 | } |
| 223 | |
| 224 | // ChannelShortRetryCountContext provides type-safe operations for Channel.ShortRetryCount context |
| 225 | type ChannelShortRetryCountContext struct { |
| 226 | framework.Context[ChannelLabels] |
| 227 | } |
| 228 | |
| 229 | // Set provides type-safe dimension setting for Channel.ShortRetryCount context |
| 230 | func (c ChannelShortRetryCountContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelShortRetryCountValues) { |
| 231 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 232 | "short_retry": values.Short_retry, |
| 233 | }) |
| 234 | } |
| 235 | |
| 236 | // SetUpdateEvery sets the update interval for this instance |
| 237 | func (c ChannelShortRetryCountContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 238 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 239 | } |
| 240 | |
| 241 | // ChannelLongRetryIntervalValues defines the type-safe values for Channel.LongRetryInterval context |
| 242 | type ChannelLongRetryIntervalValues struct { |
| 243 | Long_retry int64 |
| 244 | } |
| 245 | |
| 246 | // ChannelLongRetryIntervalContext provides type-safe operations for Channel.LongRetryInterval context |
| 247 | type ChannelLongRetryIntervalContext struct { |
| 248 | framework.Context[ChannelLabels] |
| 249 | } |
| 250 | |
| 251 | // Set provides type-safe dimension setting for Channel.LongRetryInterval context |
| 252 | func (c ChannelLongRetryIntervalContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelLongRetryIntervalValues) { |
| 253 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 254 | "long_retry": values.Long_retry, |
| 255 | }) |
| 256 | } |
| 257 | |
| 258 | // SetUpdateEvery sets the update interval for this instance |
| 259 | func (c ChannelLongRetryIntervalContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 260 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 261 | } |
| 262 | |
| 263 | // ChannelMaxMessageLengthValues defines the type-safe values for Channel.MaxMessageLength context |
| 264 | type ChannelMaxMessageLengthValues struct { |
| 265 | Max_msg_length int64 |
| 266 | } |
| 267 | |
| 268 | // ChannelMaxMessageLengthContext provides type-safe operations for Channel.MaxMessageLength context |
| 269 | type ChannelMaxMessageLengthContext struct { |
| 270 | framework.Context[ChannelLabels] |
| 271 | } |
| 272 | |
| 273 | // Set provides type-safe dimension setting for Channel.MaxMessageLength context |
| 274 | func (c ChannelMaxMessageLengthContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelMaxMessageLengthValues) { |
| 275 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 276 | "max_msg_length": values.Max_msg_length, |
| 277 | }) |
| 278 | } |
| 279 | |
| 280 | // SetUpdateEvery sets the update interval for this instance |
| 281 | func (c ChannelMaxMessageLengthContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 282 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 283 | } |
| 284 | |
| 285 | // ChannelSharingConversationsValues defines the type-safe values for Channel.SharingConversations context |
| 286 | type ChannelSharingConversationsValues struct { |
| 287 | Sharing_conversations int64 |
| 288 | } |
| 289 | |
| 290 | // ChannelSharingConversationsContext provides type-safe operations for Channel.SharingConversations context |
| 291 | type ChannelSharingConversationsContext struct { |
| 292 | framework.Context[ChannelLabels] |
| 293 | } |
| 294 | |
| 295 | // Set provides type-safe dimension setting for Channel.SharingConversations context |
| 296 | func (c ChannelSharingConversationsContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelSharingConversationsValues) { |
| 297 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 298 | "sharing_conversations": values.Sharing_conversations, |
| 299 | }) |
| 300 | } |
| 301 | |
| 302 | // SetUpdateEvery sets the update interval for this instance |
| 303 | func (c ChannelSharingConversationsContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 304 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 305 | } |
| 306 | |
| 307 | // ChannelNetworkPriorityValues defines the type-safe values for Channel.NetworkPriority context |
| 308 | type ChannelNetworkPriorityValues struct { |
| 309 | Network_priority int64 |
| 310 | } |
| 311 | |
| 312 | // ChannelNetworkPriorityContext provides type-safe operations for Channel.NetworkPriority context |
| 313 | type ChannelNetworkPriorityContext struct { |
| 314 | framework.Context[ChannelLabels] |
| 315 | } |
| 316 | |
| 317 | // Set provides type-safe dimension setting for Channel.NetworkPriority context |
| 318 | func (c ChannelNetworkPriorityContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelNetworkPriorityValues) { |
| 319 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 320 | "network_priority": values.Network_priority, |
| 321 | }) |
| 322 | } |
| 323 | |
| 324 | // SetUpdateEvery sets the update interval for this instance |
| 325 | func (c ChannelNetworkPriorityContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 326 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 327 | } |
| 328 | |
| 329 | // ChannelBufferCountsValues defines the type-safe values for Channel.BufferCounts context |
| 330 | type ChannelBufferCountsValues struct { |
| 331 | Sent int64 |
| 332 | Received int64 |
| 333 | } |
| 334 | |
| 335 | // ChannelBufferCountsContext provides type-safe operations for Channel.BufferCounts context |
| 336 | type ChannelBufferCountsContext struct { |
| 337 | framework.Context[ChannelLabels] |
| 338 | } |
| 339 | |
| 340 | // Set provides type-safe dimension setting for Channel.BufferCounts context |
| 341 | func (c ChannelBufferCountsContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelBufferCountsValues) { |
| 342 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 343 | "sent": values.Sent, |
| 344 | "received": values.Received, |
| 345 | }) |
| 346 | } |
| 347 | |
| 348 | // SetUpdateEvery sets the update interval for this instance |
| 349 | func (c ChannelBufferCountsContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 350 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 351 | } |
| 352 | |
| 353 | // ChannelCurrentMessagesValues defines the type-safe values for Channel.CurrentMessages context |
| 354 | type ChannelCurrentMessagesValues struct { |
| 355 | Current int64 |
| 356 | } |
| 357 | |
| 358 | // ChannelCurrentMessagesContext provides type-safe operations for Channel.CurrentMessages context |
| 359 | type ChannelCurrentMessagesContext struct { |
| 360 | framework.Context[ChannelLabels] |
| 361 | } |
| 362 | |
| 363 | // Set provides type-safe dimension setting for Channel.CurrentMessages context |
| 364 | func (c ChannelCurrentMessagesContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelCurrentMessagesValues) { |
| 365 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 366 | "current": values.Current, |
| 367 | }) |
| 368 | } |
| 369 | |
| 370 | // SetUpdateEvery sets the update interval for this instance |
| 371 | func (c ChannelCurrentMessagesContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 372 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 373 | } |
| 374 | |
| 375 | // ChannelXmitQueueTimeValues defines the type-safe values for Channel.XmitQueueTime context |
| 376 | type ChannelXmitQueueTimeValues struct { |
| 377 | Xmitq_time int64 |
| 378 | } |
| 379 | |
| 380 | // ChannelXmitQueueTimeContext provides type-safe operations for Channel.XmitQueueTime context |
| 381 | type ChannelXmitQueueTimeContext struct { |
| 382 | framework.Context[ChannelLabels] |
| 383 | } |
| 384 | |
| 385 | // Set provides type-safe dimension setting for Channel.XmitQueueTime context |
| 386 | func (c ChannelXmitQueueTimeContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelXmitQueueTimeValues) { |
| 387 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 388 | "xmitq_time": values.Xmitq_time, |
| 389 | }) |
| 390 | } |
| 391 | |
| 392 | // SetUpdateEvery sets the update interval for this instance |
| 393 | func (c ChannelXmitQueueTimeContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 394 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 395 | } |
| 396 | |
| 397 | // ChannelMCAStatusValues defines the type-safe values for Channel.MCAStatus context |
| 398 | type ChannelMCAStatusValues struct { |
| 399 | Mca_status int64 |
| 400 | } |
| 401 | |
| 402 | // ChannelMCAStatusContext provides type-safe operations for Channel.MCAStatus context |
| 403 | type ChannelMCAStatusContext struct { |
| 404 | framework.Context[ChannelLabels] |
| 405 | } |
| 406 | |
| 407 | // Set provides type-safe dimension setting for Channel.MCAStatus context |
| 408 | func (c ChannelMCAStatusContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelMCAStatusValues) { |
| 409 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 410 | "mca_status": values.Mca_status, |
| 411 | }) |
| 412 | } |
| 413 | |
| 414 | // SetUpdateEvery sets the update interval for this instance |
| 415 | func (c ChannelMCAStatusContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 416 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 417 | } |
| 418 | |
| 419 | // ChannelInDoubtStatusValues defines the type-safe values for Channel.InDoubtStatus context |
| 420 | type ChannelInDoubtStatusValues struct { |
| 421 | Indoubt_status int64 |
| 422 | } |
| 423 | |
| 424 | // ChannelInDoubtStatusContext provides type-safe operations for Channel.InDoubtStatus context |
| 425 | type ChannelInDoubtStatusContext struct { |
| 426 | framework.Context[ChannelLabels] |
| 427 | } |
| 428 | |
| 429 | // Set provides type-safe dimension setting for Channel.InDoubtStatus context |
| 430 | func (c ChannelInDoubtStatusContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelInDoubtStatusValues) { |
| 431 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 432 | "indoubt_status": values.Indoubt_status, |
| 433 | }) |
| 434 | } |
| 435 | |
| 436 | // SetUpdateEvery sets the update interval for this instance |
| 437 | func (c ChannelInDoubtStatusContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 438 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 439 | } |
| 440 | |
| 441 | // ChannelSSLKeyResetsValues defines the type-safe values for Channel.SSLKeyResets context |
| 442 | type ChannelSSLKeyResetsValues struct { |
| 443 | Ssl_key_resets int64 |
| 444 | } |
| 445 | |
| 446 | // ChannelSSLKeyResetsContext provides type-safe operations for Channel.SSLKeyResets context |
| 447 | type ChannelSSLKeyResetsContext struct { |
| 448 | framework.Context[ChannelLabels] |
| 449 | } |
| 450 | |
| 451 | // Set provides type-safe dimension setting for Channel.SSLKeyResets context |
| 452 | func (c ChannelSSLKeyResetsContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelSSLKeyResetsValues) { |
| 453 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 454 | "ssl_key_resets": values.Ssl_key_resets, |
| 455 | }) |
| 456 | } |
| 457 | |
| 458 | // SetUpdateEvery sets the update interval for this instance |
| 459 | func (c ChannelSSLKeyResetsContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 460 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 461 | } |
| 462 | |
| 463 | // ChannelNPMSpeedValues defines the type-safe values for Channel.NPMSpeed context |
| 464 | type ChannelNPMSpeedValues struct { |
| 465 | Npm_speed int64 |
| 466 | } |
| 467 | |
| 468 | // ChannelNPMSpeedContext provides type-safe operations for Channel.NPMSpeed context |
| 469 | type ChannelNPMSpeedContext struct { |
| 470 | framework.Context[ChannelLabels] |
| 471 | } |
| 472 | |
| 473 | // Set provides type-safe dimension setting for Channel.NPMSpeed context |
| 474 | func (c ChannelNPMSpeedContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelNPMSpeedValues) { |
| 475 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 476 | "npm_speed": values.Npm_speed, |
| 477 | }) |
| 478 | } |
| 479 | |
| 480 | // SetUpdateEvery sets the update interval for this instance |
| 481 | func (c ChannelNPMSpeedContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 482 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 483 | } |
| 484 | |
| 485 | // ChannelCurrentSharingConversationsValues defines the type-safe values for Channel.CurrentSharingConversations context |
| 486 | type ChannelCurrentSharingConversationsValues struct { |
| 487 | Current_sharing int64 |
| 488 | } |
| 489 | |
| 490 | // ChannelCurrentSharingConversationsContext provides type-safe operations for Channel.CurrentSharingConversations context |
| 491 | type ChannelCurrentSharingConversationsContext struct { |
| 492 | framework.Context[ChannelLabels] |
| 493 | } |
| 494 | |
| 495 | // Set provides type-safe dimension setting for Channel.CurrentSharingConversations context |
| 496 | func (c ChannelCurrentSharingConversationsContext) Set(state *framework.CollectorState, labels ChannelLabels, values ChannelCurrentSharingConversationsValues) { |
| 497 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 498 | "current_sharing": values.Current_sharing, |
| 499 | }) |
| 500 | } |
| 501 | |
| 502 | // SetUpdateEvery sets the update interval for this instance |
| 503 | func (c ChannelCurrentSharingConversationsContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelLabels, updateEvery int) { |
| 504 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 505 | } |
| 506 | |
| 507 | // ChannelLabels defines the required labels for Channel contexts |
| 508 | type ChannelLabels struct { |
| 509 | Channel string |
| 510 | Type string |
| 511 | } |
| 512 | |
| 513 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 514 | func (l ChannelLabels) InstanceID(contextName string) string { |
| 515 | // Label order from YAML: channel, type |
| 516 | return contextName + "." + cleanLabelValue(l.Channel) + "_" + cleanLabelValue(l.Type) |
| 517 | } |
| 518 | |
| 519 | // Channel contains all metric contexts for Channel |
| 520 | var Channel = struct { |
| 521 | Status ChannelStatusContext |
| 522 | Messages ChannelMessagesContext |
| 523 | Bytes ChannelBytesContext |
| 524 | Batches ChannelBatchesContext |
| 525 | BatchSize ChannelBatchSizeContext |
| 526 | BatchInterval ChannelBatchIntervalContext |
| 527 | Intervals ChannelIntervalsContext |
| 528 | ShortRetryCount ChannelShortRetryCountContext |
| 529 | LongRetryInterval ChannelLongRetryIntervalContext |
| 530 | MaxMessageLength ChannelMaxMessageLengthContext |
| 531 | SharingConversations ChannelSharingConversationsContext |
| 532 | NetworkPriority ChannelNetworkPriorityContext |
| 533 | BufferCounts ChannelBufferCountsContext |
| 534 | CurrentMessages ChannelCurrentMessagesContext |
| 535 | XmitQueueTime ChannelXmitQueueTimeContext |
| 536 | MCAStatus ChannelMCAStatusContext |
| 537 | InDoubtStatus ChannelInDoubtStatusContext |
| 538 | SSLKeyResets ChannelSSLKeyResetsContext |
| 539 | NPMSpeed ChannelNPMSpeedContext |
| 540 | CurrentSharingConversations ChannelCurrentSharingConversationsContext |
| 541 | }{ |
| 542 | Status: ChannelStatusContext{ |
| 543 | Context: framework.Context[ChannelLabels]{ |
| 544 | Name: "mq.channel.status", |
| 545 | Family: "channels/overview", |
| 546 | Title: "Channel Status", |
| 547 | Units: "status", |
| 548 | Type: module.Stacked, |
| 549 | Priority: 3000, |
| 550 | UpdateEvery: 1, |
| 551 | Dimensions: []framework.Dimension{ |
| 552 | { |
| 553 | Name: "inactive", |
| 554 | Algorithm: module.Absolute, |
| 555 | Mul: 1, |
| 556 | Div: 1, |
| 557 | Precision: 1, |
| 558 | }, |
| 559 | { |
| 560 | Name: "binding", |
| 561 | Algorithm: module.Absolute, |
| 562 | Mul: 1, |
| 563 | Div: 1, |
| 564 | Precision: 1, |
| 565 | }, |
| 566 | { |
| 567 | Name: "starting", |
| 568 | Algorithm: module.Absolute, |
| 569 | Mul: 1, |
| 570 | Div: 1, |
| 571 | Precision: 1, |
| 572 | }, |
| 573 | { |
| 574 | Name: "running", |
| 575 | Algorithm: module.Absolute, |
| 576 | Mul: 1, |
| 577 | Div: 1, |
| 578 | Precision: 1, |
| 579 | }, |
| 580 | { |
| 581 | Name: "stopping", |
| 582 | Algorithm: module.Absolute, |
| 583 | Mul: 1, |
| 584 | Div: 1, |
| 585 | Precision: 1, |
| 586 | }, |
| 587 | { |
| 588 | Name: "retrying", |
| 589 | Algorithm: module.Absolute, |
| 590 | Mul: 1, |
| 591 | Div: 1, |
| 592 | Precision: 1, |
| 593 | }, |
| 594 | { |
| 595 | Name: "stopped", |
| 596 | Algorithm: module.Absolute, |
| 597 | Mul: 1, |
| 598 | Div: 1, |
| 599 | Precision: 1, |
| 600 | }, |
| 601 | { |
| 602 | Name: "requesting", |
| 603 | Algorithm: module.Absolute, |
| 604 | Mul: 1, |
| 605 | Div: 1, |
| 606 | Precision: 1, |
| 607 | }, |
| 608 | { |
| 609 | Name: "paused", |
| 610 | Algorithm: module.Absolute, |
| 611 | Mul: 1, |
| 612 | Div: 1, |
| 613 | Precision: 1, |
| 614 | }, |
| 615 | { |
| 616 | Name: "disconnected", |
| 617 | Algorithm: module.Absolute, |
| 618 | Mul: 1, |
| 619 | Div: 1, |
| 620 | Precision: 1, |
| 621 | }, |
| 622 | { |
| 623 | Name: "initializing", |
| 624 | Algorithm: module.Absolute, |
| 625 | Mul: 1, |
| 626 | Div: 1, |
| 627 | Precision: 1, |
| 628 | }, |
| 629 | { |
| 630 | Name: "switching", |
| 631 | Algorithm: module.Absolute, |
| 632 | Mul: 1, |
| 633 | Div: 1, |
| 634 | Precision: 1, |
| 635 | }, |
| 636 | }, |
| 637 | LabelKeys: []string{ |
| 638 | "channel", |
| 639 | "type", |
| 640 | }, |
| 641 | }, |
| 642 | }, |
| 643 | Messages: ChannelMessagesContext{ |
| 644 | Context: framework.Context[ChannelLabels]{ |
| 645 | Name: "mq.channel.messages", |
| 646 | Family: "channels/overview", |
| 647 | Title: "Channel Message Rate", |
| 648 | Units: "messages/s", |
| 649 | Type: module.Line, |
| 650 | Priority: 3001, |
| 651 | UpdateEvery: 1, |
| 652 | Dimensions: []framework.Dimension{ |
| 653 | { |
| 654 | Name: "messages", |
| 655 | Algorithm: module.Incremental, |
| 656 | Mul: 1, |
| 657 | Div: 1, |
| 658 | Precision: 1, |
| 659 | }, |
| 660 | }, |
| 661 | LabelKeys: []string{ |
| 662 | "channel", |
| 663 | "type", |
| 664 | }, |
| 665 | }, |
| 666 | }, |
| 667 | Bytes: ChannelBytesContext{ |
| 668 | Context: framework.Context[ChannelLabels]{ |
| 669 | Name: "mq.channel.bytes", |
| 670 | Family: "channels/overview", |
| 671 | Title: "Channel Data Transfer Rate", |
| 672 | Units: "bytes/s", |
| 673 | Type: module.Line, |
| 674 | Priority: 3002, |
| 675 | UpdateEvery: 1, |
| 676 | Dimensions: []framework.Dimension{ |
| 677 | { |
| 678 | Name: "bytes", |
| 679 | Algorithm: module.Incremental, |
| 680 | Mul: 1, |
| 681 | Div: 1, |
| 682 | Precision: 1, |
| 683 | }, |
| 684 | }, |
| 685 | LabelKeys: []string{ |
| 686 | "channel", |
| 687 | "type", |
| 688 | }, |
| 689 | }, |
| 690 | }, |
| 691 | Batches: ChannelBatchesContext{ |
| 692 | Context: framework.Context[ChannelLabels]{ |
| 693 | Name: "mq.channel.batches", |
| 694 | Family: "channels/overview", |
| 695 | Title: "Channel Batch Rate", |
| 696 | Units: "batches/s", |
| 697 | Type: module.Line, |
| 698 | Priority: 3003, |
| 699 | UpdateEvery: 1, |
| 700 | Dimensions: []framework.Dimension{ |
| 701 | { |
| 702 | Name: "batches", |
| 703 | Algorithm: module.Incremental, |
| 704 | Mul: 1, |
| 705 | Div: 1, |
| 706 | Precision: 1, |
| 707 | }, |
| 708 | }, |
| 709 | LabelKeys: []string{ |
| 710 | "channel", |
| 711 | "type", |
| 712 | }, |
| 713 | }, |
| 714 | }, |
| 715 | BatchSize: ChannelBatchSizeContext{ |
| 716 | Context: framework.Context[ChannelLabels]{ |
| 717 | Name: "mq.channel.batch_size", |
| 718 | Family: "channels/overview", |
| 719 | Title: "Channel Batch Size", |
| 720 | Units: "messages", |
| 721 | Type: module.Line, |
| 722 | Priority: 3004, |
| 723 | UpdateEvery: 1, |
| 724 | Dimensions: []framework.Dimension{ |
| 725 | { |
| 726 | Name: "batch_size", |
| 727 | Algorithm: module.Absolute, |
| 728 | Mul: 1, |
| 729 | Div: 1, |
| 730 | Precision: 1, |
| 731 | }, |
| 732 | }, |
| 733 | LabelKeys: []string{ |
| 734 | "channel", |
| 735 | "type", |
| 736 | }, |
| 737 | }, |
| 738 | }, |
| 739 | BatchInterval: ChannelBatchIntervalContext{ |
| 740 | Context: framework.Context[ChannelLabels]{ |
| 741 | Name: "mq.channel.batch_interval", |
| 742 | Family: "channels/overview", |
| 743 | Title: "Channel Batch Interval", |
| 744 | Units: "milliseconds", |
| 745 | Type: module.Line, |
| 746 | Priority: 3005, |
| 747 | UpdateEvery: 1, |
| 748 | Dimensions: []framework.Dimension{ |
| 749 | { |
| 750 | Name: "batch_interval", |
| 751 | Algorithm: module.Absolute, |
| 752 | Mul: 1, |
| 753 | Div: 1, |
| 754 | Precision: 1, |
| 755 | }, |
| 756 | }, |
| 757 | LabelKeys: []string{ |
| 758 | "channel", |
| 759 | "type", |
| 760 | }, |
| 761 | }, |
| 762 | }, |
| 763 | Intervals: ChannelIntervalsContext{ |
| 764 | Context: framework.Context[ChannelLabels]{ |
| 765 | Name: "mq.channel.intervals", |
| 766 | Family: "channels/overview", |
| 767 | Title: "Channel Intervals", |
| 768 | Units: "seconds", |
| 769 | Type: module.Line, |
| 770 | Priority: 3006, |
| 771 | UpdateEvery: 1, |
| 772 | Dimensions: []framework.Dimension{ |
| 773 | { |
| 774 | Name: "disc_interval", |
| 775 | Algorithm: module.Absolute, |
| 776 | Mul: 1, |
| 777 | Div: 1, |
| 778 | Precision: 1, |
| 779 | }, |
| 780 | { |
| 781 | Name: "hb_interval", |
| 782 | Algorithm: module.Absolute, |
| 783 | Mul: 1, |
| 784 | Div: 1, |
| 785 | Precision: 1, |
| 786 | }, |
| 787 | { |
| 788 | Name: "keep_alive_interval", |
| 789 | Algorithm: module.Absolute, |
| 790 | Mul: 1, |
| 791 | Div: 1, |
| 792 | Precision: 1, |
| 793 | }, |
| 794 | }, |
| 795 | LabelKeys: []string{ |
| 796 | "channel", |
| 797 | "type", |
| 798 | }, |
| 799 | }, |
| 800 | }, |
| 801 | ShortRetryCount: ChannelShortRetryCountContext{ |
| 802 | Context: framework.Context[ChannelLabels]{ |
| 803 | Name: "mq.channel.short_retry_count", |
| 804 | Family: "channels/overview", |
| 805 | Title: "Channel Short Retry Count", |
| 806 | Units: "retries", |
| 807 | Type: module.Line, |
| 808 | Priority: 3007, |
| 809 | UpdateEvery: 1, |
| 810 | Dimensions: []framework.Dimension{ |
| 811 | { |
| 812 | Name: "short_retry", |
| 813 | Algorithm: module.Absolute, |
| 814 | Mul: 1, |
| 815 | Div: 1, |
| 816 | Precision: 1, |
| 817 | }, |
| 818 | }, |
| 819 | LabelKeys: []string{ |
| 820 | "channel", |
| 821 | "type", |
| 822 | }, |
| 823 | }, |
| 824 | }, |
| 825 | LongRetryInterval: ChannelLongRetryIntervalContext{ |
| 826 | Context: framework.Context[ChannelLabels]{ |
| 827 | Name: "mq.channel.long_retry_interval", |
| 828 | Family: "channels/overview", |
| 829 | Title: "Channel Long Retry Interval", |
| 830 | Units: "seconds", |
| 831 | Type: module.Line, |
| 832 | Priority: 3008, |
| 833 | UpdateEvery: 1, |
| 834 | Dimensions: []framework.Dimension{ |
| 835 | { |
| 836 | Name: "long_retry", |
| 837 | Algorithm: module.Absolute, |
| 838 | Mul: 1, |
| 839 | Div: 1, |
| 840 | Precision: 1, |
| 841 | }, |
| 842 | }, |
| 843 | LabelKeys: []string{ |
| 844 | "channel", |
| 845 | "type", |
| 846 | }, |
| 847 | }, |
| 848 | }, |
| 849 | MaxMessageLength: ChannelMaxMessageLengthContext{ |
| 850 | Context: framework.Context[ChannelLabels]{ |
| 851 | Name: "mq.channel.max_msg_length", |
| 852 | Family: "channels/overview", |
| 853 | Title: "Channel Max Message Length", |
| 854 | Units: "bytes", |
| 855 | Type: module.Line, |
| 856 | Priority: 3009, |
| 857 | UpdateEvery: 1, |
| 858 | Dimensions: []framework.Dimension{ |
| 859 | { |
| 860 | Name: "max_msg_length", |
| 861 | Algorithm: module.Absolute, |
| 862 | Mul: 1, |
| 863 | Div: 1, |
| 864 | Precision: 1, |
| 865 | }, |
| 866 | }, |
| 867 | LabelKeys: []string{ |
| 868 | "channel", |
| 869 | "type", |
| 870 | }, |
| 871 | }, |
| 872 | }, |
| 873 | SharingConversations: ChannelSharingConversationsContext{ |
| 874 | Context: framework.Context[ChannelLabels]{ |
| 875 | Name: "mq.channel.sharing_conversations", |
| 876 | Family: "channels/overview", |
| 877 | Title: "Channel Sharing Conversations", |
| 878 | Units: "conversations", |
| 879 | Type: module.Line, |
| 880 | Priority: 3010, |
| 881 | UpdateEvery: 1, |
| 882 | Dimensions: []framework.Dimension{ |
| 883 | { |
| 884 | Name: "sharing_conversations", |
| 885 | Algorithm: module.Absolute, |
| 886 | Mul: 1, |
| 887 | Div: 1, |
| 888 | Precision: 1, |
| 889 | }, |
| 890 | }, |
| 891 | LabelKeys: []string{ |
| 892 | "channel", |
| 893 | "type", |
| 894 | }, |
| 895 | }, |
| 896 | }, |
| 897 | NetworkPriority: ChannelNetworkPriorityContext{ |
| 898 | Context: framework.Context[ChannelLabels]{ |
| 899 | Name: "mq.channel.network_priority", |
| 900 | Family: "channels/overview", |
| 901 | Title: "Channel Network Priority", |
| 902 | Units: "priority", |
| 903 | Type: module.Line, |
| 904 | Priority: 3011, |
| 905 | UpdateEvery: 1, |
| 906 | Dimensions: []framework.Dimension{ |
| 907 | { |
| 908 | Name: "network_priority", |
| 909 | Algorithm: module.Absolute, |
| 910 | Mul: 1, |
| 911 | Div: 1, |
| 912 | Precision: 1, |
| 913 | }, |
| 914 | }, |
| 915 | LabelKeys: []string{ |
| 916 | "channel", |
| 917 | "type", |
| 918 | }, |
| 919 | }, |
| 920 | }, |
| 921 | BufferCounts: ChannelBufferCountsContext{ |
| 922 | Context: framework.Context[ChannelLabels]{ |
| 923 | Name: "mq.channel.buffer_counts", |
| 924 | Family: "channels/overview", |
| 925 | Title: "Channel Buffer Counts", |
| 926 | Units: "buffers", |
| 927 | Type: module.Line, |
| 928 | Priority: 3012, |
| 929 | UpdateEvery: 1, |
| 930 | Dimensions: []framework.Dimension{ |
| 931 | { |
| 932 | Name: "sent", |
| 933 | Algorithm: module.Absolute, |
| 934 | Mul: 1, |
| 935 | Div: 1, |
| 936 | Precision: 1, |
| 937 | }, |
| 938 | { |
| 939 | Name: "received", |
| 940 | Algorithm: module.Absolute, |
| 941 | Mul: 1, |
| 942 | Div: 1, |
| 943 | Precision: 1, |
| 944 | }, |
| 945 | }, |
| 946 | LabelKeys: []string{ |
| 947 | "channel", |
| 948 | "type", |
| 949 | }, |
| 950 | }, |
| 951 | }, |
| 952 | CurrentMessages: ChannelCurrentMessagesContext{ |
| 953 | Context: framework.Context[ChannelLabels]{ |
| 954 | Name: "mq.channel.current_messages", |
| 955 | Family: "channels/overview", |
| 956 | Title: "Channel Current Messages", |
| 957 | Units: "messages", |
| 958 | Type: module.Line, |
| 959 | Priority: 3013, |
| 960 | UpdateEvery: 1, |
| 961 | Dimensions: []framework.Dimension{ |
| 962 | { |
| 963 | Name: "current", |
| 964 | Algorithm: module.Absolute, |
| 965 | Mul: 1, |
| 966 | Div: 1, |
| 967 | Precision: 1, |
| 968 | }, |
| 969 | }, |
| 970 | LabelKeys: []string{ |
| 971 | "channel", |
| 972 | "type", |
| 973 | }, |
| 974 | }, |
| 975 | }, |
| 976 | XmitQueueTime: ChannelXmitQueueTimeContext{ |
| 977 | Context: framework.Context[ChannelLabels]{ |
| 978 | Name: "mq.channel.xmitq_time", |
| 979 | Family: "channels/overview", |
| 980 | Title: "Channel Transmission Queue Time", |
| 981 | Units: "milliseconds", |
| 982 | Type: module.Line, |
| 983 | Priority: 3014, |
| 984 | UpdateEvery: 1, |
| 985 | Dimensions: []framework.Dimension{ |
| 986 | { |
| 987 | Name: "xmitq_time", |
| 988 | Algorithm: module.Absolute, |
| 989 | Mul: 1, |
| 990 | Div: 1, |
| 991 | Precision: 1, |
| 992 | }, |
| 993 | }, |
| 994 | LabelKeys: []string{ |
| 995 | "channel", |
| 996 | "type", |
| 997 | }, |
| 998 | }, |
| 999 | }, |
| 1000 | MCAStatus: ChannelMCAStatusContext{ |
| 1001 | Context: framework.Context[ChannelLabels]{ |
| 1002 | Name: "mq.channel.mca_status", |
| 1003 | Family: "channels/overview", |
| 1004 | Title: "Channel MCA Status", |
| 1005 | Units: "status", |
| 1006 | Type: module.Line, |
| 1007 | Priority: 3015, |
| 1008 | UpdateEvery: 1, |
| 1009 | Dimensions: []framework.Dimension{ |
| 1010 | { |
| 1011 | Name: "mca_status", |
| 1012 | Algorithm: module.Absolute, |
| 1013 | Mul: 1, |
| 1014 | Div: 1, |
| 1015 | Precision: 1, |
| 1016 | }, |
| 1017 | }, |
| 1018 | LabelKeys: []string{ |
| 1019 | "channel", |
| 1020 | "type", |
| 1021 | }, |
| 1022 | }, |
| 1023 | }, |
| 1024 | InDoubtStatus: ChannelInDoubtStatusContext{ |
| 1025 | Context: framework.Context[ChannelLabels]{ |
| 1026 | Name: "mq.channel.indoubt_status", |
| 1027 | Family: "channels/overview", |
| 1028 | Title: "Channel In-Doubt Status", |
| 1029 | Units: "status", |
| 1030 | Type: module.Line, |
| 1031 | Priority: 3016, |
| 1032 | UpdateEvery: 1, |
| 1033 | Dimensions: []framework.Dimension{ |
| 1034 | { |
| 1035 | Name: "indoubt_status", |
| 1036 | Algorithm: module.Absolute, |
| 1037 | Mul: 1, |
| 1038 | Div: 1, |
| 1039 | Precision: 1, |
| 1040 | }, |
| 1041 | }, |
| 1042 | LabelKeys: []string{ |
| 1043 | "channel", |
| 1044 | "type", |
| 1045 | }, |
| 1046 | }, |
| 1047 | }, |
| 1048 | SSLKeyResets: ChannelSSLKeyResetsContext{ |
| 1049 | Context: framework.Context[ChannelLabels]{ |
| 1050 | Name: "mq.channel.ssl_key_resets", |
| 1051 | Family: "channels/overview", |
| 1052 | Title: "Channel SSL Key Resets", |
| 1053 | Units: "resets", |
| 1054 | Type: module.Line, |
| 1055 | Priority: 3017, |
| 1056 | UpdateEvery: 1, |
| 1057 | Dimensions: []framework.Dimension{ |
| 1058 | { |
| 1059 | Name: "ssl_key_resets", |
| 1060 | Algorithm: module.Absolute, |
| 1061 | Mul: 1, |
| 1062 | Div: 1, |
| 1063 | Precision: 1, |
| 1064 | }, |
| 1065 | }, |
| 1066 | LabelKeys: []string{ |
| 1067 | "channel", |
| 1068 | "type", |
| 1069 | }, |
| 1070 | }, |
| 1071 | }, |
| 1072 | NPMSpeed: ChannelNPMSpeedContext{ |
| 1073 | Context: framework.Context[ChannelLabels]{ |
| 1074 | Name: "mq.channel.npm_speed", |
| 1075 | Family: "channels/overview", |
| 1076 | Title: "Channel Non-Persistent Message Speed", |
| 1077 | Units: "speed", |
| 1078 | Type: module.Line, |
| 1079 | Priority: 3018, |
| 1080 | UpdateEvery: 1, |
| 1081 | Dimensions: []framework.Dimension{ |
| 1082 | { |
| 1083 | Name: "npm_speed", |
| 1084 | Algorithm: module.Absolute, |
| 1085 | Mul: 1, |
| 1086 | Div: 1, |
| 1087 | Precision: 1, |
| 1088 | }, |
| 1089 | }, |
| 1090 | LabelKeys: []string{ |
| 1091 | "channel", |
| 1092 | "type", |
| 1093 | }, |
| 1094 | }, |
| 1095 | }, |
| 1096 | CurrentSharingConversations: ChannelCurrentSharingConversationsContext{ |
| 1097 | Context: framework.Context[ChannelLabels]{ |
| 1098 | Name: "mq.channel.current_sharing_convs", |
| 1099 | Family: "channels/overview", |
| 1100 | Title: "Channel Current Sharing Conversations", |
| 1101 | Units: "conversations", |
| 1102 | Type: module.Line, |
| 1103 | Priority: 3019, |
| 1104 | UpdateEvery: 1, |
| 1105 | Dimensions: []framework.Dimension{ |
| 1106 | { |
| 1107 | Name: "current_sharing", |
| 1108 | Algorithm: module.Absolute, |
| 1109 | Mul: 1, |
| 1110 | Div: 1, |
| 1111 | Precision: 1, |
| 1112 | }, |
| 1113 | }, |
| 1114 | LabelKeys: []string{ |
| 1115 | "channel", |
| 1116 | "type", |
| 1117 | }, |
| 1118 | }, |
| 1119 | }, |
| 1120 | } |
| 1121 | |
| 1122 | // --- ChannelStatistics --- |
| 1123 | |
| 1124 | // ChannelStatisticsMessagesValues defines the type-safe values for ChannelStatistics.Messages context |
| 1125 | type ChannelStatisticsMessagesValues struct { |
| 1126 | Messages int64 |
| 1127 | } |
| 1128 | |
| 1129 | // ChannelStatisticsMessagesContext provides type-safe operations for ChannelStatistics.Messages context |
| 1130 | type ChannelStatisticsMessagesContext struct { |
| 1131 | framework.Context[ChannelStatisticsLabels] |
| 1132 | } |
| 1133 | |
| 1134 | // Set provides type-safe dimension setting for ChannelStatistics.Messages context |
| 1135 | func (c ChannelStatisticsMessagesContext) Set(state *framework.CollectorState, labels ChannelStatisticsLabels, values ChannelStatisticsMessagesValues) { |
| 1136 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1137 | "messages": values.Messages, |
| 1138 | }) |
| 1139 | } |
| 1140 | |
| 1141 | // SetUpdateEvery sets the update interval for this instance |
| 1142 | func (c ChannelStatisticsMessagesContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelStatisticsLabels, updateEvery int) { |
| 1143 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1144 | } |
| 1145 | |
| 1146 | // ChannelStatisticsBytesValues defines the type-safe values for ChannelStatistics.Bytes context |
| 1147 | type ChannelStatisticsBytesValues struct { |
| 1148 | Bytes int64 |
| 1149 | } |
| 1150 | |
| 1151 | // ChannelStatisticsBytesContext provides type-safe operations for ChannelStatistics.Bytes context |
| 1152 | type ChannelStatisticsBytesContext struct { |
| 1153 | framework.Context[ChannelStatisticsLabels] |
| 1154 | } |
| 1155 | |
| 1156 | // Set provides type-safe dimension setting for ChannelStatistics.Bytes context |
| 1157 | func (c ChannelStatisticsBytesContext) Set(state *framework.CollectorState, labels ChannelStatisticsLabels, values ChannelStatisticsBytesValues) { |
| 1158 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1159 | "bytes": values.Bytes, |
| 1160 | }) |
| 1161 | } |
| 1162 | |
| 1163 | // SetUpdateEvery sets the update interval for this instance |
| 1164 | func (c ChannelStatisticsBytesContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelStatisticsLabels, updateEvery int) { |
| 1165 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1166 | } |
| 1167 | |
| 1168 | // ChannelStatisticsBatchesValues defines the type-safe values for ChannelStatistics.Batches context |
| 1169 | type ChannelStatisticsBatchesValues struct { |
| 1170 | Full_batches int64 |
| 1171 | Incomplete_batches int64 |
| 1172 | } |
| 1173 | |
| 1174 | // ChannelStatisticsBatchesContext provides type-safe operations for ChannelStatistics.Batches context |
| 1175 | type ChannelStatisticsBatchesContext struct { |
| 1176 | framework.Context[ChannelStatisticsLabels] |
| 1177 | } |
| 1178 | |
| 1179 | // Set provides type-safe dimension setting for ChannelStatistics.Batches context |
| 1180 | func (c ChannelStatisticsBatchesContext) Set(state *framework.CollectorState, labels ChannelStatisticsLabels, values ChannelStatisticsBatchesValues) { |
| 1181 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1182 | "full_batches": values.Full_batches, |
| 1183 | "incomplete_batches": values.Incomplete_batches, |
| 1184 | }) |
| 1185 | } |
| 1186 | |
| 1187 | // SetUpdateEvery sets the update interval for this instance |
| 1188 | func (c ChannelStatisticsBatchesContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelStatisticsLabels, updateEvery int) { |
| 1189 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1190 | } |
| 1191 | |
| 1192 | // ChannelStatisticsBatchSizeValues defines the type-safe values for ChannelStatistics.BatchSize context |
| 1193 | type ChannelStatisticsBatchSizeValues struct { |
| 1194 | Avg_batch_size int64 |
| 1195 | } |
| 1196 | |
| 1197 | // ChannelStatisticsBatchSizeContext provides type-safe operations for ChannelStatistics.BatchSize context |
| 1198 | type ChannelStatisticsBatchSizeContext struct { |
| 1199 | framework.Context[ChannelStatisticsLabels] |
| 1200 | } |
| 1201 | |
| 1202 | // Set provides type-safe dimension setting for ChannelStatistics.BatchSize context |
| 1203 | func (c ChannelStatisticsBatchSizeContext) Set(state *framework.CollectorState, labels ChannelStatisticsLabels, values ChannelStatisticsBatchSizeValues) { |
| 1204 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1205 | "avg_batch_size": values.Avg_batch_size, |
| 1206 | }) |
| 1207 | } |
| 1208 | |
| 1209 | // SetUpdateEvery sets the update interval for this instance |
| 1210 | func (c ChannelStatisticsBatchSizeContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelStatisticsLabels, updateEvery int) { |
| 1211 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1212 | } |
| 1213 | |
| 1214 | // ChannelStatisticsPutRetriesValues defines the type-safe values for ChannelStatistics.PutRetries context |
| 1215 | type ChannelStatisticsPutRetriesValues struct { |
| 1216 | Put_retries int64 |
| 1217 | } |
| 1218 | |
| 1219 | // ChannelStatisticsPutRetriesContext provides type-safe operations for ChannelStatistics.PutRetries context |
| 1220 | type ChannelStatisticsPutRetriesContext struct { |
| 1221 | framework.Context[ChannelStatisticsLabels] |
| 1222 | } |
| 1223 | |
| 1224 | // Set provides type-safe dimension setting for ChannelStatistics.PutRetries context |
| 1225 | func (c ChannelStatisticsPutRetriesContext) Set(state *framework.CollectorState, labels ChannelStatisticsLabels, values ChannelStatisticsPutRetriesValues) { |
| 1226 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1227 | "put_retries": values.Put_retries, |
| 1228 | }) |
| 1229 | } |
| 1230 | |
| 1231 | // SetUpdateEvery sets the update interval for this instance |
| 1232 | func (c ChannelStatisticsPutRetriesContext) SetUpdateEvery(state *framework.CollectorState, labels ChannelStatisticsLabels, updateEvery int) { |
| 1233 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1234 | } |
| 1235 | |
| 1236 | // ChannelStatisticsLabels defines the required labels for ChannelStatistics contexts |
| 1237 | type ChannelStatisticsLabels struct { |
| 1238 | Channel string |
| 1239 | Type string |
| 1240 | } |
| 1241 | |
| 1242 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 1243 | func (l ChannelStatisticsLabels) InstanceID(contextName string) string { |
| 1244 | // Label order from YAML: channel, type |
| 1245 | return contextName + "." + cleanLabelValue(l.Channel) + "_" + cleanLabelValue(l.Type) |
| 1246 | } |
| 1247 | |
| 1248 | // ChannelStatistics contains all metric contexts for ChannelStatistics |
| 1249 | var ChannelStatistics = struct { |
| 1250 | Messages ChannelStatisticsMessagesContext |
| 1251 | Bytes ChannelStatisticsBytesContext |
| 1252 | Batches ChannelStatisticsBatchesContext |
| 1253 | BatchSize ChannelStatisticsBatchSizeContext |
| 1254 | PutRetries ChannelStatisticsPutRetriesContext |
| 1255 | }{ |
| 1256 | Messages: ChannelStatisticsMessagesContext{ |
| 1257 | Context: framework.Context[ChannelStatisticsLabels]{ |
| 1258 | Name: "mq.channel_stats.messages", |
| 1259 | Family: "channels/statistics", |
| 1260 | Title: "Channel Messages (Statistics)", |
| 1261 | Units: "messages/s", |
| 1262 | Type: module.Line, |
| 1263 | Priority: 7000, |
| 1264 | UpdateEvery: 1, |
| 1265 | Dimensions: []framework.Dimension{ |
| 1266 | { |
| 1267 | Name: "messages", |
| 1268 | Algorithm: module.Incremental, |
| 1269 | Mul: 1, |
| 1270 | Div: 1, |
| 1271 | Precision: 1, |
| 1272 | }, |
| 1273 | }, |
| 1274 | LabelKeys: []string{ |
| 1275 | "channel", |
| 1276 | "type", |
| 1277 | }, |
| 1278 | }, |
| 1279 | }, |
| 1280 | Bytes: ChannelStatisticsBytesContext{ |
| 1281 | Context: framework.Context[ChannelStatisticsLabels]{ |
| 1282 | Name: "mq.channel_stats.bytes", |
| 1283 | Family: "channels/statistics", |
| 1284 | Title: "Channel Bytes (Statistics)", |
| 1285 | Units: "bytes/s", |
| 1286 | Type: module.Line, |
| 1287 | Priority: 7001, |
| 1288 | UpdateEvery: 1, |
| 1289 | Dimensions: []framework.Dimension{ |
| 1290 | { |
| 1291 | Name: "bytes", |
| 1292 | Algorithm: module.Incremental, |
| 1293 | Mul: 1, |
| 1294 | Div: 1, |
| 1295 | Precision: 1, |
| 1296 | }, |
| 1297 | }, |
| 1298 | LabelKeys: []string{ |
| 1299 | "channel", |
| 1300 | "type", |
| 1301 | }, |
| 1302 | }, |
| 1303 | }, |
| 1304 | Batches: ChannelStatisticsBatchesContext{ |
| 1305 | Context: framework.Context[ChannelStatisticsLabels]{ |
| 1306 | Name: "mq.channel_stats.batches", |
| 1307 | Family: "channels/statistics", |
| 1308 | Title: "Channel Batches (Statistics)", |
| 1309 | Units: "batches/s", |
| 1310 | Type: module.Line, |
| 1311 | Priority: 7002, |
| 1312 | UpdateEvery: 1, |
| 1313 | Dimensions: []framework.Dimension{ |
| 1314 | { |
| 1315 | Name: "full_batches", |
| 1316 | Algorithm: module.Incremental, |
| 1317 | Mul: 1, |
| 1318 | Div: 1, |
| 1319 | Precision: 1, |
| 1320 | }, |
| 1321 | { |
| 1322 | Name: "incomplete_batches", |
| 1323 | Algorithm: module.Incremental, |
| 1324 | Mul: 1, |
| 1325 | Div: 1, |
| 1326 | Precision: 1, |
| 1327 | }, |
| 1328 | }, |
| 1329 | LabelKeys: []string{ |
| 1330 | "channel", |
| 1331 | "type", |
| 1332 | }, |
| 1333 | }, |
| 1334 | }, |
| 1335 | BatchSize: ChannelStatisticsBatchSizeContext{ |
| 1336 | Context: framework.Context[ChannelStatisticsLabels]{ |
| 1337 | Name: "mq.channel_stats.batch_size", |
| 1338 | Family: "channels/statistics", |
| 1339 | Title: "Channel Average Batch Size (Statistics)", |
| 1340 | Units: "messages", |
| 1341 | Type: module.Line, |
| 1342 | Priority: 7003, |
| 1343 | UpdateEvery: 1, |
| 1344 | Dimensions: []framework.Dimension{ |
| 1345 | { |
| 1346 | Name: "avg_batch_size", |
| 1347 | Algorithm: module.Absolute, |
| 1348 | Mul: 1, |
| 1349 | Div: 1, |
| 1350 | Precision: 1, |
| 1351 | }, |
| 1352 | }, |
| 1353 | LabelKeys: []string{ |
| 1354 | "channel", |
| 1355 | "type", |
| 1356 | }, |
| 1357 | }, |
| 1358 | }, |
| 1359 | PutRetries: ChannelStatisticsPutRetriesContext{ |
| 1360 | Context: framework.Context[ChannelStatisticsLabels]{ |
| 1361 | Name: "mq.channel_stats.put_retries", |
| 1362 | Family: "channels/statistics", |
| 1363 | Title: "Channel Put Retries (Statistics)", |
| 1364 | Units: "retries/s", |
| 1365 | Type: module.Line, |
| 1366 | Priority: 7004, |
| 1367 | UpdateEvery: 1, |
| 1368 | Dimensions: []framework.Dimension{ |
| 1369 | { |
| 1370 | Name: "put_retries", |
| 1371 | Algorithm: module.Incremental, |
| 1372 | Mul: 1, |
| 1373 | Div: 1, |
| 1374 | Precision: 1, |
| 1375 | }, |
| 1376 | }, |
| 1377 | LabelKeys: []string{ |
| 1378 | "channel", |
| 1379 | "type", |
| 1380 | }, |
| 1381 | }, |
| 1382 | }, |
| 1383 | } |
| 1384 | |
| 1385 | // --- Listener --- |
| 1386 | |
| 1387 | // ListenerStatusValues defines the type-safe values for Listener.Status context |
| 1388 | type ListenerStatusValues struct { |
| 1389 | Stopped int64 |
| 1390 | Starting int64 |
| 1391 | Running int64 |
| 1392 | Stopping int64 |
| 1393 | Retrying int64 |
| 1394 | } |
| 1395 | |
| 1396 | // ListenerStatusContext provides type-safe operations for Listener.Status context |
| 1397 | type ListenerStatusContext struct { |
| 1398 | framework.Context[ListenerLabels] |
| 1399 | } |
| 1400 | |
| 1401 | // Set provides type-safe dimension setting for Listener.Status context |
| 1402 | func (c ListenerStatusContext) Set(state *framework.CollectorState, labels ListenerLabels, values ListenerStatusValues) { |
| 1403 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1404 | "stopped": values.Stopped, |
| 1405 | "starting": values.Starting, |
| 1406 | "running": values.Running, |
| 1407 | "stopping": values.Stopping, |
| 1408 | "retrying": values.Retrying, |
| 1409 | }) |
| 1410 | } |
| 1411 | |
| 1412 | // SetUpdateEvery sets the update interval for this instance |
| 1413 | func (c ListenerStatusContext) SetUpdateEvery(state *framework.CollectorState, labels ListenerLabels, updateEvery int) { |
| 1414 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1415 | } |
| 1416 | |
| 1417 | // ListenerBacklogValues defines the type-safe values for Listener.Backlog context |
| 1418 | type ListenerBacklogValues struct { |
| 1419 | Backlog int64 |
| 1420 | } |
| 1421 | |
| 1422 | // ListenerBacklogContext provides type-safe operations for Listener.Backlog context |
| 1423 | type ListenerBacklogContext struct { |
| 1424 | framework.Context[ListenerLabels] |
| 1425 | } |
| 1426 | |
| 1427 | // Set provides type-safe dimension setting for Listener.Backlog context |
| 1428 | func (c ListenerBacklogContext) Set(state *framework.CollectorState, labels ListenerLabels, values ListenerBacklogValues) { |
| 1429 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1430 | "backlog": values.Backlog, |
| 1431 | }) |
| 1432 | } |
| 1433 | |
| 1434 | // SetUpdateEvery sets the update interval for this instance |
| 1435 | func (c ListenerBacklogContext) SetUpdateEvery(state *framework.CollectorState, labels ListenerLabels, updateEvery int) { |
| 1436 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1437 | } |
| 1438 | |
| 1439 | // ListenerUptimeValues defines the type-safe values for Listener.Uptime context |
| 1440 | type ListenerUptimeValues struct { |
| 1441 | Uptime int64 |
| 1442 | } |
| 1443 | |
| 1444 | // ListenerUptimeContext provides type-safe operations for Listener.Uptime context |
| 1445 | type ListenerUptimeContext struct { |
| 1446 | framework.Context[ListenerLabels] |
| 1447 | } |
| 1448 | |
| 1449 | // Set provides type-safe dimension setting for Listener.Uptime context |
| 1450 | func (c ListenerUptimeContext) Set(state *framework.CollectorState, labels ListenerLabels, values ListenerUptimeValues) { |
| 1451 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1452 | "uptime": values.Uptime, |
| 1453 | }) |
| 1454 | } |
| 1455 | |
| 1456 | // SetUpdateEvery sets the update interval for this instance |
| 1457 | func (c ListenerUptimeContext) SetUpdateEvery(state *framework.CollectorState, labels ListenerLabels, updateEvery int) { |
| 1458 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1459 | } |
| 1460 | |
| 1461 | // ListenerLabels defines the required labels for Listener contexts |
| 1462 | type ListenerLabels struct { |
| 1463 | Listener string |
| 1464 | Port string |
| 1465 | Ip_address string |
| 1466 | } |
| 1467 | |
| 1468 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 1469 | func (l ListenerLabels) InstanceID(contextName string) string { |
| 1470 | // Label order from YAML: listener, port, ip_address |
| 1471 | return contextName + "." + cleanLabelValue(l.Listener) + "_" + cleanLabelValue(l.Port) + "_" + cleanLabelValue(l.Ip_address) |
| 1472 | } |
| 1473 | |
| 1474 | // Listener contains all metric contexts for Listener |
| 1475 | var Listener = struct { |
| 1476 | Status ListenerStatusContext |
| 1477 | Backlog ListenerBacklogContext |
| 1478 | Uptime ListenerUptimeContext |
| 1479 | }{ |
| 1480 | Status: ListenerStatusContext{ |
| 1481 | Context: framework.Context[ListenerLabels]{ |
| 1482 | Name: "mq.listener.status", |
| 1483 | Family: "listeners", |
| 1484 | Title: "Listener Status", |
| 1485 | Units: "status", |
| 1486 | Type: module.Line, |
| 1487 | Priority: 5000, |
| 1488 | UpdateEvery: 1, |
| 1489 | Dimensions: []framework.Dimension{ |
| 1490 | { |
| 1491 | Name: "stopped", |
| 1492 | Algorithm: module.Absolute, |
| 1493 | Mul: 1, |
| 1494 | Div: 1, |
| 1495 | Precision: 1, |
| 1496 | }, |
| 1497 | { |
| 1498 | Name: "starting", |
| 1499 | Algorithm: module.Absolute, |
| 1500 | Mul: 1, |
| 1501 | Div: 1, |
| 1502 | Precision: 1, |
| 1503 | }, |
| 1504 | { |
| 1505 | Name: "running", |
| 1506 | Algorithm: module.Absolute, |
| 1507 | Mul: 1, |
| 1508 | Div: 1, |
| 1509 | Precision: 1, |
| 1510 | }, |
| 1511 | { |
| 1512 | Name: "stopping", |
| 1513 | Algorithm: module.Absolute, |
| 1514 | Mul: 1, |
| 1515 | Div: 1, |
| 1516 | Precision: 1, |
| 1517 | }, |
| 1518 | { |
| 1519 | Name: "retrying", |
| 1520 | Algorithm: module.Absolute, |
| 1521 | Mul: 1, |
| 1522 | Div: 1, |
| 1523 | Precision: 1, |
| 1524 | }, |
| 1525 | }, |
| 1526 | LabelKeys: []string{ |
| 1527 | "listener", |
| 1528 | "port", |
| 1529 | "ip_address", |
| 1530 | }, |
| 1531 | }, |
| 1532 | }, |
| 1533 | Backlog: ListenerBacklogContext{ |
| 1534 | Context: framework.Context[ListenerLabels]{ |
| 1535 | Name: "mq.listener.backlog", |
| 1536 | Family: "listeners", |
| 1537 | Title: "Listener Connection Backlog", |
| 1538 | Units: "connections", |
| 1539 | Type: module.Line, |
| 1540 | Priority: 5001, |
| 1541 | UpdateEvery: 1, |
| 1542 | Dimensions: []framework.Dimension{ |
| 1543 | { |
| 1544 | Name: "backlog", |
| 1545 | Algorithm: module.Absolute, |
| 1546 | Mul: 1, |
| 1547 | Div: 1, |
| 1548 | Precision: 1, |
| 1549 | }, |
| 1550 | }, |
| 1551 | LabelKeys: []string{ |
| 1552 | "listener", |
| 1553 | "port", |
| 1554 | "ip_address", |
| 1555 | }, |
| 1556 | }, |
| 1557 | }, |
| 1558 | Uptime: ListenerUptimeContext{ |
| 1559 | Context: framework.Context[ListenerLabels]{ |
| 1560 | Name: "mq.listener.uptime", |
| 1561 | Family: "listeners", |
| 1562 | Title: "Listener Uptime", |
| 1563 | Units: "seconds", |
| 1564 | Type: module.Line, |
| 1565 | Priority: 5002, |
| 1566 | UpdateEvery: 1, |
| 1567 | Dimensions: []framework.Dimension{ |
| 1568 | { |
| 1569 | Name: "uptime", |
| 1570 | Algorithm: module.Absolute, |
| 1571 | Mul: 1, |
| 1572 | Div: 1, |
| 1573 | Precision: 1, |
| 1574 | }, |
| 1575 | }, |
| 1576 | LabelKeys: []string{ |
| 1577 | "listener", |
| 1578 | "port", |
| 1579 | "ip_address", |
| 1580 | }, |
| 1581 | }, |
| 1582 | }, |
| 1583 | } |
| 1584 | |
| 1585 | // --- MQIStatistics --- |
| 1586 | |
| 1587 | // MQIStatisticsOpensValues defines the type-safe values for MQIStatistics.Opens context |
| 1588 | type MQIStatisticsOpensValues struct { |
| 1589 | Opens_total int64 |
| 1590 | Opens_failed int64 |
| 1591 | } |
| 1592 | |
| 1593 | // MQIStatisticsOpensContext provides type-safe operations for MQIStatistics.Opens context |
| 1594 | type MQIStatisticsOpensContext struct { |
| 1595 | framework.Context[MQIStatisticsLabels] |
| 1596 | } |
| 1597 | |
| 1598 | // Set provides type-safe dimension setting for MQIStatistics.Opens context |
| 1599 | func (c MQIStatisticsOpensContext) Set(state *framework.CollectorState, labels MQIStatisticsLabels, values MQIStatisticsOpensValues) { |
| 1600 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1601 | "opens_total": values.Opens_total, |
| 1602 | "opens_failed": values.Opens_failed, |
| 1603 | }) |
| 1604 | } |
| 1605 | |
| 1606 | // SetUpdateEvery sets the update interval for this instance |
| 1607 | func (c MQIStatisticsOpensContext) SetUpdateEvery(state *framework.CollectorState, labels MQIStatisticsLabels, updateEvery int) { |
| 1608 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1609 | } |
| 1610 | |
| 1611 | // MQIStatisticsClosesValues defines the type-safe values for MQIStatistics.Closes context |
| 1612 | type MQIStatisticsClosesValues struct { |
| 1613 | Closes_total int64 |
| 1614 | Closes_failed int64 |
| 1615 | } |
| 1616 | |
| 1617 | // MQIStatisticsClosesContext provides type-safe operations for MQIStatistics.Closes context |
| 1618 | type MQIStatisticsClosesContext struct { |
| 1619 | framework.Context[MQIStatisticsLabels] |
| 1620 | } |
| 1621 | |
| 1622 | // Set provides type-safe dimension setting for MQIStatistics.Closes context |
| 1623 | func (c MQIStatisticsClosesContext) Set(state *framework.CollectorState, labels MQIStatisticsLabels, values MQIStatisticsClosesValues) { |
| 1624 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1625 | "closes_total": values.Closes_total, |
| 1626 | "closes_failed": values.Closes_failed, |
| 1627 | }) |
| 1628 | } |
| 1629 | |
| 1630 | // SetUpdateEvery sets the update interval for this instance |
| 1631 | func (c MQIStatisticsClosesContext) SetUpdateEvery(state *framework.CollectorState, labels MQIStatisticsLabels, updateEvery int) { |
| 1632 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1633 | } |
| 1634 | |
| 1635 | // MQIStatisticsInqsValues defines the type-safe values for MQIStatistics.Inqs context |
| 1636 | type MQIStatisticsInqsValues struct { |
| 1637 | Inqs_total int64 |
| 1638 | Inqs_failed int64 |
| 1639 | } |
| 1640 | |
| 1641 | // MQIStatisticsInqsContext provides type-safe operations for MQIStatistics.Inqs context |
| 1642 | type MQIStatisticsInqsContext struct { |
| 1643 | framework.Context[MQIStatisticsLabels] |
| 1644 | } |
| 1645 | |
| 1646 | // Set provides type-safe dimension setting for MQIStatistics.Inqs context |
| 1647 | func (c MQIStatisticsInqsContext) Set(state *framework.CollectorState, labels MQIStatisticsLabels, values MQIStatisticsInqsValues) { |
| 1648 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1649 | "inqs_total": values.Inqs_total, |
| 1650 | "inqs_failed": values.Inqs_failed, |
| 1651 | }) |
| 1652 | } |
| 1653 | |
| 1654 | // SetUpdateEvery sets the update interval for this instance |
| 1655 | func (c MQIStatisticsInqsContext) SetUpdateEvery(state *framework.CollectorState, labels MQIStatisticsLabels, updateEvery int) { |
| 1656 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1657 | } |
| 1658 | |
| 1659 | // MQIStatisticsSetsValues defines the type-safe values for MQIStatistics.Sets context |
| 1660 | type MQIStatisticsSetsValues struct { |
| 1661 | Sets_total int64 |
| 1662 | Sets_failed int64 |
| 1663 | } |
| 1664 | |
| 1665 | // MQIStatisticsSetsContext provides type-safe operations for MQIStatistics.Sets context |
| 1666 | type MQIStatisticsSetsContext struct { |
| 1667 | framework.Context[MQIStatisticsLabels] |
| 1668 | } |
| 1669 | |
| 1670 | // Set provides type-safe dimension setting for MQIStatistics.Sets context |
| 1671 | func (c MQIStatisticsSetsContext) Set(state *framework.CollectorState, labels MQIStatisticsLabels, values MQIStatisticsSetsValues) { |
| 1672 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1673 | "sets_total": values.Sets_total, |
| 1674 | "sets_failed": values.Sets_failed, |
| 1675 | }) |
| 1676 | } |
| 1677 | |
| 1678 | // SetUpdateEvery sets the update interval for this instance |
| 1679 | func (c MQIStatisticsSetsContext) SetUpdateEvery(state *framework.CollectorState, labels MQIStatisticsLabels, updateEvery int) { |
| 1680 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1681 | } |
| 1682 | |
| 1683 | // MQIStatisticsLabels defines the required labels for MQIStatistics contexts |
| 1684 | type MQIStatisticsLabels struct { |
| 1685 | Queue_manager string |
| 1686 | } |
| 1687 | |
| 1688 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 1689 | func (l MQIStatisticsLabels) InstanceID(contextName string) string { |
| 1690 | // Label order from YAML: queue_manager |
| 1691 | return contextName + "." + cleanLabelValue(l.Queue_manager) |
| 1692 | } |
| 1693 | |
| 1694 | // MQIStatistics contains all metric contexts for MQIStatistics |
| 1695 | var MQIStatistics = struct { |
| 1696 | Opens MQIStatisticsOpensContext |
| 1697 | Closes MQIStatisticsClosesContext |
| 1698 | Inqs MQIStatisticsInqsContext |
| 1699 | Sets MQIStatisticsSetsContext |
| 1700 | }{ |
| 1701 | Opens: MQIStatisticsOpensContext{ |
| 1702 | Context: framework.Context[MQIStatisticsLabels]{ |
| 1703 | Name: "mq.mqi_stats.opens", |
| 1704 | Family: "queues/mqi_operations", |
| 1705 | Title: "MQOPEN Operations (Statistics)", |
| 1706 | Units: "operations/s", |
| 1707 | Type: module.Line, |
| 1708 | Priority: 8000, |
| 1709 | UpdateEvery: 1, |
| 1710 | Dimensions: []framework.Dimension{ |
| 1711 | { |
| 1712 | Name: "opens_total", |
| 1713 | Algorithm: module.Incremental, |
| 1714 | Mul: 1, |
| 1715 | Div: 1, |
| 1716 | Precision: 1, |
| 1717 | }, |
| 1718 | { |
| 1719 | Name: "opens_failed", |
| 1720 | Algorithm: module.Incremental, |
| 1721 | Mul: 1, |
| 1722 | Div: 1, |
| 1723 | Precision: 1, |
| 1724 | }, |
| 1725 | }, |
| 1726 | LabelKeys: []string{ |
| 1727 | "queue_manager", |
| 1728 | }, |
| 1729 | }, |
| 1730 | }, |
| 1731 | Closes: MQIStatisticsClosesContext{ |
| 1732 | Context: framework.Context[MQIStatisticsLabels]{ |
| 1733 | Name: "mq.mqi_stats.closes", |
| 1734 | Family: "queues/mqi_operations", |
| 1735 | Title: "MQCLOSE Operations (Statistics)", |
| 1736 | Units: "operations/s", |
| 1737 | Type: module.Line, |
| 1738 | Priority: 8001, |
| 1739 | UpdateEvery: 1, |
| 1740 | Dimensions: []framework.Dimension{ |
| 1741 | { |
| 1742 | Name: "closes_total", |
| 1743 | Algorithm: module.Incremental, |
| 1744 | Mul: 1, |
| 1745 | Div: 1, |
| 1746 | Precision: 1, |
| 1747 | }, |
| 1748 | { |
| 1749 | Name: "closes_failed", |
| 1750 | Algorithm: module.Incremental, |
| 1751 | Mul: 1, |
| 1752 | Div: 1, |
| 1753 | Precision: 1, |
| 1754 | }, |
| 1755 | }, |
| 1756 | LabelKeys: []string{ |
| 1757 | "queue_manager", |
| 1758 | }, |
| 1759 | }, |
| 1760 | }, |
| 1761 | Inqs: MQIStatisticsInqsContext{ |
| 1762 | Context: framework.Context[MQIStatisticsLabels]{ |
| 1763 | Name: "mq.mqi_stats.inqs", |
| 1764 | Family: "queues/mqi_operations", |
| 1765 | Title: "MQINQ Operations (Statistics)", |
| 1766 | Units: "operations/s", |
| 1767 | Type: module.Line, |
| 1768 | Priority: 8002, |
| 1769 | UpdateEvery: 1, |
| 1770 | Dimensions: []framework.Dimension{ |
| 1771 | { |
| 1772 | Name: "inqs_total", |
| 1773 | Algorithm: module.Incremental, |
| 1774 | Mul: 1, |
| 1775 | Div: 1, |
| 1776 | Precision: 1, |
| 1777 | }, |
| 1778 | { |
| 1779 | Name: "inqs_failed", |
| 1780 | Algorithm: module.Incremental, |
| 1781 | Mul: 1, |
| 1782 | Div: 1, |
| 1783 | Precision: 1, |
| 1784 | }, |
| 1785 | }, |
| 1786 | LabelKeys: []string{ |
| 1787 | "queue_manager", |
| 1788 | }, |
| 1789 | }, |
| 1790 | }, |
| 1791 | Sets: MQIStatisticsSetsContext{ |
| 1792 | Context: framework.Context[MQIStatisticsLabels]{ |
| 1793 | Name: "mq.mqi_stats.sets", |
| 1794 | Family: "queues/mqi_operations", |
| 1795 | Title: "MQSET Operations (Statistics)", |
| 1796 | Units: "operations/s", |
| 1797 | Type: module.Line, |
| 1798 | Priority: 8003, |
| 1799 | UpdateEvery: 1, |
| 1800 | Dimensions: []framework.Dimension{ |
| 1801 | { |
| 1802 | Name: "sets_total", |
| 1803 | Algorithm: module.Incremental, |
| 1804 | Mul: 1, |
| 1805 | Div: 1, |
| 1806 | Precision: 1, |
| 1807 | }, |
| 1808 | { |
| 1809 | Name: "sets_failed", |
| 1810 | Algorithm: module.Incremental, |
| 1811 | Mul: 1, |
| 1812 | Div: 1, |
| 1813 | Precision: 1, |
| 1814 | }, |
| 1815 | }, |
| 1816 | LabelKeys: []string{ |
| 1817 | "queue_manager", |
| 1818 | }, |
| 1819 | }, |
| 1820 | }, |
| 1821 | } |
| 1822 | |
| 1823 | // --- Queue --- |
| 1824 | |
| 1825 | // QueueDepthValues defines the type-safe values for Queue.Depth context |
| 1826 | type QueueDepthValues struct { |
| 1827 | Current int64 |
| 1828 | Max int64 |
| 1829 | } |
| 1830 | |
| 1831 | // QueueDepthContext provides type-safe operations for Queue.Depth context |
| 1832 | type QueueDepthContext struct { |
| 1833 | framework.Context[QueueLabels] |
| 1834 | } |
| 1835 | |
| 1836 | // Set provides type-safe dimension setting for Queue.Depth context |
| 1837 | func (c QueueDepthContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueDepthValues) { |
| 1838 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1839 | "current": values.Current, |
| 1840 | "max": values.Max, |
| 1841 | }) |
| 1842 | } |
| 1843 | |
| 1844 | // SetUpdateEvery sets the update interval for this instance |
| 1845 | func (c QueueDepthContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 1846 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1847 | } |
| 1848 | |
| 1849 | // QueueDepthPercentageValues defines the type-safe values for Queue.DepthPercentage context |
| 1850 | type QueueDepthPercentageValues struct { |
| 1851 | Percentage int64 |
| 1852 | } |
| 1853 | |
| 1854 | // QueueDepthPercentageContext provides type-safe operations for Queue.DepthPercentage context |
| 1855 | type QueueDepthPercentageContext struct { |
| 1856 | framework.Context[QueueLabels] |
| 1857 | } |
| 1858 | |
| 1859 | // Set provides type-safe dimension setting for Queue.DepthPercentage context |
| 1860 | func (c QueueDepthPercentageContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueDepthPercentageValues) { |
| 1861 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1862 | "percentage": values.Percentage, |
| 1863 | }) |
| 1864 | } |
| 1865 | |
| 1866 | // SetUpdateEvery sets the update interval for this instance |
| 1867 | func (c QueueDepthPercentageContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 1868 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1869 | } |
| 1870 | |
| 1871 | // QueueMessagesValues defines the type-safe values for Queue.Messages context |
| 1872 | type QueueMessagesValues struct { |
| 1873 | Enqueued int64 |
| 1874 | Dequeued int64 |
| 1875 | } |
| 1876 | |
| 1877 | // QueueMessagesContext provides type-safe operations for Queue.Messages context |
| 1878 | type QueueMessagesContext struct { |
| 1879 | framework.Context[QueueLabels] |
| 1880 | } |
| 1881 | |
| 1882 | // Set provides type-safe dimension setting for Queue.Messages context |
| 1883 | func (c QueueMessagesContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueMessagesValues) { |
| 1884 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1885 | "enqueued": values.Enqueued, |
| 1886 | "dequeued": values.Dequeued, |
| 1887 | }) |
| 1888 | } |
| 1889 | |
| 1890 | // SetUpdateEvery sets the update interval for this instance |
| 1891 | func (c QueueMessagesContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 1892 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1893 | } |
| 1894 | |
| 1895 | // QueueConnectionsValues defines the type-safe values for Queue.Connections context |
| 1896 | type QueueConnectionsValues struct { |
| 1897 | Input int64 |
| 1898 | Output int64 |
| 1899 | } |
| 1900 | |
| 1901 | // QueueConnectionsContext provides type-safe operations for Queue.Connections context |
| 1902 | type QueueConnectionsContext struct { |
| 1903 | framework.Context[QueueLabels] |
| 1904 | } |
| 1905 | |
| 1906 | // Set provides type-safe dimension setting for Queue.Connections context |
| 1907 | func (c QueueConnectionsContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueConnectionsValues) { |
| 1908 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1909 | "input": values.Input, |
| 1910 | "output": values.Output, |
| 1911 | }) |
| 1912 | } |
| 1913 | |
| 1914 | // SetUpdateEvery sets the update interval for this instance |
| 1915 | func (c QueueConnectionsContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 1916 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1917 | } |
| 1918 | |
| 1919 | // QueueHighDepthValues defines the type-safe values for Queue.HighDepth context |
| 1920 | type QueueHighDepthValues struct { |
| 1921 | High_depth int64 |
| 1922 | } |
| 1923 | |
| 1924 | // QueueHighDepthContext provides type-safe operations for Queue.HighDepth context |
| 1925 | type QueueHighDepthContext struct { |
| 1926 | framework.Context[QueueLabels] |
| 1927 | } |
| 1928 | |
| 1929 | // Set provides type-safe dimension setting for Queue.HighDepth context |
| 1930 | func (c QueueHighDepthContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueHighDepthValues) { |
| 1931 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1932 | "high_depth": values.High_depth, |
| 1933 | }) |
| 1934 | } |
| 1935 | |
| 1936 | // SetUpdateEvery sets the update interval for this instance |
| 1937 | func (c QueueHighDepthContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 1938 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1939 | } |
| 1940 | |
| 1941 | // QueueUncommittedMessagesValues defines the type-safe values for Queue.UncommittedMessages context |
| 1942 | type QueueUncommittedMessagesValues struct { |
| 1943 | Uncommitted int64 |
| 1944 | } |
| 1945 | |
| 1946 | // QueueUncommittedMessagesContext provides type-safe operations for Queue.UncommittedMessages context |
| 1947 | type QueueUncommittedMessagesContext struct { |
| 1948 | framework.Context[QueueLabels] |
| 1949 | } |
| 1950 | |
| 1951 | // Set provides type-safe dimension setting for Queue.UncommittedMessages context |
| 1952 | func (c QueueUncommittedMessagesContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueUncommittedMessagesValues) { |
| 1953 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1954 | "uncommitted": values.Uncommitted, |
| 1955 | }) |
| 1956 | } |
| 1957 | |
| 1958 | // SetUpdateEvery sets the update interval for this instance |
| 1959 | func (c QueueUncommittedMessagesContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 1960 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1961 | } |
| 1962 | |
| 1963 | // QueueFileSizeValues defines the type-safe values for Queue.FileSize context |
| 1964 | type QueueFileSizeValues struct { |
| 1965 | Current int64 |
| 1966 | Max int64 |
| 1967 | } |
| 1968 | |
| 1969 | // QueueFileSizeContext provides type-safe operations for Queue.FileSize context |
| 1970 | type QueueFileSizeContext struct { |
| 1971 | framework.Context[QueueLabels] |
| 1972 | } |
| 1973 | |
| 1974 | // Set provides type-safe dimension setting for Queue.FileSize context |
| 1975 | func (c QueueFileSizeContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueFileSizeValues) { |
| 1976 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 1977 | "current": values.Current, |
| 1978 | "max": values.Max, |
| 1979 | }) |
| 1980 | } |
| 1981 | |
| 1982 | // SetUpdateEvery sets the update interval for this instance |
| 1983 | func (c QueueFileSizeContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 1984 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 1985 | } |
| 1986 | |
| 1987 | // QueueLastActivityValues defines the type-safe values for Queue.LastActivity context |
| 1988 | type QueueLastActivityValues struct { |
| 1989 | Since_last_get int64 |
| 1990 | Since_last_put int64 |
| 1991 | } |
| 1992 | |
| 1993 | // QueueLastActivityContext provides type-safe operations for Queue.LastActivity context |
| 1994 | type QueueLastActivityContext struct { |
| 1995 | framework.Context[QueueLabels] |
| 1996 | } |
| 1997 | |
| 1998 | // Set provides type-safe dimension setting for Queue.LastActivity context |
| 1999 | func (c QueueLastActivityContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueLastActivityValues) { |
| 2000 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2001 | "since_last_get": values.Since_last_get, |
| 2002 | "since_last_put": values.Since_last_put, |
| 2003 | }) |
| 2004 | } |
| 2005 | |
| 2006 | // SetUpdateEvery sets the update interval for this instance |
| 2007 | func (c QueueLastActivityContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2008 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2009 | } |
| 2010 | |
| 2011 | // QueueOldestMessageAgeValues defines the type-safe values for Queue.OldestMessageAge context |
| 2012 | type QueueOldestMessageAgeValues struct { |
| 2013 | Oldest_msg_age int64 |
| 2014 | } |
| 2015 | |
| 2016 | // QueueOldestMessageAgeContext provides type-safe operations for Queue.OldestMessageAge context |
| 2017 | type QueueOldestMessageAgeContext struct { |
| 2018 | framework.Context[QueueLabels] |
| 2019 | } |
| 2020 | |
| 2021 | // Set provides type-safe dimension setting for Queue.OldestMessageAge context |
| 2022 | func (c QueueOldestMessageAgeContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueOldestMessageAgeValues) { |
| 2023 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2024 | "oldest_msg_age": values.Oldest_msg_age, |
| 2025 | }) |
| 2026 | } |
| 2027 | |
| 2028 | // SetUpdateEvery sets the update interval for this instance |
| 2029 | func (c QueueOldestMessageAgeContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2030 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2031 | } |
| 2032 | |
| 2033 | // QueueQueueTimeIndicatorsValues defines the type-safe values for Queue.QueueTimeIndicators context |
| 2034 | type QueueQueueTimeIndicatorsValues struct { |
| 2035 | Short_period int64 |
| 2036 | Long_period int64 |
| 2037 | } |
| 2038 | |
| 2039 | // QueueQueueTimeIndicatorsContext provides type-safe operations for Queue.QueueTimeIndicators context |
| 2040 | type QueueQueueTimeIndicatorsContext struct { |
| 2041 | framework.Context[QueueLabels] |
| 2042 | } |
| 2043 | |
| 2044 | // Set provides type-safe dimension setting for Queue.QueueTimeIndicators context |
| 2045 | func (c QueueQueueTimeIndicatorsContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueQueueTimeIndicatorsValues) { |
| 2046 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2047 | "short_period": values.Short_period, |
| 2048 | "long_period": values.Long_period, |
| 2049 | }) |
| 2050 | } |
| 2051 | |
| 2052 | // SetUpdateEvery sets the update interval for this instance |
| 2053 | func (c QueueQueueTimeIndicatorsContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2054 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2055 | } |
| 2056 | |
| 2057 | // QueueServiceIntervalValues defines the type-safe values for Queue.ServiceInterval context |
| 2058 | type QueueServiceIntervalValues struct { |
| 2059 | Service_interval int64 |
| 2060 | } |
| 2061 | |
| 2062 | // QueueServiceIntervalContext provides type-safe operations for Queue.ServiceInterval context |
| 2063 | type QueueServiceIntervalContext struct { |
| 2064 | framework.Context[QueueLabels] |
| 2065 | } |
| 2066 | |
| 2067 | // Set provides type-safe dimension setting for Queue.ServiceInterval context |
| 2068 | func (c QueueServiceIntervalContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueServiceIntervalValues) { |
| 2069 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2070 | "service_interval": values.Service_interval, |
| 2071 | }) |
| 2072 | } |
| 2073 | |
| 2074 | // SetUpdateEvery sets the update interval for this instance |
| 2075 | func (c QueueServiceIntervalContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2076 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2077 | } |
| 2078 | |
| 2079 | // QueueInhibitStatusValues defines the type-safe values for Queue.InhibitStatus context |
| 2080 | type QueueInhibitStatusValues struct { |
| 2081 | Inhibit_get int64 |
| 2082 | Inhibit_put int64 |
| 2083 | } |
| 2084 | |
| 2085 | // QueueInhibitStatusContext provides type-safe operations for Queue.InhibitStatus context |
| 2086 | type QueueInhibitStatusContext struct { |
| 2087 | framework.Context[QueueLabels] |
| 2088 | } |
| 2089 | |
| 2090 | // Set provides type-safe dimension setting for Queue.InhibitStatus context |
| 2091 | func (c QueueInhibitStatusContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueInhibitStatusValues) { |
| 2092 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2093 | "inhibit_get": values.Inhibit_get, |
| 2094 | "inhibit_put": values.Inhibit_put, |
| 2095 | }) |
| 2096 | } |
| 2097 | |
| 2098 | // SetUpdateEvery sets the update interval for this instance |
| 2099 | func (c QueueInhibitStatusContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2100 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2101 | } |
| 2102 | |
| 2103 | // QueuePriorityValues defines the type-safe values for Queue.Priority context |
| 2104 | type QueuePriorityValues struct { |
| 2105 | Def_priority int64 |
| 2106 | } |
| 2107 | |
| 2108 | // QueuePriorityContext provides type-safe operations for Queue.Priority context |
| 2109 | type QueuePriorityContext struct { |
| 2110 | framework.Context[QueueLabels] |
| 2111 | } |
| 2112 | |
| 2113 | // Set provides type-safe dimension setting for Queue.Priority context |
| 2114 | func (c QueuePriorityContext) Set(state *framework.CollectorState, labels QueueLabels, values QueuePriorityValues) { |
| 2115 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2116 | "def_priority": values.Def_priority, |
| 2117 | }) |
| 2118 | } |
| 2119 | |
| 2120 | // SetUpdateEvery sets the update interval for this instance |
| 2121 | func (c QueuePriorityContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2122 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2123 | } |
| 2124 | |
| 2125 | // QueueMessagePersistenceValues defines the type-safe values for Queue.MessagePersistence context |
| 2126 | type QueueMessagePersistenceValues struct { |
| 2127 | Persistent int64 |
| 2128 | Non_persistent int64 |
| 2129 | } |
| 2130 | |
| 2131 | // QueueMessagePersistenceContext provides type-safe operations for Queue.MessagePersistence context |
| 2132 | type QueueMessagePersistenceContext struct { |
| 2133 | framework.Context[QueueLabels] |
| 2134 | } |
| 2135 | |
| 2136 | // Set provides type-safe dimension setting for Queue.MessagePersistence context |
| 2137 | func (c QueueMessagePersistenceContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueMessagePersistenceValues) { |
| 2138 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2139 | "persistent": values.Persistent, |
| 2140 | "non_persistent": values.Non_persistent, |
| 2141 | }) |
| 2142 | } |
| 2143 | |
| 2144 | // SetUpdateEvery sets the update interval for this instance |
| 2145 | func (c QueueMessagePersistenceContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2146 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2147 | } |
| 2148 | |
| 2149 | // QueueRetentionIntervalValues defines the type-safe values for Queue.RetentionInterval context |
| 2150 | type QueueRetentionIntervalValues struct { |
| 2151 | Retention_interval int64 |
| 2152 | } |
| 2153 | |
| 2154 | // QueueRetentionIntervalContext provides type-safe operations for Queue.RetentionInterval context |
| 2155 | type QueueRetentionIntervalContext struct { |
| 2156 | framework.Context[QueueLabels] |
| 2157 | } |
| 2158 | |
| 2159 | // Set provides type-safe dimension setting for Queue.RetentionInterval context |
| 2160 | func (c QueueRetentionIntervalContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueRetentionIntervalValues) { |
| 2161 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2162 | "retention_interval": values.Retention_interval, |
| 2163 | }) |
| 2164 | } |
| 2165 | |
| 2166 | // SetUpdateEvery sets the update interval for this instance |
| 2167 | func (c QueueRetentionIntervalContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2168 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2169 | } |
| 2170 | |
| 2171 | // QueueTriggersValues defines the type-safe values for Queue.Triggers context |
| 2172 | type QueueTriggersValues struct { |
| 2173 | Trigger_depth int64 |
| 2174 | Trigger_type int64 |
| 2175 | } |
| 2176 | |
| 2177 | // QueueTriggersContext provides type-safe operations for Queue.Triggers context |
| 2178 | type QueueTriggersContext struct { |
| 2179 | framework.Context[QueueLabels] |
| 2180 | } |
| 2181 | |
| 2182 | // Set provides type-safe dimension setting for Queue.Triggers context |
| 2183 | func (c QueueTriggersContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueTriggersValues) { |
| 2184 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2185 | "trigger_depth": values.Trigger_depth, |
| 2186 | "trigger_type": values.Trigger_type, |
| 2187 | }) |
| 2188 | } |
| 2189 | |
| 2190 | // SetUpdateEvery sets the update interval for this instance |
| 2191 | func (c QueueTriggersContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2192 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2193 | } |
| 2194 | |
| 2195 | // QueueBackoutThresholdValues defines the type-safe values for Queue.BackoutThreshold context |
| 2196 | type QueueBackoutThresholdValues struct { |
| 2197 | Backout_threshold int64 |
| 2198 | } |
| 2199 | |
| 2200 | // QueueBackoutThresholdContext provides type-safe operations for Queue.BackoutThreshold context |
| 2201 | type QueueBackoutThresholdContext struct { |
| 2202 | framework.Context[QueueLabels] |
| 2203 | } |
| 2204 | |
| 2205 | // Set provides type-safe dimension setting for Queue.BackoutThreshold context |
| 2206 | func (c QueueBackoutThresholdContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueBackoutThresholdValues) { |
| 2207 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2208 | "backout_threshold": values.Backout_threshold, |
| 2209 | }) |
| 2210 | } |
| 2211 | |
| 2212 | // SetUpdateEvery sets the update interval for this instance |
| 2213 | func (c QueueBackoutThresholdContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2214 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2215 | } |
| 2216 | |
| 2217 | // QueueMaxMessageLengthValues defines the type-safe values for Queue.MaxMessageLength context |
| 2218 | type QueueMaxMessageLengthValues struct { |
| 2219 | Max_msg_length int64 |
| 2220 | } |
| 2221 | |
| 2222 | // QueueMaxMessageLengthContext provides type-safe operations for Queue.MaxMessageLength context |
| 2223 | type QueueMaxMessageLengthContext struct { |
| 2224 | framework.Context[QueueLabels] |
| 2225 | } |
| 2226 | |
| 2227 | // Set provides type-safe dimension setting for Queue.MaxMessageLength context |
| 2228 | func (c QueueMaxMessageLengthContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueMaxMessageLengthValues) { |
| 2229 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2230 | "max_msg_length": values.Max_msg_length, |
| 2231 | }) |
| 2232 | } |
| 2233 | |
| 2234 | // SetUpdateEvery sets the update interval for this instance |
| 2235 | func (c QueueMaxMessageLengthContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2236 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2237 | } |
| 2238 | |
| 2239 | // QueueQueueScopeValues defines the type-safe values for Queue.QueueScope context |
| 2240 | type QueueQueueScopeValues struct { |
| 2241 | Queue_manager int64 |
| 2242 | Cell int64 |
| 2243 | } |
| 2244 | |
| 2245 | // QueueQueueScopeContext provides type-safe operations for Queue.QueueScope context |
| 2246 | type QueueQueueScopeContext struct { |
| 2247 | framework.Context[QueueLabels] |
| 2248 | } |
| 2249 | |
| 2250 | // Set provides type-safe dimension setting for Queue.QueueScope context |
| 2251 | func (c QueueQueueScopeContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueQueueScopeValues) { |
| 2252 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2253 | "queue_manager": values.Queue_manager, |
| 2254 | "cell": values.Cell, |
| 2255 | }) |
| 2256 | } |
| 2257 | |
| 2258 | // SetUpdateEvery sets the update interval for this instance |
| 2259 | func (c QueueQueueScopeContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2260 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2261 | } |
| 2262 | |
| 2263 | // QueueQueueUsageValues defines the type-safe values for Queue.QueueUsage context |
| 2264 | type QueueQueueUsageValues struct { |
| 2265 | Normal int64 |
| 2266 | Transmission int64 |
| 2267 | } |
| 2268 | |
| 2269 | // QueueQueueUsageContext provides type-safe operations for Queue.QueueUsage context |
| 2270 | type QueueQueueUsageContext struct { |
| 2271 | framework.Context[QueueLabels] |
| 2272 | } |
| 2273 | |
| 2274 | // Set provides type-safe dimension setting for Queue.QueueUsage context |
| 2275 | func (c QueueQueueUsageContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueQueueUsageValues) { |
| 2276 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2277 | "normal": values.Normal, |
| 2278 | "transmission": values.Transmission, |
| 2279 | }) |
| 2280 | } |
| 2281 | |
| 2282 | // SetUpdateEvery sets the update interval for this instance |
| 2283 | func (c QueueQueueUsageContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2284 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2285 | } |
| 2286 | |
| 2287 | // QueueMessageDeliverySequenceValues defines the type-safe values for Queue.MessageDeliverySequence context |
| 2288 | type QueueMessageDeliverySequenceValues struct { |
| 2289 | Priority int64 |
| 2290 | Fifo int64 |
| 2291 | } |
| 2292 | |
| 2293 | // QueueMessageDeliverySequenceContext provides type-safe operations for Queue.MessageDeliverySequence context |
| 2294 | type QueueMessageDeliverySequenceContext struct { |
| 2295 | framework.Context[QueueLabels] |
| 2296 | } |
| 2297 | |
| 2298 | // Set provides type-safe dimension setting for Queue.MessageDeliverySequence context |
| 2299 | func (c QueueMessageDeliverySequenceContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueMessageDeliverySequenceValues) { |
| 2300 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2301 | "priority": values.Priority, |
| 2302 | "fifo": values.Fifo, |
| 2303 | }) |
| 2304 | } |
| 2305 | |
| 2306 | // SetUpdateEvery sets the update interval for this instance |
| 2307 | func (c QueueMessageDeliverySequenceContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2308 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2309 | } |
| 2310 | |
| 2311 | // QueueHardenGetBackoutValues defines the type-safe values for Queue.HardenGetBackout context |
| 2312 | type QueueHardenGetBackoutValues struct { |
| 2313 | Enabled int64 |
| 2314 | Disabled int64 |
| 2315 | } |
| 2316 | |
| 2317 | // QueueHardenGetBackoutContext provides type-safe operations for Queue.HardenGetBackout context |
| 2318 | type QueueHardenGetBackoutContext struct { |
| 2319 | framework.Context[QueueLabels] |
| 2320 | } |
| 2321 | |
| 2322 | // Set provides type-safe dimension setting for Queue.HardenGetBackout context |
| 2323 | func (c QueueHardenGetBackoutContext) Set(state *framework.CollectorState, labels QueueLabels, values QueueHardenGetBackoutValues) { |
| 2324 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 2325 | "enabled": values.Enabled, |
| 2326 | "disabled": values.Disabled, |
| 2327 | }) |
| 2328 | } |
| 2329 | |
| 2330 | // SetUpdateEvery sets the update interval for this instance |
| 2331 | func (c QueueHardenGetBackoutContext) SetUpdateEvery(state *framework.CollectorState, labels QueueLabels, updateEvery int) { |
| 2332 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 2333 | } |
| 2334 | |
| 2335 | // QueueLabels defines the required labels for Queue contexts |
| 2336 | type QueueLabels struct { |
| 2337 | Queue string |
| 2338 | Type string |
| 2339 | } |
| 2340 | |
| 2341 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 2342 | func (l QueueLabels) InstanceID(contextName string) string { |
| 2343 | // Label order from YAML: queue, type |
| 2344 | return contextName + "." + cleanLabelValue(l.Queue) + "_" + cleanLabelValue(l.Type) |
| 2345 | } |
| 2346 | |
| 2347 | // Queue contains all metric contexts for Queue |
| 2348 | var Queue = struct { |
| 2349 | Depth QueueDepthContext |
| 2350 | DepthPercentage QueueDepthPercentageContext |
| 2351 | Messages QueueMessagesContext |
| 2352 | Connections QueueConnectionsContext |
| 2353 | HighDepth QueueHighDepthContext |
| 2354 | UncommittedMessages QueueUncommittedMessagesContext |
| 2355 | FileSize QueueFileSizeContext |
| 2356 | LastActivity QueueLastActivityContext |
| 2357 | OldestMessageAge QueueOldestMessageAgeContext |
| 2358 | QueueTimeIndicators QueueQueueTimeIndicatorsContext |
| 2359 | ServiceInterval QueueServiceIntervalContext |
| 2360 | InhibitStatus QueueInhibitStatusContext |
| 2361 | Priority QueuePriorityContext |
| 2362 | MessagePersistence QueueMessagePersistenceContext |
| 2363 | RetentionInterval QueueRetentionIntervalContext |
| 2364 | Triggers QueueTriggersContext |
| 2365 | BackoutThreshold QueueBackoutThresholdContext |
| 2366 | MaxMessageLength QueueMaxMessageLengthContext |
| 2367 | QueueScope QueueQueueScopeContext |
| 2368 | QueueUsage QueueQueueUsageContext |
| 2369 | MessageDeliverySequence QueueMessageDeliverySequenceContext |
| 2370 | HardenGetBackout QueueHardenGetBackoutContext |
| 2371 | }{ |
| 2372 | Depth: QueueDepthContext{ |
| 2373 | Context: framework.Context[QueueLabels]{ |
| 2374 | Name: "mq.queue.depth", |
| 2375 | Family: "queues/activity", |
| 2376 | Title: "Queue Depth", |
| 2377 | Units: "messages", |
| 2378 | Type: module.Line, |
| 2379 | Priority: 2000, |
| 2380 | UpdateEvery: 1, |
| 2381 | Dimensions: []framework.Dimension{ |
| 2382 | { |
| 2383 | Name: "current", |
| 2384 | Algorithm: module.Absolute, |
| 2385 | Mul: 1, |
| 2386 | Div: 1, |
| 2387 | Precision: 1, |
| 2388 | }, |
| 2389 | { |
| 2390 | Name: "max", |
| 2391 | Algorithm: module.Absolute, |
| 2392 | Mul: 1, |
| 2393 | Div: 1, |
| 2394 | Precision: 1, |
| 2395 | }, |
| 2396 | }, |
| 2397 | LabelKeys: []string{ |
| 2398 | "queue", |
| 2399 | "type", |
| 2400 | }, |
| 2401 | }, |
| 2402 | }, |
| 2403 | DepthPercentage: QueueDepthPercentageContext{ |
| 2404 | Context: framework.Context[QueueLabels]{ |
| 2405 | Name: "mq.queue.depth_percentage", |
| 2406 | Family: "queues/activity", |
| 2407 | Title: "Queue Depth Percentage", |
| 2408 | Units: "percentage", |
| 2409 | Type: module.Line, |
| 2410 | Priority: 2001, |
| 2411 | UpdateEvery: 1, |
| 2412 | Dimensions: []framework.Dimension{ |
| 2413 | { |
| 2414 | Name: "percentage", |
| 2415 | Algorithm: module.Absolute, |
| 2416 | Mul: 1, |
| 2417 | Div: 1000, |
| 2418 | Precision: 1000, |
| 2419 | }, |
| 2420 | }, |
| 2421 | LabelKeys: []string{ |
| 2422 | "queue", |
| 2423 | "type", |
| 2424 | }, |
| 2425 | }, |
| 2426 | }, |
| 2427 | Messages: QueueMessagesContext{ |
| 2428 | Context: framework.Context[QueueLabels]{ |
| 2429 | Name: "mq.queue.messages", |
| 2430 | Family: "queues/activity", |
| 2431 | Title: "Queue Messages", |
| 2432 | Units: "messages/s", |
| 2433 | Type: module.Line, |
| 2434 | Priority: 2002, |
| 2435 | UpdateEvery: 1, |
| 2436 | Dimensions: []framework.Dimension{ |
| 2437 | { |
| 2438 | Name: "enqueued", |
| 2439 | Algorithm: module.Incremental, |
| 2440 | Mul: 1, |
| 2441 | Div: 1, |
| 2442 | Precision: 1, |
| 2443 | }, |
| 2444 | { |
| 2445 | Name: "dequeued", |
| 2446 | Algorithm: module.Incremental, |
| 2447 | Mul: 1, |
| 2448 | Div: 1, |
| 2449 | Precision: 1, |
| 2450 | }, |
| 2451 | }, |
| 2452 | LabelKeys: []string{ |
| 2453 | "queue", |
| 2454 | "type", |
| 2455 | }, |
| 2456 | }, |
| 2457 | }, |
| 2458 | Connections: QueueConnectionsContext{ |
| 2459 | Context: framework.Context[QueueLabels]{ |
| 2460 | Name: "mq.queue.connections", |
| 2461 | Family: "queues/activity", |
| 2462 | Title: "Queue Connections", |
| 2463 | Units: "connections", |
| 2464 | Type: module.Line, |
| 2465 | Priority: 2003, |
| 2466 | UpdateEvery: 1, |
| 2467 | Dimensions: []framework.Dimension{ |
| 2468 | { |
| 2469 | Name: "input", |
| 2470 | Algorithm: module.Absolute, |
| 2471 | Mul: 1, |
| 2472 | Div: 1, |
| 2473 | Precision: 1, |
| 2474 | }, |
| 2475 | { |
| 2476 | Name: "output", |
| 2477 | Algorithm: module.Absolute, |
| 2478 | Mul: 1, |
| 2479 | Div: 1, |
| 2480 | Precision: 1, |
| 2481 | }, |
| 2482 | }, |
| 2483 | LabelKeys: []string{ |
| 2484 | "queue", |
| 2485 | "type", |
| 2486 | }, |
| 2487 | }, |
| 2488 | }, |
| 2489 | HighDepth: QueueHighDepthContext{ |
| 2490 | Context: framework.Context[QueueLabels]{ |
| 2491 | Name: "mq.queue.high_depth", |
| 2492 | Family: "queues/activity", |
| 2493 | Title: "Queue Peak Depth", |
| 2494 | Units: "messages", |
| 2495 | Type: module.Line, |
| 2496 | Priority: 2004, |
| 2497 | UpdateEvery: 1, |
| 2498 | Dimensions: []framework.Dimension{ |
| 2499 | { |
| 2500 | Name: "high_depth", |
| 2501 | Algorithm: module.Absolute, |
| 2502 | Mul: 1, |
| 2503 | Div: 1, |
| 2504 | Precision: 1, |
| 2505 | }, |
| 2506 | }, |
| 2507 | LabelKeys: []string{ |
| 2508 | "queue", |
| 2509 | "type", |
| 2510 | }, |
| 2511 | }, |
| 2512 | }, |
| 2513 | UncommittedMessages: QueueUncommittedMessagesContext{ |
| 2514 | Context: framework.Context[QueueLabels]{ |
| 2515 | Name: "mq.queue.uncommitted_msgs", |
| 2516 | Family: "queues/activity", |
| 2517 | Title: "Queue Uncommitted Messages", |
| 2518 | Units: "messages", |
| 2519 | Type: module.Line, |
| 2520 | Priority: 2005, |
| 2521 | UpdateEvery: 1, |
| 2522 | Dimensions: []framework.Dimension{ |
| 2523 | { |
| 2524 | Name: "uncommitted", |
| 2525 | Algorithm: module.Absolute, |
| 2526 | Mul: 1, |
| 2527 | Div: 1, |
| 2528 | Precision: 1, |
| 2529 | }, |
| 2530 | }, |
| 2531 | LabelKeys: []string{ |
| 2532 | "queue", |
| 2533 | "type", |
| 2534 | }, |
| 2535 | }, |
| 2536 | }, |
| 2537 | FileSize: QueueFileSizeContext{ |
| 2538 | Context: framework.Context[QueueLabels]{ |
| 2539 | Name: "mq.queue.file_size", |
| 2540 | Family: "queues/activity", |
| 2541 | Title: "Queue File Size", |
| 2542 | Units: "bytes", |
| 2543 | Type: module.Line, |
| 2544 | Priority: 2006, |
| 2545 | UpdateEvery: 1, |
| 2546 | Dimensions: []framework.Dimension{ |
| 2547 | { |
| 2548 | Name: "current", |
| 2549 | Algorithm: module.Absolute, |
| 2550 | Mul: 1, |
| 2551 | Div: 1, |
| 2552 | Precision: 1, |
| 2553 | }, |
| 2554 | { |
| 2555 | Name: "max", |
| 2556 | Algorithm: module.Absolute, |
| 2557 | Mul: 1, |
| 2558 | Div: 1, |
| 2559 | Precision: 1, |
| 2560 | }, |
| 2561 | }, |
| 2562 | LabelKeys: []string{ |
| 2563 | "queue", |
| 2564 | "type", |
| 2565 | }, |
| 2566 | }, |
| 2567 | }, |
| 2568 | LastActivity: QueueLastActivityContext{ |
| 2569 | Context: framework.Context[QueueLabels]{ |
| 2570 | Name: "mq.queue.last_activity", |
| 2571 | Family: "queues/activity", |
| 2572 | Title: "Time Since Last Queue Activity", |
| 2573 | Units: "seconds", |
| 2574 | Type: module.Line, |
| 2575 | Priority: 2007, |
| 2576 | UpdateEvery: 1, |
| 2577 | Dimensions: []framework.Dimension{ |
| 2578 | { |
| 2579 | Name: "since_last_get", |
| 2580 | Algorithm: module.Absolute, |
| 2581 | Mul: 1, |
| 2582 | Div: 1, |
| 2583 | Precision: 1, |
| 2584 | }, |
| 2585 | { |
| 2586 | Name: "since_last_put", |
| 2587 | Algorithm: module.Absolute, |
| 2588 | Mul: 1, |
| 2589 | Div: 1, |
| 2590 | Precision: 1, |
| 2591 | }, |
| 2592 | }, |
| 2593 | LabelKeys: []string{ |
| 2594 | "queue", |
| 2595 | "type", |
| 2596 | }, |
| 2597 | }, |
| 2598 | }, |
| 2599 | OldestMessageAge: QueueOldestMessageAgeContext{ |
| 2600 | Context: framework.Context[QueueLabels]{ |
| 2601 | Name: "mq.queue.oldest_msg_age", |
| 2602 | Family: "queues/performance", |
| 2603 | Title: "Queue Oldest Message Age", |
| 2604 | Units: "seconds", |
| 2605 | Type: module.Line, |
| 2606 | Priority: 2100, |
| 2607 | UpdateEvery: 1, |
| 2608 | Dimensions: []framework.Dimension{ |
| 2609 | { |
| 2610 | Name: "oldest_msg_age", |
| 2611 | Algorithm: module.Absolute, |
| 2612 | Mul: 1, |
| 2613 | Div: 1, |
| 2614 | Precision: 1, |
| 2615 | }, |
| 2616 | }, |
| 2617 | LabelKeys: []string{ |
| 2618 | "queue", |
| 2619 | "type", |
| 2620 | }, |
| 2621 | }, |
| 2622 | }, |
| 2623 | QueueTimeIndicators: QueueQueueTimeIndicatorsContext{ |
| 2624 | Context: framework.Context[QueueLabels]{ |
| 2625 | Name: "mq.queue.time_indicators", |
| 2626 | Family: "queues/performance", |
| 2627 | Title: "Queue Time Indicators", |
| 2628 | Units: "microseconds", |
| 2629 | Type: module.Line, |
| 2630 | Priority: 2101, |
| 2631 | UpdateEvery: 1, |
| 2632 | Dimensions: []framework.Dimension{ |
| 2633 | { |
| 2634 | Name: "short_period", |
| 2635 | Algorithm: module.Absolute, |
| 2636 | Mul: 1, |
| 2637 | Div: 1, |
| 2638 | Precision: 1, |
| 2639 | }, |
| 2640 | { |
| 2641 | Name: "long_period", |
| 2642 | Algorithm: module.Absolute, |
| 2643 | Mul: 1, |
| 2644 | Div: 1, |
| 2645 | Precision: 1, |
| 2646 | }, |
| 2647 | }, |
| 2648 | LabelKeys: []string{ |
| 2649 | "queue", |
| 2650 | "type", |
| 2651 | }, |
| 2652 | }, |
| 2653 | }, |
| 2654 | ServiceInterval: QueueServiceIntervalContext{ |
| 2655 | Context: framework.Context[QueueLabels]{ |
| 2656 | Name: "mq.queue.service_interval", |
| 2657 | Family: "queues/performance", |
| 2658 | Title: "Queue Service Interval", |
| 2659 | Units: "milliseconds", |
| 2660 | Type: module.Line, |
| 2661 | Priority: 2102, |
| 2662 | UpdateEvery: 1, |
| 2663 | Dimensions: []framework.Dimension{ |
| 2664 | { |
| 2665 | Name: "service_interval", |
| 2666 | Algorithm: module.Absolute, |
| 2667 | Mul: 1, |
| 2668 | Div: 1, |
| 2669 | Precision: 1, |
| 2670 | }, |
| 2671 | }, |
| 2672 | LabelKeys: []string{ |
| 2673 | "queue", |
| 2674 | "type", |
| 2675 | }, |
| 2676 | }, |
| 2677 | }, |
| 2678 | InhibitStatus: QueueInhibitStatusContext{ |
| 2679 | Context: framework.Context[QueueLabels]{ |
| 2680 | Name: "mq.queue.inhibit_status", |
| 2681 | Family: "queues/configuration", |
| 2682 | Title: "Queue Inhibit Status", |
| 2683 | Units: "status", |
| 2684 | Type: module.Line, |
| 2685 | Priority: 2200, |
| 2686 | UpdateEvery: 1, |
| 2687 | Dimensions: []framework.Dimension{ |
| 2688 | { |
| 2689 | Name: "inhibit_get", |
| 2690 | Algorithm: module.Absolute, |
| 2691 | Mul: 1, |
| 2692 | Div: 1, |
| 2693 | Precision: 1, |
| 2694 | }, |
| 2695 | { |
| 2696 | Name: "inhibit_put", |
| 2697 | Algorithm: module.Absolute, |
| 2698 | Mul: 1, |
| 2699 | Div: 1, |
| 2700 | Precision: 1, |
| 2701 | }, |
| 2702 | }, |
| 2703 | LabelKeys: []string{ |
| 2704 | "queue", |
| 2705 | "type", |
| 2706 | }, |
| 2707 | }, |
| 2708 | }, |
| 2709 | Priority: QueuePriorityContext{ |
| 2710 | Context: framework.Context[QueueLabels]{ |
| 2711 | Name: "mq.queue.priority", |
| 2712 | Family: "queues/configuration", |
| 2713 | Title: "Queue Priority Configuration", |
| 2714 | Units: "priority", |
| 2715 | Type: module.Line, |
| 2716 | Priority: 2201, |
| 2717 | UpdateEvery: 1, |
| 2718 | Dimensions: []framework.Dimension{ |
| 2719 | { |
| 2720 | Name: "def_priority", |
| 2721 | Algorithm: module.Absolute, |
| 2722 | Mul: 1, |
| 2723 | Div: 1, |
| 2724 | Precision: 1, |
| 2725 | }, |
| 2726 | }, |
| 2727 | LabelKeys: []string{ |
| 2728 | "queue", |
| 2729 | "type", |
| 2730 | }, |
| 2731 | }, |
| 2732 | }, |
| 2733 | MessagePersistence: QueueMessagePersistenceContext{ |
| 2734 | Context: framework.Context[QueueLabels]{ |
| 2735 | Name: "mq.queue.message_persistence", |
| 2736 | Family: "queues/configuration", |
| 2737 | Title: "Queue Default Message Persistence", |
| 2738 | Units: "boolean", |
| 2739 | Type: module.Line, |
| 2740 | Priority: 2202, |
| 2741 | UpdateEvery: 1, |
| 2742 | Dimensions: []framework.Dimension{ |
| 2743 | { |
| 2744 | Name: "persistent", |
| 2745 | Algorithm: module.Absolute, |
| 2746 | Mul: 1, |
| 2747 | Div: 1, |
| 2748 | Precision: 1, |
| 2749 | }, |
| 2750 | { |
| 2751 | Name: "non_persistent", |
| 2752 | Algorithm: module.Absolute, |
| 2753 | Mul: 1, |
| 2754 | Div: 1, |
| 2755 | Precision: 1, |
| 2756 | }, |
| 2757 | }, |
| 2758 | LabelKeys: []string{ |
| 2759 | "queue", |
| 2760 | "type", |
| 2761 | }, |
| 2762 | }, |
| 2763 | }, |
| 2764 | RetentionInterval: QueueRetentionIntervalContext{ |
| 2765 | Context: framework.Context[QueueLabels]{ |
| 2766 | Name: "mq.queue.retention_interval", |
| 2767 | Family: "queues/configuration", |
| 2768 | Title: "Queue Retention Interval", |
| 2769 | Units: "hours", |
| 2770 | Type: module.Line, |
| 2771 | Priority: 2203, |
| 2772 | UpdateEvery: 1, |
| 2773 | Dimensions: []framework.Dimension{ |
| 2774 | { |
| 2775 | Name: "retention_interval", |
| 2776 | Algorithm: module.Absolute, |
| 2777 | Mul: 1, |
| 2778 | Div: 1, |
| 2779 | Precision: 1, |
| 2780 | }, |
| 2781 | }, |
| 2782 | LabelKeys: []string{ |
| 2783 | "queue", |
| 2784 | "type", |
| 2785 | }, |
| 2786 | }, |
| 2787 | }, |
| 2788 | Triggers: QueueTriggersContext{ |
| 2789 | Context: framework.Context[QueueLabels]{ |
| 2790 | Name: "mq.queue.triggers", |
| 2791 | Family: "queues/limits", |
| 2792 | Title: "Queue Trigger Configuration", |
| 2793 | Units: "messages", |
| 2794 | Type: module.Line, |
| 2795 | Priority: 2300, |
| 2796 | UpdateEvery: 1, |
| 2797 | Dimensions: []framework.Dimension{ |
| 2798 | { |
| 2799 | Name: "trigger_depth", |
| 2800 | Algorithm: module.Absolute, |
| 2801 | Mul: 1, |
| 2802 | Div: 1, |
| 2803 | Precision: 1, |
| 2804 | }, |
| 2805 | { |
| 2806 | Name: "trigger_type", |
| 2807 | Algorithm: module.Absolute, |
| 2808 | Mul: 1, |
| 2809 | Div: 1, |
| 2810 | Precision: 1, |
| 2811 | }, |
| 2812 | }, |
| 2813 | LabelKeys: []string{ |
| 2814 | "queue", |
| 2815 | "type", |
| 2816 | }, |
| 2817 | }, |
| 2818 | }, |
| 2819 | BackoutThreshold: QueueBackoutThresholdContext{ |
| 2820 | Context: framework.Context[QueueLabels]{ |
| 2821 | Name: "mq.queue.backout_threshold", |
| 2822 | Family: "queues/limits", |
| 2823 | Title: "Queue Error Handling", |
| 2824 | Units: "retries", |
| 2825 | Type: module.Line, |
| 2826 | Priority: 2301, |
| 2827 | UpdateEvery: 1, |
| 2828 | Dimensions: []framework.Dimension{ |
| 2829 | { |
| 2830 | Name: "backout_threshold", |
| 2831 | Algorithm: module.Absolute, |
| 2832 | Mul: 1, |
| 2833 | Div: 1, |
| 2834 | Precision: 1, |
| 2835 | }, |
| 2836 | }, |
| 2837 | LabelKeys: []string{ |
| 2838 | "queue", |
| 2839 | "type", |
| 2840 | }, |
| 2841 | }, |
| 2842 | }, |
| 2843 | MaxMessageLength: QueueMaxMessageLengthContext{ |
| 2844 | Context: framework.Context[QueueLabels]{ |
| 2845 | Name: "mq.queue.max_msg_length", |
| 2846 | Family: "queues/limits", |
| 2847 | Title: "Queue Max Message Length", |
| 2848 | Units: "bytes", |
| 2849 | Type: module.Line, |
| 2850 | Priority: 2302, |
| 2851 | UpdateEvery: 1, |
| 2852 | Dimensions: []framework.Dimension{ |
| 2853 | { |
| 2854 | Name: "max_msg_length", |
| 2855 | Algorithm: module.Absolute, |
| 2856 | Mul: 1, |
| 2857 | Div: 1, |
| 2858 | Precision: 1, |
| 2859 | }, |
| 2860 | }, |
| 2861 | LabelKeys: []string{ |
| 2862 | "queue", |
| 2863 | "type", |
| 2864 | }, |
| 2865 | }, |
| 2866 | }, |
| 2867 | QueueScope: QueueQueueScopeContext{ |
| 2868 | Context: framework.Context[QueueLabels]{ |
| 2869 | Name: "mq.queue.scope", |
| 2870 | Family: "queues/behavior", |
| 2871 | Title: "Queue Scope", |
| 2872 | Units: "boolean", |
| 2873 | Type: module.Line, |
| 2874 | Priority: 2400, |
| 2875 | UpdateEvery: 1, |
| 2876 | Dimensions: []framework.Dimension{ |
| 2877 | { |
| 2878 | Name: "queue_manager", |
| 2879 | Algorithm: module.Absolute, |
| 2880 | Mul: 1, |
| 2881 | Div: 1, |
| 2882 | Precision: 1, |
| 2883 | }, |
| 2884 | { |
| 2885 | Name: "cell", |
| 2886 | Algorithm: module.Absolute, |
| 2887 | Mul: 1, |
| 2888 | Div: 1, |
| 2889 | Precision: 1, |
| 2890 | }, |
| 2891 | }, |
| 2892 | LabelKeys: []string{ |
| 2893 | "queue", |
| 2894 | "type", |
| 2895 | }, |
| 2896 | }, |
| 2897 | }, |
| 2898 | QueueUsage: QueueQueueUsageContext{ |
| 2899 | Context: framework.Context[QueueLabels]{ |
| 2900 | Name: "mq.queue.usage", |
| 2901 | Family: "queues/behavior", |
| 2902 | Title: "Queue Usage Type", |
| 2903 | Units: "boolean", |
| 2904 | Type: module.Line, |
| 2905 | Priority: 2401, |
| 2906 | UpdateEvery: 1, |
| 2907 | Dimensions: []framework.Dimension{ |
| 2908 | { |
| 2909 | Name: "normal", |
| 2910 | Algorithm: module.Absolute, |
| 2911 | Mul: 1, |
| 2912 | Div: 1, |
| 2913 | Precision: 1, |
| 2914 | }, |
| 2915 | { |
| 2916 | Name: "transmission", |
| 2917 | Algorithm: module.Absolute, |
| 2918 | Mul: 1, |
| 2919 | Div: 1, |
| 2920 | Precision: 1, |
| 2921 | }, |
| 2922 | }, |
| 2923 | LabelKeys: []string{ |
| 2924 | "queue", |
| 2925 | "type", |
| 2926 | }, |
| 2927 | }, |
| 2928 | }, |
| 2929 | MessageDeliverySequence: QueueMessageDeliverySequenceContext{ |
| 2930 | Context: framework.Context[QueueLabels]{ |
| 2931 | Name: "mq.queue.msg_delivery_sequence", |
| 2932 | Family: "queues/behavior", |
| 2933 | Title: "Message Delivery Sequence", |
| 2934 | Units: "boolean", |
| 2935 | Type: module.Line, |
| 2936 | Priority: 2402, |
| 2937 | UpdateEvery: 1, |
| 2938 | Dimensions: []framework.Dimension{ |
| 2939 | { |
| 2940 | Name: "priority", |
| 2941 | Algorithm: module.Absolute, |
| 2942 | Mul: 1, |
| 2943 | Div: 1, |
| 2944 | Precision: 1, |
| 2945 | }, |
| 2946 | { |
| 2947 | Name: "fifo", |
| 2948 | Algorithm: module.Absolute, |
| 2949 | Mul: 1, |
| 2950 | Div: 1, |
| 2951 | Precision: 1, |
| 2952 | }, |
| 2953 | }, |
| 2954 | LabelKeys: []string{ |
| 2955 | "queue", |
| 2956 | "type", |
| 2957 | }, |
| 2958 | }, |
| 2959 | }, |
| 2960 | HardenGetBackout: QueueHardenGetBackoutContext{ |
| 2961 | Context: framework.Context[QueueLabels]{ |
| 2962 | Name: "mq.queue.harden_get_backout", |
| 2963 | Family: "queues/behavior", |
| 2964 | Title: "Harden Get Backout", |
| 2965 | Units: "boolean", |
| 2966 | Type: module.Line, |
| 2967 | Priority: 2403, |
| 2968 | UpdateEvery: 1, |
| 2969 | Dimensions: []framework.Dimension{ |
| 2970 | { |
| 2971 | Name: "enabled", |
| 2972 | Algorithm: module.Absolute, |
| 2973 | Mul: 1, |
| 2974 | Div: 1, |
| 2975 | Precision: 1, |
| 2976 | }, |
| 2977 | { |
| 2978 | Name: "disabled", |
| 2979 | Algorithm: module.Absolute, |
| 2980 | Mul: 1, |
| 2981 | Div: 1, |
| 2982 | Precision: 1, |
| 2983 | }, |
| 2984 | }, |
| 2985 | LabelKeys: []string{ |
| 2986 | "queue", |
| 2987 | "type", |
| 2988 | }, |
| 2989 | }, |
| 2990 | }, |
| 2991 | } |
| 2992 | |
| 2993 | // --- QueueGroup --- |
| 2994 | |
| 2995 | // QueueGroupDepthValues defines the type-safe values for QueueGroup.Depth context |
| 2996 | type QueueGroupDepthValues struct { |
| 2997 | Current int64 |
| 2998 | Max int64 |
| 2999 | } |
| 3000 | |
| 3001 | // QueueGroupDepthContext provides type-safe operations for QueueGroup.Depth context |
| 3002 | type QueueGroupDepthContext struct { |
| 3003 | framework.Context[QueueGroupLabels] |
| 3004 | } |
| 3005 | |
| 3006 | // Set provides type-safe dimension setting for QueueGroup.Depth context |
| 3007 | func (c QueueGroupDepthContext) Set(state *framework.CollectorState, labels QueueGroupLabels, values QueueGroupDepthValues) { |
| 3008 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 3009 | "current": values.Current, |
| 3010 | "max": values.Max, |
| 3011 | }) |
| 3012 | } |
| 3013 | |
| 3014 | // SetUpdateEvery sets the update interval for this instance |
| 3015 | func (c QueueGroupDepthContext) SetUpdateEvery(state *framework.CollectorState, labels QueueGroupLabels, updateEvery int) { |
| 3016 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 3017 | } |
| 3018 | |
| 3019 | // QueueGroupDepthPercentageValues defines the type-safe values for QueueGroup.DepthPercentage context |
| 3020 | type QueueGroupDepthPercentageValues struct { |
| 3021 | Percentage int64 |
| 3022 | } |
| 3023 | |
| 3024 | // QueueGroupDepthPercentageContext provides type-safe operations for QueueGroup.DepthPercentage context |
| 3025 | type QueueGroupDepthPercentageContext struct { |
| 3026 | framework.Context[QueueGroupLabels] |
| 3027 | } |
| 3028 | |
| 3029 | // Set provides type-safe dimension setting for QueueGroup.DepthPercentage context |
| 3030 | func (c QueueGroupDepthPercentageContext) Set(state *framework.CollectorState, labels QueueGroupLabels, values QueueGroupDepthPercentageValues) { |
| 3031 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 3032 | "percentage": values.Percentage, |
| 3033 | }) |
| 3034 | } |
| 3035 | |
| 3036 | // SetUpdateEvery sets the update interval for this instance |
| 3037 | func (c QueueGroupDepthPercentageContext) SetUpdateEvery(state *framework.CollectorState, labels QueueGroupLabels, updateEvery int) { |
| 3038 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 3039 | } |
| 3040 | |
| 3041 | // QueueGroupMessagesValues defines the type-safe values for QueueGroup.Messages context |
| 3042 | type QueueGroupMessagesValues struct { |
| 3043 | Enqueued int64 |
| 3044 | Dequeued int64 |
| 3045 | } |
| 3046 | |
| 3047 | // QueueGroupMessagesContext provides type-safe operations for QueueGroup.Messages context |
| 3048 | type QueueGroupMessagesContext struct { |
| 3049 | framework.Context[QueueGroupLabels] |
| 3050 | } |
| 3051 | |
| 3052 | // Set provides type-safe dimension setting for QueueGroup.Messages context |
| 3053 | func (c QueueGroupMessagesContext) Set(state *framework.CollectorState, labels QueueGroupLabels, values QueueGroupMessagesValues) { |
| 3054 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 3055 | "enqueued": values.Enqueued, |
| 3056 | "dequeued": values.Dequeued, |
| 3057 | }) |
| 3058 | } |
| 3059 | |
| 3060 | // SetUpdateEvery sets the update interval for this instance |
| 3061 | func (c QueueGroupMessagesContext) SetUpdateEvery(state *framework.CollectorState, labels QueueGroupLabels, updateEvery int) { |
| 3062 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 3063 | } |
| 3064 | |
| 3065 | // QueueGroupConnectionsValues defines the type-safe values for QueueGroup.Connections context |
| 3066 | type QueueGroupConnectionsValues struct { |
| 3067 | Input int64 |
| 3068 | Output int64 |
| 3069 | } |
| 3070 | |
| 3071 | // QueueGroupConnectionsContext provides type-safe operations for QueueGroup.Connections context |
| 3072 | type QueueGroupConnectionsContext struct { |
| 3073 | framework.Context[QueueGroupLabels] |
| 3074 | } |
| 3075 | |
| 3076 | // Set provides type-safe dimension setting for QueueGroup.Connections context |
| 3077 | func (c QueueGroupConnectionsContext) Set(state *framework.CollectorState, labels QueueGroupLabels, values QueueGroupConnectionsValues) { |
| 3078 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 3079 | "input": values.Input, |
| 3080 | "output": values.Output, |
| 3081 | }) |
| 3082 | } |
| 3083 | |
| 3084 | // SetUpdateEvery sets the update interval for this instance |
| 3085 | func (c QueueGroupConnectionsContext) SetUpdateEvery(state *framework.CollectorState, labels QueueGroupLabels, updateEvery int) { |
| 3086 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 3087 | } |
| 3088 | |
| 3089 | // QueueGroupUncommittedMessagesValues defines the type-safe values for QueueGroup.UncommittedMessages context |
| 3090 | type QueueGroupUncommittedMessagesValues struct { |
| 3091 | Uncommitted int64 |
| 3092 | } |
| 3093 | |
| 3094 | // QueueGroupUncommittedMessagesContext provides type-safe operations for QueueGroup.UncommittedMessages context |
| 3095 | type QueueGroupUncommittedMessagesContext struct { |
| 3096 | framework.Context[QueueGroupLabels] |
| 3097 | } |
| 3098 | |
| 3099 | // Set provides type-safe dimension setting for QueueGroup.UncommittedMessages context |
| 3100 | func (c QueueGroupUncommittedMessagesContext) Set(state *framework.CollectorState, labels QueueGroupLabels, values QueueGroupUncommittedMessagesValues) { |
| 3101 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 3102 | "uncommitted": values.Uncommitted, |
| 3103 | }) |
| 3104 | } |
| 3105 | |
| 3106 | // SetUpdateEvery sets the update interval for this instance |
| 3107 | func (c QueueGroupUncommittedMessagesContext) SetUpdateEvery(state *framework.CollectorState, labels QueueGroupLabels, updateEvery int) { |
| 3108 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 3109 | } |
| 3110 | |
| 3111 | // QueueGroupFileSizeValues defines the type-safe values for QueueGroup.FileSize context |
| 3112 | type QueueGroupFileSizeValues struct { |
| 3113 | Current int64 |
| 3114 | Max int64 |
| 3115 | } |
| 3116 | |
| 3117 | // QueueGroupFileSizeContext provides type-safe operations for QueueGroup.FileSize context |
| 3118 | type QueueGroupFileSizeContext struct { |
| 3119 | framework.Context[QueueGroupLabels] |
| 3120 | } |
| 3121 | |
| 3122 | // Set provides type-safe dimension setting for QueueGroup.FileSize context |
| 3123 | func (c QueueGroupFileSizeContext) Set(state *framework.CollectorState, labels QueueGroupLabels, values QueueGroupFileSizeValues) { |
| 3124 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 3125 | "current": values.Current, |
| 3126 | "max": values.Max, |
| 3127 | }) |
| 3128 | } |
| 3129 | |
| 3130 | // SetUpdateEvery sets the update interval for this instance |
| 3131 | func (c QueueGroupFileSizeContext) SetUpdateEvery(state *framework.CollectorState, labels QueueGroupLabels, updateEvery int) { |
| 3132 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 3133 | } |
| 3134 | |
| 3135 | // QueueGroupOldestMessageAgeValues defines the type-safe values for QueueGroup.OldestMessageAge context |
| 3136 | type QueueGroupOldestMessageAgeValues struct { |
| 3137 | Oldest_msg_age int64 |
| 3138 | } |
| 3139 | |
| 3140 | // QueueGroupOldestMessageAgeContext provides type-safe operations for QueueGroup.OldestMessageAge context |
| 3141 | type QueueGroupOldestMessageAgeContext struct { |
| 3142 | framework.Context[QueueGroupLabels] |
| 3143 | } |
| 3144 | |
| 3145 | // Set provides type-safe dimension setting for QueueGroup.OldestMessageAge context |
| 3146 | func (c QueueGroupOldestMessageAgeContext) Set(state *framework.CollectorState, labels QueueGroupLabels, values QueueGroupOldestMessageAgeValues) { |
| 3147 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 3148 | "oldest_msg_age": values.Oldest_msg_age, |
| 3149 | }) |
| 3150 | } |
| 3151 | |
| 3152 | // SetUpdateEvery sets the update interval for this instance |
| 3153 | func (c QueueGroupOldestMessageAgeContext) SetUpdateEvery(state *framework.CollectorState, labels QueueGroupLabels, updateEvery int) { |
| 3154 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 3155 | } |
| 3156 | |
| 3157 | // QueueGroupLabels defines the required labels for QueueGroup contexts |
| 3158 | type QueueGroupLabels struct { |
| 3159 | Group string |
| 3160 | } |
| 3161 | |
| 3162 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 3163 | func (l QueueGroupLabels) InstanceID(contextName string) string { |
| 3164 | // Label order from YAML: group |
| 3165 | return contextName + "." + cleanLabelValue(l.Group) |
| 3166 | } |
| 3167 | |
| 3168 | // QueueGroup contains all metric contexts for QueueGroup |
| 3169 | var QueueGroup = struct { |
| 3170 | Depth QueueGroupDepthContext |
| 3171 | DepthPercentage QueueGroupDepthPercentageContext |
| 3172 | Messages QueueGroupMessagesContext |
| 3173 | Connections QueueGroupConnectionsContext |
| 3174 | UncommittedMessages QueueGroupUncommittedMessagesContext |
| 3175 | FileSize QueueGroupFileSizeContext |
| 3176 | OldestMessageAge QueueGroupOldestMessageAgeContext |
| 3177 | }{ |
| 3178 | Depth: QueueGroupDepthContext{ |
| 3179 | Context: framework.Context[QueueGroupLabels]{ |
| 3180 | Name: "mq.queue_group.depth", |
| 3181 | Family: "queues/group", |
| 3182 | Title: "Queue Group Depth", |
| 3183 | Units: "messages", |
| 3184 | Type: module.Line, |
| 3185 | Priority: 2450, |
| 3186 | UpdateEvery: 1, |
| 3187 | Dimensions: []framework.Dimension{ |
| 3188 | { |
| 3189 | Name: "current", |
| 3190 | Algorithm: module.Absolute, |
| 3191 | Mul: 1, |
| 3192 | Div: 1, |
| 3193 | Precision: 1, |
| 3194 | }, |
| 3195 | { |
| 3196 | Name: "max", |
| 3197 | Algorithm: module.Absolute, |
| 3198 | Mul: 1, |
| 3199 | Div: 1, |
| 3200 | Precision: 1, |
| 3201 | }, |
| 3202 | }, |
| 3203 | LabelKeys: []string{ |
| 3204 | "group", |
| 3205 | }, |
| 3206 | }, |
| 3207 | }, |
| 3208 | DepthPercentage: QueueGroupDepthPercentageContext{ |
| 3209 | Context: framework.Context[QueueGroupLabels]{ |
| 3210 | Name: "mq.queue_group.depth_percentage", |
| 3211 | Family: "queues/group", |
| 3212 | Title: "Queue Group Depth Percentage", |
| 3213 | Units: "percentage", |
| 3214 | Type: module.Line, |
| 3215 | Priority: 2451, |
| 3216 | UpdateEvery: 1, |
| 3217 | Dimensions: []framework.Dimension{ |
| 3218 | { |
| 3219 | Name: "percentage", |
| 3220 | Algorithm: module.Absolute, |
| 3221 | Mul: 1, |
| 3222 | Div: 1000, |
| 3223 | Precision: 1000, |
| 3224 | }, |
| 3225 | }, |
| 3226 | LabelKeys: []string{ |
| 3227 | "group", |
| 3228 | }, |
| 3229 | }, |
| 3230 | }, |
| 3231 | Messages: QueueGroupMessagesContext{ |
| 3232 | Context: framework.Context[QueueGroupLabels]{ |
| 3233 | Name: "mq.queue_group.messages", |
| 3234 | Family: "queues/group", |
| 3235 | Title: "Queue Group Messages", |
| 3236 | Units: "messages/s", |
| 3237 | Type: module.Line, |
| 3238 | Priority: 2452, |
| 3239 | UpdateEvery: 1, |
| 3240 | Dimensions: []framework.Dimension{ |
| 3241 | { |
| 3242 | Name: "enqueued", |
| 3243 | Algorithm: module.Incremental, |
| 3244 | Mul: 1, |
| 3245 | Div: 1, |
| 3246 | Precision: 1, |
| 3247 | }, |
| 3248 | { |
| 3249 | Name: "dequeued", |
| 3250 | Algorithm: module.Incremental, |
| 3251 | Mul: 1, |
| 3252 | Div: 1, |
| 3253 | Precision: 1, |
| 3254 | }, |
| 3255 | }, |
| 3256 | LabelKeys: []string{ |
| 3257 | "group", |
| 3258 | }, |
| 3259 | }, |
| 3260 | }, |
| 3261 | Connections: QueueGroupConnectionsContext{ |
| 3262 | Context: framework.Context[QueueGroupLabels]{ |
| 3263 | Name: "mq.queue_group.connections", |
| 3264 | Family: "queues/group", |
| 3265 | Title: "Queue Group Connections", |
| 3266 | Units: "connections", |
| 3267 | Type: module.Line, |
| 3268 | Priority: 2453, |
| 3269 | UpdateEvery: 1, |
| 3270 | Dimensions: []framework.Dimension{ |
| 3271 | { |
| 3272 | Name: "input", |
| 3273 | Algorithm: module.Absolute, |
| 3274 | Mul: 1, |
| 3275 | Div: 1, |
| 3276 | Precision: 1, |
| 3277 | }, |
| 3278 | { |
| 3279 | Name: "output", |
| 3280 | Algorithm: module.Absolute, |
| 3281 | Mul: 1, |
| 3282 | Div: 1, |
| 3283 | Precision: 1, |
| 3284 | }, |
| 3285 | }, |
| 3286 | LabelKeys: []string{ |
| 3287 | "group", |
| 3288 | }, |
| 3289 | }, |
| 3290 | }, |
| 3291 | UncommittedMessages: QueueGroupUncommittedMessagesContext{ |
| 3292 | Context: framework.Context[QueueGroupLabels]{ |
| 3293 | Name: "mq.queue_group.uncommitted_msgs", |
| 3294 | Family: "queues/group", |
| 3295 | Title: "Queue Group Uncommitted Messages", |
| 3296 | Units: "messages", |
| 3297 | Type: module.Line, |
| 3298 | Priority: 2454, |
| 3299 | UpdateEvery: 1, |
| 3300 | Dimensions: []framework.Dimension{ |
| 3301 | { |
| 3302 | Name: "uncommitted", |
| 3303 | Algorithm: module.Absolute, |
| 3304 | Mul: 1, |
| 3305 | Div: 1, |
| 3306 | Precision: 1, |
| 3307 | }, |
| 3308 | }, |
| 3309 | LabelKeys: []string{ |
| 3310 | "group", |
| 3311 | }, |
| 3312 | }, |
| 3313 | }, |
| 3314 | FileSize: QueueGroupFileSizeContext{ |
| 3315 | Context: framework.Context[QueueGroupLabels]{ |
| 3316 | Name: "mq.queue_group.file_size", |
| 3317 | Family: "queues/group", |
| 3318 | Title: "Queue Group File Size", |
| 3319 | Units: "bytes", |
| 3320 | Type: module.Line, |
| 3321 | Priority: 2455, |
| 3322 | UpdateEvery: 1, |
| 3323 | Dimensions: []framework.Dimension{ |
| 3324 | { |
| 3325 | Name: "current", |
| 3326 | Algorithm: module.Absolute, |
| 3327 | Mul: 1, |
| 3328 | Div: 1, |
| 3329 | Precision: 1, |
| 3330 | }, |
| 3331 | { |
| 3332 | Name: "max", |
| 3333 | Algorithm: module.Absolute, |
| 3334 | Mul: 1, |
| 3335 | Div: 1, |
| 3336 | Precision: 1, |
| 3337 | }, |
| 3338 | }, |
| 3339 | LabelKeys: []string{ |
| 3340 | "group", |
| 3341 | }, |
| 3342 | }, |
| 3343 | }, |
| 3344 | OldestMessageAge: QueueGroupOldestMessageAgeContext{ |
| 3345 | Context: framework.Context[QueueGroupLabels]{ |
| 3346 | Name: "mq.queue_group.oldest_msg_age", |
| 3347 | Family: "queues/group", |
| 3348 | Title: "Queue Group Oldest Message Age", |
| 3349 | Units: "seconds", |
| 3350 | Type: module.Line, |
| 3351 | Priority: 2456, |
| 3352 | UpdateEvery: 1, |
| 3353 | Dimensions: []framework.Dimension{ |
| 3354 | { |
| 3355 | Name: "oldest_msg_age", |
| 3356 | Algorithm: module.Absolute, |
| 3357 | Mul: 1, |
| 3358 | Div: 1, |
| 3359 | Precision: 1, |
| 3360 | }, |
| 3361 | }, |
| 3362 | LabelKeys: []string{ |
| 3363 | "group", |
| 3364 | }, |
| 3365 | }, |
| 3366 | }, |
| 3367 | } |
| 3368 | |
| 3369 | // --- QueueManager --- |
| 3370 | |
| 3371 | // QueueManagerStatusValues defines the type-safe values for QueueManager.Status context |
| 3372 | type QueueManagerStatusValues struct { |
| 3373 | Status int64 |
| 3374 | } |
| 3375 | |
| 3376 | // QueueManagerStatusContext provides type-safe operations for QueueManager.Status context |
| 3377 | type QueueManagerStatusContext struct { |
| 3378 | framework.Context[EmptyLabels] |
| 3379 | } |
| 3380 | |
| 3381 | // Set provides type-safe dimension setting for QueueManager.Status context |
| 3382 | func (c QueueManagerStatusContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerStatusValues) { |
| 3383 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3384 | "status": values.Status, |
| 3385 | }) |
| 3386 | } |
| 3387 | |
| 3388 | // SetUpdateEvery sets the update interval for this instance |
| 3389 | func (c QueueManagerStatusContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3390 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3391 | } |
| 3392 | |
| 3393 | // QueueManagerConnectionCountValues defines the type-safe values for QueueManager.ConnectionCount context |
| 3394 | type QueueManagerConnectionCountValues struct { |
| 3395 | Connections int64 |
| 3396 | } |
| 3397 | |
| 3398 | // QueueManagerConnectionCountContext provides type-safe operations for QueueManager.ConnectionCount context |
| 3399 | type QueueManagerConnectionCountContext struct { |
| 3400 | framework.Context[EmptyLabels] |
| 3401 | } |
| 3402 | |
| 3403 | // Set provides type-safe dimension setting for QueueManager.ConnectionCount context |
| 3404 | func (c QueueManagerConnectionCountContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerConnectionCountValues) { |
| 3405 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3406 | "connections": values.Connections, |
| 3407 | }) |
| 3408 | } |
| 3409 | |
| 3410 | // SetUpdateEvery sets the update interval for this instance |
| 3411 | func (c QueueManagerConnectionCountContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3412 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3413 | } |
| 3414 | |
| 3415 | // QueueManagerUptimeValues defines the type-safe values for QueueManager.Uptime context |
| 3416 | type QueueManagerUptimeValues struct { |
| 3417 | Uptime int64 |
| 3418 | } |
| 3419 | |
| 3420 | // QueueManagerUptimeContext provides type-safe operations for QueueManager.Uptime context |
| 3421 | type QueueManagerUptimeContext struct { |
| 3422 | framework.Context[EmptyLabels] |
| 3423 | } |
| 3424 | |
| 3425 | // Set provides type-safe dimension setting for QueueManager.Uptime context |
| 3426 | func (c QueueManagerUptimeContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerUptimeValues) { |
| 3427 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3428 | "uptime": values.Uptime, |
| 3429 | }) |
| 3430 | } |
| 3431 | |
| 3432 | // SetUpdateEvery sets the update interval for this instance |
| 3433 | func (c QueueManagerUptimeContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3434 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3435 | } |
| 3436 | |
| 3437 | // QueueManagerQueuesOverviewValues defines the type-safe values for QueueManager.QueuesOverview context |
| 3438 | type QueueManagerQueuesOverviewValues struct { |
| 3439 | Monitored int64 |
| 3440 | Excluded int64 |
| 3441 | Invisible int64 |
| 3442 | Failed int64 |
| 3443 | } |
| 3444 | |
| 3445 | // QueueManagerQueuesOverviewContext provides type-safe operations for QueueManager.QueuesOverview context |
| 3446 | type QueueManagerQueuesOverviewContext struct { |
| 3447 | framework.Context[EmptyLabels] |
| 3448 | } |
| 3449 | |
| 3450 | // Set provides type-safe dimension setting for QueueManager.QueuesOverview context |
| 3451 | func (c QueueManagerQueuesOverviewContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerQueuesOverviewValues) { |
| 3452 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3453 | "monitored": values.Monitored, |
| 3454 | "excluded": values.Excluded, |
| 3455 | "invisible": values.Invisible, |
| 3456 | "failed": values.Failed, |
| 3457 | }) |
| 3458 | } |
| 3459 | |
| 3460 | // SetUpdateEvery sets the update interval for this instance |
| 3461 | func (c QueueManagerQueuesOverviewContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3462 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3463 | } |
| 3464 | |
| 3465 | // QueueManagerChannelsOverviewValues defines the type-safe values for QueueManager.ChannelsOverview context |
| 3466 | type QueueManagerChannelsOverviewValues struct { |
| 3467 | Monitored int64 |
| 3468 | Excluded int64 |
| 3469 | Invisible int64 |
| 3470 | Failed int64 |
| 3471 | } |
| 3472 | |
| 3473 | // QueueManagerChannelsOverviewContext provides type-safe operations for QueueManager.ChannelsOverview context |
| 3474 | type QueueManagerChannelsOverviewContext struct { |
| 3475 | framework.Context[EmptyLabels] |
| 3476 | } |
| 3477 | |
| 3478 | // Set provides type-safe dimension setting for QueueManager.ChannelsOverview context |
| 3479 | func (c QueueManagerChannelsOverviewContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerChannelsOverviewValues) { |
| 3480 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3481 | "monitored": values.Monitored, |
| 3482 | "excluded": values.Excluded, |
| 3483 | "invisible": values.Invisible, |
| 3484 | "failed": values.Failed, |
| 3485 | }) |
| 3486 | } |
| 3487 | |
| 3488 | // SetUpdateEvery sets the update interval for this instance |
| 3489 | func (c QueueManagerChannelsOverviewContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3490 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3491 | } |
| 3492 | |
| 3493 | // QueueManagerTopicsOverviewValues defines the type-safe values for QueueManager.TopicsOverview context |
| 3494 | type QueueManagerTopicsOverviewValues struct { |
| 3495 | Monitored int64 |
| 3496 | Excluded int64 |
| 3497 | Invisible int64 |
| 3498 | Failed int64 |
| 3499 | } |
| 3500 | |
| 3501 | // QueueManagerTopicsOverviewContext provides type-safe operations for QueueManager.TopicsOverview context |
| 3502 | type QueueManagerTopicsOverviewContext struct { |
| 3503 | framework.Context[EmptyLabels] |
| 3504 | } |
| 3505 | |
| 3506 | // Set provides type-safe dimension setting for QueueManager.TopicsOverview context |
| 3507 | func (c QueueManagerTopicsOverviewContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerTopicsOverviewValues) { |
| 3508 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3509 | "monitored": values.Monitored, |
| 3510 | "excluded": values.Excluded, |
| 3511 | "invisible": values.Invisible, |
| 3512 | "failed": values.Failed, |
| 3513 | }) |
| 3514 | } |
| 3515 | |
| 3516 | // SetUpdateEvery sets the update interval for this instance |
| 3517 | func (c QueueManagerTopicsOverviewContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3518 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3519 | } |
| 3520 | |
| 3521 | // QueueManagerListenersOverviewValues defines the type-safe values for QueueManager.ListenersOverview context |
| 3522 | type QueueManagerListenersOverviewValues struct { |
| 3523 | Monitored int64 |
| 3524 | Excluded int64 |
| 3525 | Invisible int64 |
| 3526 | Failed int64 |
| 3527 | } |
| 3528 | |
| 3529 | // QueueManagerListenersOverviewContext provides type-safe operations for QueueManager.ListenersOverview context |
| 3530 | type QueueManagerListenersOverviewContext struct { |
| 3531 | framework.Context[EmptyLabels] |
| 3532 | } |
| 3533 | |
| 3534 | // Set provides type-safe dimension setting for QueueManager.ListenersOverview context |
| 3535 | func (c QueueManagerListenersOverviewContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerListenersOverviewValues) { |
| 3536 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3537 | "monitored": values.Monitored, |
| 3538 | "excluded": values.Excluded, |
| 3539 | "invisible": values.Invisible, |
| 3540 | "failed": values.Failed, |
| 3541 | }) |
| 3542 | } |
| 3543 | |
| 3544 | // SetUpdateEvery sets the update interval for this instance |
| 3545 | func (c QueueManagerListenersOverviewContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3546 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3547 | } |
| 3548 | |
| 3549 | // QueueManager contains all metric contexts for QueueManager |
| 3550 | var QueueManager = struct { |
| 3551 | Status QueueManagerStatusContext |
| 3552 | ConnectionCount QueueManagerConnectionCountContext |
| 3553 | Uptime QueueManagerUptimeContext |
| 3554 | QueuesOverview QueueManagerQueuesOverviewContext |
| 3555 | ChannelsOverview QueueManagerChannelsOverviewContext |
| 3556 | TopicsOverview QueueManagerTopicsOverviewContext |
| 3557 | ListenersOverview QueueManagerListenersOverviewContext |
| 3558 | }{ |
| 3559 | Status: QueueManagerStatusContext{ |
| 3560 | Context: framework.Context[EmptyLabels]{ |
| 3561 | Name: "mq.qmgr.status", |
| 3562 | Family: "queue_manager", |
| 3563 | Title: "Queue Manager Status", |
| 3564 | Units: "status", |
| 3565 | Type: module.Line, |
| 3566 | Priority: 1000, |
| 3567 | UpdateEvery: 1, |
| 3568 | Dimensions: []framework.Dimension{ |
| 3569 | { |
| 3570 | Name: "status", |
| 3571 | Algorithm: module.Absolute, |
| 3572 | Mul: 1, |
| 3573 | Div: 1, |
| 3574 | Precision: 1, |
| 3575 | }, |
| 3576 | }, |
| 3577 | LabelKeys: []string{}, |
| 3578 | }, |
| 3579 | }, |
| 3580 | ConnectionCount: QueueManagerConnectionCountContext{ |
| 3581 | Context: framework.Context[EmptyLabels]{ |
| 3582 | Name: "mq.qmgr.connection_count", |
| 3583 | Family: "queue_manager", |
| 3584 | Title: "Queue Manager Connections", |
| 3585 | Units: "connections", |
| 3586 | Type: module.Line, |
| 3587 | Priority: 1001, |
| 3588 | UpdateEvery: 1, |
| 3589 | Dimensions: []framework.Dimension{ |
| 3590 | { |
| 3591 | Name: "connections", |
| 3592 | Algorithm: module.Absolute, |
| 3593 | Mul: 1, |
| 3594 | Div: 1, |
| 3595 | Precision: 1, |
| 3596 | }, |
| 3597 | }, |
| 3598 | LabelKeys: []string{}, |
| 3599 | }, |
| 3600 | }, |
| 3601 | Uptime: QueueManagerUptimeContext{ |
| 3602 | Context: framework.Context[EmptyLabels]{ |
| 3603 | Name: "mq.qmgr.uptime", |
| 3604 | Family: "queue_manager", |
| 3605 | Title: "Queue Manager Uptime", |
| 3606 | Units: "seconds", |
| 3607 | Type: module.Line, |
| 3608 | Priority: 1002, |
| 3609 | UpdateEvery: 1, |
| 3610 | Dimensions: []framework.Dimension{ |
| 3611 | { |
| 3612 | Name: "uptime", |
| 3613 | Algorithm: module.Absolute, |
| 3614 | Mul: 1, |
| 3615 | Div: 1, |
| 3616 | Precision: 1, |
| 3617 | }, |
| 3618 | }, |
| 3619 | LabelKeys: []string{}, |
| 3620 | }, |
| 3621 | }, |
| 3622 | QueuesOverview: QueueManagerQueuesOverviewContext{ |
| 3623 | Context: framework.Context[EmptyLabels]{ |
| 3624 | Name: "mq.queues.overview", |
| 3625 | Family: "overview", |
| 3626 | Title: "Queues Monitoring Status", |
| 3627 | Units: "queues", |
| 3628 | Type: module.Stacked, |
| 3629 | Priority: 1100, |
| 3630 | UpdateEvery: 1, |
| 3631 | Dimensions: []framework.Dimension{ |
| 3632 | { |
| 3633 | Name: "monitored", |
| 3634 | Algorithm: module.Absolute, |
| 3635 | Mul: 1, |
| 3636 | Div: 1, |
| 3637 | Precision: 1, |
| 3638 | }, |
| 3639 | { |
| 3640 | Name: "excluded", |
| 3641 | Algorithm: module.Absolute, |
| 3642 | Mul: 1, |
| 3643 | Div: 1, |
| 3644 | Precision: 1, |
| 3645 | }, |
| 3646 | { |
| 3647 | Name: "invisible", |
| 3648 | Algorithm: module.Absolute, |
| 3649 | Mul: 1, |
| 3650 | Div: 1, |
| 3651 | Precision: 1, |
| 3652 | }, |
| 3653 | { |
| 3654 | Name: "failed", |
| 3655 | Algorithm: module.Absolute, |
| 3656 | Mul: 1, |
| 3657 | Div: 1, |
| 3658 | Precision: 1, |
| 3659 | }, |
| 3660 | }, |
| 3661 | LabelKeys: []string{}, |
| 3662 | }, |
| 3663 | }, |
| 3664 | ChannelsOverview: QueueManagerChannelsOverviewContext{ |
| 3665 | Context: framework.Context[EmptyLabels]{ |
| 3666 | Name: "mq.channels.overview", |
| 3667 | Family: "overview", |
| 3668 | Title: "Channels Monitoring Status", |
| 3669 | Units: "channels", |
| 3670 | Type: module.Stacked, |
| 3671 | Priority: 1101, |
| 3672 | UpdateEvery: 1, |
| 3673 | Dimensions: []framework.Dimension{ |
| 3674 | { |
| 3675 | Name: "monitored", |
| 3676 | Algorithm: module.Absolute, |
| 3677 | Mul: 1, |
| 3678 | Div: 1, |
| 3679 | Precision: 1, |
| 3680 | }, |
| 3681 | { |
| 3682 | Name: "excluded", |
| 3683 | Algorithm: module.Absolute, |
| 3684 | Mul: 1, |
| 3685 | Div: 1, |
| 3686 | Precision: 1, |
| 3687 | }, |
| 3688 | { |
| 3689 | Name: "invisible", |
| 3690 | Algorithm: module.Absolute, |
| 3691 | Mul: 1, |
| 3692 | Div: 1, |
| 3693 | Precision: 1, |
| 3694 | }, |
| 3695 | { |
| 3696 | Name: "failed", |
| 3697 | Algorithm: module.Absolute, |
| 3698 | Mul: 1, |
| 3699 | Div: 1, |
| 3700 | Precision: 1, |
| 3701 | }, |
| 3702 | }, |
| 3703 | LabelKeys: []string{}, |
| 3704 | }, |
| 3705 | }, |
| 3706 | TopicsOverview: QueueManagerTopicsOverviewContext{ |
| 3707 | Context: framework.Context[EmptyLabels]{ |
| 3708 | Name: "mq.topics.overview", |
| 3709 | Family: "overview", |
| 3710 | Title: "Topics Monitoring Status", |
| 3711 | Units: "topics", |
| 3712 | Type: module.Stacked, |
| 3713 | Priority: 1102, |
| 3714 | UpdateEvery: 1, |
| 3715 | Dimensions: []framework.Dimension{ |
| 3716 | { |
| 3717 | Name: "monitored", |
| 3718 | Algorithm: module.Absolute, |
| 3719 | Mul: 1, |
| 3720 | Div: 1, |
| 3721 | Precision: 1, |
| 3722 | }, |
| 3723 | { |
| 3724 | Name: "excluded", |
| 3725 | Algorithm: module.Absolute, |
| 3726 | Mul: 1, |
| 3727 | Div: 1, |
| 3728 | Precision: 1, |
| 3729 | }, |
| 3730 | { |
| 3731 | Name: "invisible", |
| 3732 | Algorithm: module.Absolute, |
| 3733 | Mul: 1, |
| 3734 | Div: 1, |
| 3735 | Precision: 1, |
| 3736 | }, |
| 3737 | { |
| 3738 | Name: "failed", |
| 3739 | Algorithm: module.Absolute, |
| 3740 | Mul: 1, |
| 3741 | Div: 1, |
| 3742 | Precision: 1, |
| 3743 | }, |
| 3744 | }, |
| 3745 | LabelKeys: []string{}, |
| 3746 | }, |
| 3747 | }, |
| 3748 | ListenersOverview: QueueManagerListenersOverviewContext{ |
| 3749 | Context: framework.Context[EmptyLabels]{ |
| 3750 | Name: "mq.listeners.overview", |
| 3751 | Family: "overview", |
| 3752 | Title: "Listeners Monitoring Status", |
| 3753 | Units: "listeners", |
| 3754 | Type: module.Stacked, |
| 3755 | Priority: 1103, |
| 3756 | UpdateEvery: 1, |
| 3757 | Dimensions: []framework.Dimension{ |
| 3758 | { |
| 3759 | Name: "monitored", |
| 3760 | Algorithm: module.Absolute, |
| 3761 | Mul: 1, |
| 3762 | Div: 1, |
| 3763 | Precision: 1, |
| 3764 | }, |
| 3765 | { |
| 3766 | Name: "excluded", |
| 3767 | Algorithm: module.Absolute, |
| 3768 | Mul: 1, |
| 3769 | Div: 1, |
| 3770 | Precision: 1, |
| 3771 | }, |
| 3772 | { |
| 3773 | Name: "invisible", |
| 3774 | Algorithm: module.Absolute, |
| 3775 | Mul: 1, |
| 3776 | Div: 1, |
| 3777 | Precision: 1, |
| 3778 | }, |
| 3779 | { |
| 3780 | Name: "failed", |
| 3781 | Algorithm: module.Absolute, |
| 3782 | Mul: 1, |
| 3783 | Div: 1, |
| 3784 | Precision: 1, |
| 3785 | }, |
| 3786 | }, |
| 3787 | LabelKeys: []string{}, |
| 3788 | }, |
| 3789 | }, |
| 3790 | } |
| 3791 | |
| 3792 | // --- QueueManagerResources --- |
| 3793 | |
| 3794 | // QueueManagerResourcesCPUUsageValues defines the type-safe values for QueueManagerResources.CPUUsage context |
| 3795 | type QueueManagerResourcesCPUUsageValues struct { |
| 3796 | User int64 |
| 3797 | System int64 |
| 3798 | } |
| 3799 | |
| 3800 | // QueueManagerResourcesCPUUsageContext provides type-safe operations for QueueManagerResources.CPUUsage context |
| 3801 | type QueueManagerResourcesCPUUsageContext struct { |
| 3802 | framework.Context[EmptyLabels] |
| 3803 | } |
| 3804 | |
| 3805 | // Set provides type-safe dimension setting for QueueManagerResources.CPUUsage context |
| 3806 | func (c QueueManagerResourcesCPUUsageContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerResourcesCPUUsageValues) { |
| 3807 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3808 | "user": values.User, |
| 3809 | "system": values.System, |
| 3810 | }) |
| 3811 | } |
| 3812 | |
| 3813 | // SetUpdateEvery sets the update interval for this instance |
| 3814 | func (c QueueManagerResourcesCPUUsageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3815 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3816 | } |
| 3817 | |
| 3818 | // QueueManagerResourcesMemoryUsageValues defines the type-safe values for QueueManagerResources.MemoryUsage context |
| 3819 | type QueueManagerResourcesMemoryUsageValues struct { |
| 3820 | Total int64 |
| 3821 | } |
| 3822 | |
| 3823 | // QueueManagerResourcesMemoryUsageContext provides type-safe operations for QueueManagerResources.MemoryUsage context |
| 3824 | type QueueManagerResourcesMemoryUsageContext struct { |
| 3825 | framework.Context[EmptyLabels] |
| 3826 | } |
| 3827 | |
| 3828 | // Set provides type-safe dimension setting for QueueManagerResources.MemoryUsage context |
| 3829 | func (c QueueManagerResourcesMemoryUsageContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerResourcesMemoryUsageValues) { |
| 3830 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3831 | "total": values.Total, |
| 3832 | }) |
| 3833 | } |
| 3834 | |
| 3835 | // SetUpdateEvery sets the update interval for this instance |
| 3836 | func (c QueueManagerResourcesMemoryUsageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3837 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3838 | } |
| 3839 | |
| 3840 | // QueueManagerResourcesRAMUsageValues defines the type-safe values for QueueManagerResources.RAMUsage context |
| 3841 | type QueueManagerResourcesRAMUsageValues struct { |
| 3842 | Total int64 |
| 3843 | } |
| 3844 | |
| 3845 | // QueueManagerResourcesRAMUsageContext provides type-safe operations for QueueManagerResources.RAMUsage context |
| 3846 | type QueueManagerResourcesRAMUsageContext struct { |
| 3847 | framework.Context[EmptyLabels] |
| 3848 | } |
| 3849 | |
| 3850 | // Set provides type-safe dimension setting for QueueManagerResources.RAMUsage context |
| 3851 | func (c QueueManagerResourcesRAMUsageContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerResourcesRAMUsageValues) { |
| 3852 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3853 | "total": values.Total, |
| 3854 | }) |
| 3855 | } |
| 3856 | |
| 3857 | // SetUpdateEvery sets the update interval for this instance |
| 3858 | func (c QueueManagerResourcesRAMUsageContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3859 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3860 | } |
| 3861 | |
| 3862 | // QueueManagerResourcesLogUtilizationValues defines the type-safe values for QueueManagerResources.LogUtilization context |
| 3863 | type QueueManagerResourcesLogUtilizationValues struct { |
| 3864 | Used int64 |
| 3865 | } |
| 3866 | |
| 3867 | // QueueManagerResourcesLogUtilizationContext provides type-safe operations for QueueManagerResources.LogUtilization context |
| 3868 | type QueueManagerResourcesLogUtilizationContext struct { |
| 3869 | framework.Context[EmptyLabels] |
| 3870 | } |
| 3871 | |
| 3872 | // Set provides type-safe dimension setting for QueueManagerResources.LogUtilization context |
| 3873 | func (c QueueManagerResourcesLogUtilizationContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerResourcesLogUtilizationValues) { |
| 3874 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3875 | "used": values.Used, |
| 3876 | }) |
| 3877 | } |
| 3878 | |
| 3879 | // SetUpdateEvery sets the update interval for this instance |
| 3880 | func (c QueueManagerResourcesLogUtilizationContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3881 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3882 | } |
| 3883 | |
| 3884 | // QueueManagerResourcesLogFileSizeValues defines the type-safe values for QueueManagerResources.LogFileSize context |
| 3885 | type QueueManagerResourcesLogFileSizeValues struct { |
| 3886 | Size int64 |
| 3887 | } |
| 3888 | |
| 3889 | // QueueManagerResourcesLogFileSizeContext provides type-safe operations for QueueManagerResources.LogFileSize context |
| 3890 | type QueueManagerResourcesLogFileSizeContext struct { |
| 3891 | framework.Context[EmptyLabels] |
| 3892 | } |
| 3893 | |
| 3894 | // Set provides type-safe dimension setting for QueueManagerResources.LogFileSize context |
| 3895 | func (c QueueManagerResourcesLogFileSizeContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerResourcesLogFileSizeValues) { |
| 3896 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3897 | "size": values.Size, |
| 3898 | }) |
| 3899 | } |
| 3900 | |
| 3901 | // SetUpdateEvery sets the update interval for this instance |
| 3902 | func (c QueueManagerResourcesLogFileSizeContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3903 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3904 | } |
| 3905 | |
| 3906 | // QueueManagerResourcesLogWriteRateValues defines the type-safe values for QueueManagerResources.LogWriteRate context |
| 3907 | type QueueManagerResourcesLogWriteRateValues struct { |
| 3908 | Rate int64 |
| 3909 | } |
| 3910 | |
| 3911 | // QueueManagerResourcesLogWriteRateContext provides type-safe operations for QueueManagerResources.LogWriteRate context |
| 3912 | type QueueManagerResourcesLogWriteRateContext struct { |
| 3913 | framework.Context[EmptyLabels] |
| 3914 | } |
| 3915 | |
| 3916 | // Set provides type-safe dimension setting for QueueManagerResources.LogWriteRate context |
| 3917 | func (c QueueManagerResourcesLogWriteRateContext) Set(state *framework.CollectorState, labels EmptyLabels, values QueueManagerResourcesLogWriteRateValues) { |
| 3918 | state.SetMetricsForGeneratedCode(&c.Context, nil, map[string]int64{ |
| 3919 | "rate": values.Rate, |
| 3920 | }) |
| 3921 | } |
| 3922 | |
| 3923 | // SetUpdateEvery sets the update interval for this instance |
| 3924 | func (c QueueManagerResourcesLogWriteRateContext) SetUpdateEvery(state *framework.CollectorState, labels EmptyLabels, updateEvery int) { |
| 3925 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, nil, updateEvery) |
| 3926 | } |
| 3927 | |
| 3928 | // QueueManagerResources contains all metric contexts for QueueManagerResources |
| 3929 | var QueueManagerResources = struct { |
| 3930 | CPUUsage QueueManagerResourcesCPUUsageContext |
| 3931 | MemoryUsage QueueManagerResourcesMemoryUsageContext |
| 3932 | RAMUsage QueueManagerResourcesRAMUsageContext |
| 3933 | LogUtilization QueueManagerResourcesLogUtilizationContext |
| 3934 | LogFileSize QueueManagerResourcesLogFileSizeContext |
| 3935 | LogWriteRate QueueManagerResourcesLogWriteRateContext |
| 3936 | }{ |
| 3937 | CPUUsage: QueueManagerResourcesCPUUsageContext{ |
| 3938 | Context: framework.Context[EmptyLabels]{ |
| 3939 | Name: "mq.qmgr.cpu_usage", |
| 3940 | Family: "resources", |
| 3941 | Title: "Queue Manager CPU Usage", |
| 3942 | Units: "percentage", |
| 3943 | Type: module.Stacked, |
| 3944 | Priority: 1050, |
| 3945 | UpdateEvery: 1, |
| 3946 | Dimensions: []framework.Dimension{ |
| 3947 | { |
| 3948 | Name: "user", |
| 3949 | Algorithm: module.Absolute, |
| 3950 | Mul: 1, |
| 3951 | Div: 100, |
| 3952 | Precision: 1, |
| 3953 | }, |
| 3954 | { |
| 3955 | Name: "system", |
| 3956 | Algorithm: module.Absolute, |
| 3957 | Mul: 1, |
| 3958 | Div: 100, |
| 3959 | Precision: 1, |
| 3960 | }, |
| 3961 | }, |
| 3962 | LabelKeys: []string{}, |
| 3963 | }, |
| 3964 | }, |
| 3965 | MemoryUsage: QueueManagerResourcesMemoryUsageContext{ |
| 3966 | Context: framework.Context[EmptyLabels]{ |
| 3967 | Name: "mq.qmgr.memory_usage", |
| 3968 | Family: "resources", |
| 3969 | Title: "Queue Manager Memory Usage", |
| 3970 | Units: "bytes", |
| 3971 | Type: module.Line, |
| 3972 | Priority: 1051, |
| 3973 | UpdateEvery: 1, |
| 3974 | Dimensions: []framework.Dimension{ |
| 3975 | { |
| 3976 | Name: "total", |
| 3977 | Algorithm: module.Absolute, |
| 3978 | Mul: 1, |
| 3979 | Div: 1, |
| 3980 | Precision: 1, |
| 3981 | }, |
| 3982 | }, |
| 3983 | LabelKeys: []string{}, |
| 3984 | }, |
| 3985 | }, |
| 3986 | RAMUsage: QueueManagerResourcesRAMUsageContext{ |
| 3987 | Context: framework.Context[EmptyLabels]{ |
| 3988 | Name: "mq.qmgr.ram_usage", |
| 3989 | Family: "resources", |
| 3990 | Title: "Queue Manager RAM Usage", |
| 3991 | Units: "bytes", |
| 3992 | Type: module.Line, |
| 3993 | Priority: 1052, |
| 3994 | UpdateEvery: 1, |
| 3995 | Dimensions: []framework.Dimension{ |
| 3996 | { |
| 3997 | Name: "total", |
| 3998 | Algorithm: module.Absolute, |
| 3999 | Mul: 1, |
| 4000 | Div: 1, |
| 4001 | Precision: 1, |
| 4002 | }, |
| 4003 | }, |
| 4004 | LabelKeys: []string{}, |
| 4005 | }, |
| 4006 | }, |
| 4007 | LogUtilization: QueueManagerResourcesLogUtilizationContext{ |
| 4008 | Context: framework.Context[EmptyLabels]{ |
| 4009 | Name: "mq.qmgr.log_utilization", |
| 4010 | Family: "resources", |
| 4011 | Title: "Queue Manager Log Utilization", |
| 4012 | Units: "percentage", |
| 4013 | Type: module.Line, |
| 4014 | Priority: 1053, |
| 4015 | UpdateEvery: 1, |
| 4016 | Dimensions: []framework.Dimension{ |
| 4017 | { |
| 4018 | Name: "used", |
| 4019 | Algorithm: module.Absolute, |
| 4020 | Mul: 1, |
| 4021 | Div: 100, |
| 4022 | Precision: 1, |
| 4023 | }, |
| 4024 | }, |
| 4025 | LabelKeys: []string{}, |
| 4026 | }, |
| 4027 | }, |
| 4028 | LogFileSize: QueueManagerResourcesLogFileSizeContext{ |
| 4029 | Context: framework.Context[EmptyLabels]{ |
| 4030 | Name: "mq.qmgr.log_file_size", |
| 4031 | Family: "resources", |
| 4032 | Title: "Queue Manager Log File Size", |
| 4033 | Units: "bytes", |
| 4034 | Type: module.Line, |
| 4035 | Priority: 1054, |
| 4036 | UpdateEvery: 1, |
| 4037 | Dimensions: []framework.Dimension{ |
| 4038 | { |
| 4039 | Name: "size", |
| 4040 | Algorithm: module.Absolute, |
| 4041 | Mul: 1, |
| 4042 | Div: 1, |
| 4043 | Precision: 1, |
| 4044 | }, |
| 4045 | }, |
| 4046 | LabelKeys: []string{}, |
| 4047 | }, |
| 4048 | }, |
| 4049 | LogWriteRate: QueueManagerResourcesLogWriteRateContext{ |
| 4050 | Context: framework.Context[EmptyLabels]{ |
| 4051 | Name: "mq.qmgr.log_write_rate", |
| 4052 | Family: "resources", |
| 4053 | Title: "Queue Manager Log Write Rate", |
| 4054 | Units: "bytes/s", |
| 4055 | Type: module.Line, |
| 4056 | Priority: 1055, |
| 4057 | UpdateEvery: 1, |
| 4058 | Dimensions: []framework.Dimension{ |
| 4059 | { |
| 4060 | Name: "rate", |
| 4061 | Algorithm: module.Absolute, |
| 4062 | Mul: 1, |
| 4063 | Div: 1, |
| 4064 | Precision: 1, |
| 4065 | }, |
| 4066 | }, |
| 4067 | LabelKeys: []string{}, |
| 4068 | }, |
| 4069 | }, |
| 4070 | } |
| 4071 | |
| 4072 | // --- QueueStatistics --- |
| 4073 | |
| 4074 | // QueueStatisticsDepthMinMaxValues defines the type-safe values for QueueStatistics.DepthMinMax context |
| 4075 | type QueueStatisticsDepthMinMaxValues struct { |
| 4076 | Min_depth int64 |
| 4077 | Max_depth int64 |
| 4078 | } |
| 4079 | |
| 4080 | // QueueStatisticsDepthMinMaxContext provides type-safe operations for QueueStatistics.DepthMinMax context |
| 4081 | type QueueStatisticsDepthMinMaxContext struct { |
| 4082 | framework.Context[QueueStatisticsLabels] |
| 4083 | } |
| 4084 | |
| 4085 | // Set provides type-safe dimension setting for QueueStatistics.DepthMinMax context |
| 4086 | func (c QueueStatisticsDepthMinMaxContext) Set(state *framework.CollectorState, labels QueueStatisticsLabels, values QueueStatisticsDepthMinMaxValues) { |
| 4087 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4088 | "min_depth": values.Min_depth, |
| 4089 | "max_depth": values.Max_depth, |
| 4090 | }) |
| 4091 | } |
| 4092 | |
| 4093 | // SetUpdateEvery sets the update interval for this instance |
| 4094 | func (c QueueStatisticsDepthMinMaxContext) SetUpdateEvery(state *framework.CollectorState, labels QueueStatisticsLabels, updateEvery int) { |
| 4095 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4096 | } |
| 4097 | |
| 4098 | // QueueStatisticsAvgQueueTimeValues defines the type-safe values for QueueStatistics.AvgQueueTime context |
| 4099 | type QueueStatisticsAvgQueueTimeValues struct { |
| 4100 | Non_persistent int64 |
| 4101 | Persistent int64 |
| 4102 | } |
| 4103 | |
| 4104 | // QueueStatisticsAvgQueueTimeContext provides type-safe operations for QueueStatistics.AvgQueueTime context |
| 4105 | type QueueStatisticsAvgQueueTimeContext struct { |
| 4106 | framework.Context[QueueStatisticsLabels] |
| 4107 | } |
| 4108 | |
| 4109 | // Set provides type-safe dimension setting for QueueStatistics.AvgQueueTime context |
| 4110 | func (c QueueStatisticsAvgQueueTimeContext) Set(state *framework.CollectorState, labels QueueStatisticsLabels, values QueueStatisticsAvgQueueTimeValues) { |
| 4111 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4112 | "non_persistent": values.Non_persistent, |
| 4113 | "persistent": values.Persistent, |
| 4114 | }) |
| 4115 | } |
| 4116 | |
| 4117 | // SetUpdateEvery sets the update interval for this instance |
| 4118 | func (c QueueStatisticsAvgQueueTimeContext) SetUpdateEvery(state *framework.CollectorState, labels QueueStatisticsLabels, updateEvery int) { |
| 4119 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4120 | } |
| 4121 | |
| 4122 | // QueueStatisticsQueueTimeIndicatorsValues defines the type-safe values for QueueStatistics.QueueTimeIndicators context |
| 4123 | type QueueStatisticsQueueTimeIndicatorsValues struct { |
| 4124 | Short_period int64 |
| 4125 | Long_period int64 |
| 4126 | } |
| 4127 | |
| 4128 | // QueueStatisticsQueueTimeIndicatorsContext provides type-safe operations for QueueStatistics.QueueTimeIndicators context |
| 4129 | type QueueStatisticsQueueTimeIndicatorsContext struct { |
| 4130 | framework.Context[QueueStatisticsLabels] |
| 4131 | } |
| 4132 | |
| 4133 | // Set provides type-safe dimension setting for QueueStatistics.QueueTimeIndicators context |
| 4134 | func (c QueueStatisticsQueueTimeIndicatorsContext) Set(state *framework.CollectorState, labels QueueStatisticsLabels, values QueueStatisticsQueueTimeIndicatorsValues) { |
| 4135 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4136 | "short_period": values.Short_period, |
| 4137 | "long_period": values.Long_period, |
| 4138 | }) |
| 4139 | } |
| 4140 | |
| 4141 | // SetUpdateEvery sets the update interval for this instance |
| 4142 | func (c QueueStatisticsQueueTimeIndicatorsContext) SetUpdateEvery(state *framework.CollectorState, labels QueueStatisticsLabels, updateEvery int) { |
| 4143 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4144 | } |
| 4145 | |
| 4146 | // QueueStatisticsOperationsValues defines the type-safe values for QueueStatistics.Operations context |
| 4147 | type QueueStatisticsOperationsValues struct { |
| 4148 | Puts_non_persistent int64 |
| 4149 | Puts_persistent int64 |
| 4150 | Gets_non_persistent int64 |
| 4151 | Gets_persistent int64 |
| 4152 | Put1s int64 |
| 4153 | Browses int64 |
| 4154 | } |
| 4155 | |
| 4156 | // QueueStatisticsOperationsContext provides type-safe operations for QueueStatistics.Operations context |
| 4157 | type QueueStatisticsOperationsContext struct { |
| 4158 | framework.Context[QueueStatisticsLabels] |
| 4159 | } |
| 4160 | |
| 4161 | // Set provides type-safe dimension setting for QueueStatistics.Operations context |
| 4162 | func (c QueueStatisticsOperationsContext) Set(state *framework.CollectorState, labels QueueStatisticsLabels, values QueueStatisticsOperationsValues) { |
| 4163 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4164 | "puts_non_persistent": values.Puts_non_persistent, |
| 4165 | "puts_persistent": values.Puts_persistent, |
| 4166 | "gets_non_persistent": values.Gets_non_persistent, |
| 4167 | "gets_persistent": values.Gets_persistent, |
| 4168 | "put1s": values.Put1s, |
| 4169 | "browses": values.Browses, |
| 4170 | }) |
| 4171 | } |
| 4172 | |
| 4173 | // SetUpdateEvery sets the update interval for this instance |
| 4174 | func (c QueueStatisticsOperationsContext) SetUpdateEvery(state *framework.CollectorState, labels QueueStatisticsLabels, updateEvery int) { |
| 4175 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4176 | } |
| 4177 | |
| 4178 | // QueueStatisticsBytesValues defines the type-safe values for QueueStatistics.Bytes context |
| 4179 | type QueueStatisticsBytesValues struct { |
| 4180 | Put_bytes_non_persistent int64 |
| 4181 | Put_bytes_persistent int64 |
| 4182 | Get_bytes_non_persistent int64 |
| 4183 | Get_bytes_persistent int64 |
| 4184 | Browse_bytes int64 |
| 4185 | } |
| 4186 | |
| 4187 | // QueueStatisticsBytesContext provides type-safe operations for QueueStatistics.Bytes context |
| 4188 | type QueueStatisticsBytesContext struct { |
| 4189 | framework.Context[QueueStatisticsLabels] |
| 4190 | } |
| 4191 | |
| 4192 | // Set provides type-safe dimension setting for QueueStatistics.Bytes context |
| 4193 | func (c QueueStatisticsBytesContext) Set(state *framework.CollectorState, labels QueueStatisticsLabels, values QueueStatisticsBytesValues) { |
| 4194 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4195 | "put_bytes_non_persistent": values.Put_bytes_non_persistent, |
| 4196 | "put_bytes_persistent": values.Put_bytes_persistent, |
| 4197 | "get_bytes_non_persistent": values.Get_bytes_non_persistent, |
| 4198 | "get_bytes_persistent": values.Get_bytes_persistent, |
| 4199 | "browse_bytes": values.Browse_bytes, |
| 4200 | }) |
| 4201 | } |
| 4202 | |
| 4203 | // SetUpdateEvery sets the update interval for this instance |
| 4204 | func (c QueueStatisticsBytesContext) SetUpdateEvery(state *framework.CollectorState, labels QueueStatisticsLabels, updateEvery int) { |
| 4205 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4206 | } |
| 4207 | |
| 4208 | // QueueStatisticsFailuresValues defines the type-safe values for QueueStatistics.Failures context |
| 4209 | type QueueStatisticsFailuresValues struct { |
| 4210 | Puts_failed int64 |
| 4211 | Put1s_failed int64 |
| 4212 | Gets_failed int64 |
| 4213 | Browses_failed int64 |
| 4214 | } |
| 4215 | |
| 4216 | // QueueStatisticsFailuresContext provides type-safe operations for QueueStatistics.Failures context |
| 4217 | type QueueStatisticsFailuresContext struct { |
| 4218 | framework.Context[QueueStatisticsLabels] |
| 4219 | } |
| 4220 | |
| 4221 | // Set provides type-safe dimension setting for QueueStatistics.Failures context |
| 4222 | func (c QueueStatisticsFailuresContext) Set(state *framework.CollectorState, labels QueueStatisticsLabels, values QueueStatisticsFailuresValues) { |
| 4223 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4224 | "puts_failed": values.Puts_failed, |
| 4225 | "put1s_failed": values.Put1s_failed, |
| 4226 | "gets_failed": values.Gets_failed, |
| 4227 | "browses_failed": values.Browses_failed, |
| 4228 | }) |
| 4229 | } |
| 4230 | |
| 4231 | // SetUpdateEvery sets the update interval for this instance |
| 4232 | func (c QueueStatisticsFailuresContext) SetUpdateEvery(state *framework.CollectorState, labels QueueStatisticsLabels, updateEvery int) { |
| 4233 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4234 | } |
| 4235 | |
| 4236 | // QueueStatisticsMessageLifecycleValues defines the type-safe values for QueueStatistics.MessageLifecycle context |
| 4237 | type QueueStatisticsMessageLifecycleValues struct { |
| 4238 | Expired int64 |
| 4239 | Purged int64 |
| 4240 | Not_queued int64 |
| 4241 | } |
| 4242 | |
| 4243 | // QueueStatisticsMessageLifecycleContext provides type-safe operations for QueueStatistics.MessageLifecycle context |
| 4244 | type QueueStatisticsMessageLifecycleContext struct { |
| 4245 | framework.Context[QueueStatisticsLabels] |
| 4246 | } |
| 4247 | |
| 4248 | // Set provides type-safe dimension setting for QueueStatistics.MessageLifecycle context |
| 4249 | func (c QueueStatisticsMessageLifecycleContext) Set(state *framework.CollectorState, labels QueueStatisticsLabels, values QueueStatisticsMessageLifecycleValues) { |
| 4250 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4251 | "expired": values.Expired, |
| 4252 | "purged": values.Purged, |
| 4253 | "not_queued": values.Not_queued, |
| 4254 | }) |
| 4255 | } |
| 4256 | |
| 4257 | // SetUpdateEvery sets the update interval for this instance |
| 4258 | func (c QueueStatisticsMessageLifecycleContext) SetUpdateEvery(state *framework.CollectorState, labels QueueStatisticsLabels, updateEvery int) { |
| 4259 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4260 | } |
| 4261 | |
| 4262 | // QueueStatisticsLabels defines the required labels for QueueStatistics contexts |
| 4263 | type QueueStatisticsLabels struct { |
| 4264 | Queue string |
| 4265 | Type string |
| 4266 | } |
| 4267 | |
| 4268 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 4269 | func (l QueueStatisticsLabels) InstanceID(contextName string) string { |
| 4270 | // Label order from YAML: queue, type |
| 4271 | return contextName + "." + cleanLabelValue(l.Queue) + "_" + cleanLabelValue(l.Type) |
| 4272 | } |
| 4273 | |
| 4274 | // QueueStatistics contains all metric contexts for QueueStatistics |
| 4275 | var QueueStatistics = struct { |
| 4276 | DepthMinMax QueueStatisticsDepthMinMaxContext |
| 4277 | AvgQueueTime QueueStatisticsAvgQueueTimeContext |
| 4278 | QueueTimeIndicators QueueStatisticsQueueTimeIndicatorsContext |
| 4279 | Operations QueueStatisticsOperationsContext |
| 4280 | Bytes QueueStatisticsBytesContext |
| 4281 | Failures QueueStatisticsFailuresContext |
| 4282 | MessageLifecycle QueueStatisticsMessageLifecycleContext |
| 4283 | }{ |
| 4284 | DepthMinMax: QueueStatisticsDepthMinMaxContext{ |
| 4285 | Context: framework.Context[QueueStatisticsLabels]{ |
| 4286 | Name: "mq.queue_stats.depth_min_max", |
| 4287 | Family: "queues/statistics", |
| 4288 | Title: "Queue Depth Min/Max (Statistics)", |
| 4289 | Units: "messages", |
| 4290 | Type: module.Line, |
| 4291 | Priority: 6000, |
| 4292 | UpdateEvery: 1, |
| 4293 | Dimensions: []framework.Dimension{ |
| 4294 | { |
| 4295 | Name: "min_depth", |
| 4296 | Algorithm: module.Absolute, |
| 4297 | Mul: 1, |
| 4298 | Div: 1, |
| 4299 | Precision: 1, |
| 4300 | }, |
| 4301 | { |
| 4302 | Name: "max_depth", |
| 4303 | Algorithm: module.Absolute, |
| 4304 | Mul: 1, |
| 4305 | Div: 1, |
| 4306 | Precision: 1, |
| 4307 | }, |
| 4308 | }, |
| 4309 | LabelKeys: []string{ |
| 4310 | "queue", |
| 4311 | "type", |
| 4312 | }, |
| 4313 | }, |
| 4314 | }, |
| 4315 | AvgQueueTime: QueueStatisticsAvgQueueTimeContext{ |
| 4316 | Context: framework.Context[QueueStatisticsLabels]{ |
| 4317 | Name: "mq.queue_stats.avg_queue_time", |
| 4318 | Family: "queues/statistics", |
| 4319 | Title: "Queue Average Time (Statistics)", |
| 4320 | Units: "microseconds", |
| 4321 | Type: module.Line, |
| 4322 | Priority: 6001, |
| 4323 | UpdateEvery: 1, |
| 4324 | Dimensions: []framework.Dimension{ |
| 4325 | { |
| 4326 | Name: "non_persistent", |
| 4327 | Algorithm: module.Absolute, |
| 4328 | Mul: 1, |
| 4329 | Div: 1, |
| 4330 | Precision: 1, |
| 4331 | }, |
| 4332 | { |
| 4333 | Name: "persistent", |
| 4334 | Algorithm: module.Absolute, |
| 4335 | Mul: 1, |
| 4336 | Div: 1, |
| 4337 | Precision: 1, |
| 4338 | }, |
| 4339 | }, |
| 4340 | LabelKeys: []string{ |
| 4341 | "queue", |
| 4342 | "type", |
| 4343 | }, |
| 4344 | }, |
| 4345 | }, |
| 4346 | QueueTimeIndicators: QueueStatisticsQueueTimeIndicatorsContext{ |
| 4347 | Context: framework.Context[QueueStatisticsLabels]{ |
| 4348 | Name: "mq.queue_stats.time_indicators", |
| 4349 | Family: "queues/statistics", |
| 4350 | Title: "Queue Time Indicators (Statistics)", |
| 4351 | Units: "microseconds", |
| 4352 | Type: module.Line, |
| 4353 | Priority: 6002, |
| 4354 | UpdateEvery: 1, |
| 4355 | Dimensions: []framework.Dimension{ |
| 4356 | { |
| 4357 | Name: "short_period", |
| 4358 | Algorithm: module.Absolute, |
| 4359 | Mul: 1, |
| 4360 | Div: 1, |
| 4361 | Precision: 1, |
| 4362 | }, |
| 4363 | { |
| 4364 | Name: "long_period", |
| 4365 | Algorithm: module.Absolute, |
| 4366 | Mul: 1, |
| 4367 | Div: 1, |
| 4368 | Precision: 1, |
| 4369 | }, |
| 4370 | }, |
| 4371 | LabelKeys: []string{ |
| 4372 | "queue", |
| 4373 | "type", |
| 4374 | }, |
| 4375 | }, |
| 4376 | }, |
| 4377 | Operations: QueueStatisticsOperationsContext{ |
| 4378 | Context: framework.Context[QueueStatisticsLabels]{ |
| 4379 | Name: "mq.queue_stats.operations", |
| 4380 | Family: "queues/statistics", |
| 4381 | Title: "Queue Operations (Statistics)", |
| 4382 | Units: "operations/s", |
| 4383 | Type: module.Line, |
| 4384 | Priority: 6003, |
| 4385 | UpdateEvery: 1, |
| 4386 | Dimensions: []framework.Dimension{ |
| 4387 | { |
| 4388 | Name: "puts_non_persistent", |
| 4389 | Algorithm: module.Incremental, |
| 4390 | Mul: 1, |
| 4391 | Div: 1, |
| 4392 | Precision: 1, |
| 4393 | }, |
| 4394 | { |
| 4395 | Name: "puts_persistent", |
| 4396 | Algorithm: module.Incremental, |
| 4397 | Mul: 1, |
| 4398 | Div: 1, |
| 4399 | Precision: 1, |
| 4400 | }, |
| 4401 | { |
| 4402 | Name: "gets_non_persistent", |
| 4403 | Algorithm: module.Incremental, |
| 4404 | Mul: 1, |
| 4405 | Div: 1, |
| 4406 | Precision: 1, |
| 4407 | }, |
| 4408 | { |
| 4409 | Name: "gets_persistent", |
| 4410 | Algorithm: module.Incremental, |
| 4411 | Mul: 1, |
| 4412 | Div: 1, |
| 4413 | Precision: 1, |
| 4414 | }, |
| 4415 | { |
| 4416 | Name: "put1s", |
| 4417 | Algorithm: module.Incremental, |
| 4418 | Mul: 1, |
| 4419 | Div: 1, |
| 4420 | Precision: 1, |
| 4421 | }, |
| 4422 | { |
| 4423 | Name: "browses", |
| 4424 | Algorithm: module.Incremental, |
| 4425 | Mul: 1, |
| 4426 | Div: 1, |
| 4427 | Precision: 1, |
| 4428 | }, |
| 4429 | }, |
| 4430 | LabelKeys: []string{ |
| 4431 | "queue", |
| 4432 | "type", |
| 4433 | }, |
| 4434 | }, |
| 4435 | }, |
| 4436 | Bytes: QueueStatisticsBytesContext{ |
| 4437 | Context: framework.Context[QueueStatisticsLabels]{ |
| 4438 | Name: "mq.queue_stats.bytes", |
| 4439 | Family: "queues/statistics", |
| 4440 | Title: "Queue Bytes (Statistics)", |
| 4441 | Units: "bytes/s", |
| 4442 | Type: module.Line, |
| 4443 | Priority: 6004, |
| 4444 | UpdateEvery: 1, |
| 4445 | Dimensions: []framework.Dimension{ |
| 4446 | { |
| 4447 | Name: "put_bytes_non_persistent", |
| 4448 | Algorithm: module.Incremental, |
| 4449 | Mul: 1, |
| 4450 | Div: 1, |
| 4451 | Precision: 1, |
| 4452 | }, |
| 4453 | { |
| 4454 | Name: "put_bytes_persistent", |
| 4455 | Algorithm: module.Incremental, |
| 4456 | Mul: 1, |
| 4457 | Div: 1, |
| 4458 | Precision: 1, |
| 4459 | }, |
| 4460 | { |
| 4461 | Name: "get_bytes_non_persistent", |
| 4462 | Algorithm: module.Incremental, |
| 4463 | Mul: 1, |
| 4464 | Div: 1, |
| 4465 | Precision: 1, |
| 4466 | }, |
| 4467 | { |
| 4468 | Name: "get_bytes_persistent", |
| 4469 | Algorithm: module.Incremental, |
| 4470 | Mul: 1, |
| 4471 | Div: 1, |
| 4472 | Precision: 1, |
| 4473 | }, |
| 4474 | { |
| 4475 | Name: "browse_bytes", |
| 4476 | Algorithm: module.Incremental, |
| 4477 | Mul: 1, |
| 4478 | Div: 1, |
| 4479 | Precision: 1, |
| 4480 | }, |
| 4481 | }, |
| 4482 | LabelKeys: []string{ |
| 4483 | "queue", |
| 4484 | "type", |
| 4485 | }, |
| 4486 | }, |
| 4487 | }, |
| 4488 | Failures: QueueStatisticsFailuresContext{ |
| 4489 | Context: framework.Context[QueueStatisticsLabels]{ |
| 4490 | Name: "mq.queue_stats.failures", |
| 4491 | Family: "queues/statistics", |
| 4492 | Title: "Queue Operation Failures (Statistics)", |
| 4493 | Units: "failures/s", |
| 4494 | Type: module.Line, |
| 4495 | Priority: 6005, |
| 4496 | UpdateEvery: 1, |
| 4497 | Dimensions: []framework.Dimension{ |
| 4498 | { |
| 4499 | Name: "puts_failed", |
| 4500 | Algorithm: module.Incremental, |
| 4501 | Mul: 1, |
| 4502 | Div: 1, |
| 4503 | Precision: 1, |
| 4504 | }, |
| 4505 | { |
| 4506 | Name: "put1s_failed", |
| 4507 | Algorithm: module.Incremental, |
| 4508 | Mul: 1, |
| 4509 | Div: 1, |
| 4510 | Precision: 1, |
| 4511 | }, |
| 4512 | { |
| 4513 | Name: "gets_failed", |
| 4514 | Algorithm: module.Incremental, |
| 4515 | Mul: 1, |
| 4516 | Div: 1, |
| 4517 | Precision: 1, |
| 4518 | }, |
| 4519 | { |
| 4520 | Name: "browses_failed", |
| 4521 | Algorithm: module.Incremental, |
| 4522 | Mul: 1, |
| 4523 | Div: 1, |
| 4524 | Precision: 1, |
| 4525 | }, |
| 4526 | }, |
| 4527 | LabelKeys: []string{ |
| 4528 | "queue", |
| 4529 | "type", |
| 4530 | }, |
| 4531 | }, |
| 4532 | }, |
| 4533 | MessageLifecycle: QueueStatisticsMessageLifecycleContext{ |
| 4534 | Context: framework.Context[QueueStatisticsLabels]{ |
| 4535 | Name: "mq.queue_stats.message_lifecycle", |
| 4536 | Family: "queues/statistics", |
| 4537 | Title: "Queue Message Lifecycle (Statistics)", |
| 4538 | Units: "messages/s", |
| 4539 | Type: module.Line, |
| 4540 | Priority: 6006, |
| 4541 | UpdateEvery: 1, |
| 4542 | Dimensions: []framework.Dimension{ |
| 4543 | { |
| 4544 | Name: "expired", |
| 4545 | Algorithm: module.Incremental, |
| 4546 | Mul: 1, |
| 4547 | Div: 1, |
| 4548 | Precision: 1, |
| 4549 | }, |
| 4550 | { |
| 4551 | Name: "purged", |
| 4552 | Algorithm: module.Incremental, |
| 4553 | Mul: 1, |
| 4554 | Div: 1, |
| 4555 | Precision: 1, |
| 4556 | }, |
| 4557 | { |
| 4558 | Name: "not_queued", |
| 4559 | Algorithm: module.Incremental, |
| 4560 | Mul: 1, |
| 4561 | Div: 1, |
| 4562 | Precision: 1, |
| 4563 | }, |
| 4564 | }, |
| 4565 | LabelKeys: []string{ |
| 4566 | "queue", |
| 4567 | "type", |
| 4568 | }, |
| 4569 | }, |
| 4570 | }, |
| 4571 | } |
| 4572 | |
| 4573 | // --- Subscription --- |
| 4574 | |
| 4575 | // SubscriptionMessageCountValues defines the type-safe values for Subscription.MessageCount context |
| 4576 | type SubscriptionMessageCountValues struct { |
| 4577 | Pending int64 |
| 4578 | } |
| 4579 | |
| 4580 | // SubscriptionMessageCountContext provides type-safe operations for Subscription.MessageCount context |
| 4581 | type SubscriptionMessageCountContext struct { |
| 4582 | framework.Context[SubscriptionLabels] |
| 4583 | } |
| 4584 | |
| 4585 | // Set provides type-safe dimension setting for Subscription.MessageCount context |
| 4586 | func (c SubscriptionMessageCountContext) Set(state *framework.CollectorState, labels SubscriptionLabels, values SubscriptionMessageCountValues) { |
| 4587 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4588 | "pending": values.Pending, |
| 4589 | }) |
| 4590 | } |
| 4591 | |
| 4592 | // SetUpdateEvery sets the update interval for this instance |
| 4593 | func (c SubscriptionMessageCountContext) SetUpdateEvery(state *framework.CollectorState, labels SubscriptionLabels, updateEvery int) { |
| 4594 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4595 | } |
| 4596 | |
| 4597 | // SubscriptionLastMessageAgeValues defines the type-safe values for Subscription.LastMessageAge context |
| 4598 | type SubscriptionLastMessageAgeValues struct { |
| 4599 | Age int64 |
| 4600 | } |
| 4601 | |
| 4602 | // SubscriptionLastMessageAgeContext provides type-safe operations for Subscription.LastMessageAge context |
| 4603 | type SubscriptionLastMessageAgeContext struct { |
| 4604 | framework.Context[SubscriptionLabels] |
| 4605 | } |
| 4606 | |
| 4607 | // Set provides type-safe dimension setting for Subscription.LastMessageAge context |
| 4608 | func (c SubscriptionLastMessageAgeContext) Set(state *framework.CollectorState, labels SubscriptionLabels, values SubscriptionLastMessageAgeValues) { |
| 4609 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4610 | "age": values.Age, |
| 4611 | }) |
| 4612 | } |
| 4613 | |
| 4614 | // SetUpdateEvery sets the update interval for this instance |
| 4615 | func (c SubscriptionLastMessageAgeContext) SetUpdateEvery(state *framework.CollectorState, labels SubscriptionLabels, updateEvery int) { |
| 4616 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4617 | } |
| 4618 | |
| 4619 | // SubscriptionLabels defines the required labels for Subscription contexts |
| 4620 | type SubscriptionLabels struct { |
| 4621 | Subscription string |
| 4622 | Topic string |
| 4623 | } |
| 4624 | |
| 4625 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 4626 | func (l SubscriptionLabels) InstanceID(contextName string) string { |
| 4627 | // Label order from YAML: subscription, topic |
| 4628 | return contextName + "." + cleanLabelValue(l.Subscription) + "_" + cleanLabelValue(l.Topic) |
| 4629 | } |
| 4630 | |
| 4631 | // Subscription contains all metric contexts for Subscription |
| 4632 | var Subscription = struct { |
| 4633 | MessageCount SubscriptionMessageCountContext |
| 4634 | LastMessageAge SubscriptionLastMessageAgeContext |
| 4635 | }{ |
| 4636 | MessageCount: SubscriptionMessageCountContext{ |
| 4637 | Context: framework.Context[SubscriptionLabels]{ |
| 4638 | Name: "mq.subscription.messages", |
| 4639 | Family: "subscriptions", |
| 4640 | Title: "IBM MQ Subscription Messages", |
| 4641 | Units: "messages", |
| 4642 | Type: module.Line, |
| 4643 | Priority: 9000, |
| 4644 | UpdateEvery: 1, |
| 4645 | Dimensions: []framework.Dimension{ |
| 4646 | { |
| 4647 | Name: "pending", |
| 4648 | Algorithm: module.Absolute, |
| 4649 | Mul: 1, |
| 4650 | Div: 1, |
| 4651 | Precision: 1, |
| 4652 | }, |
| 4653 | }, |
| 4654 | LabelKeys: []string{ |
| 4655 | "subscription", |
| 4656 | "topic", |
| 4657 | }, |
| 4658 | }, |
| 4659 | }, |
| 4660 | LastMessageAge: SubscriptionLastMessageAgeContext{ |
| 4661 | Context: framework.Context[SubscriptionLabels]{ |
| 4662 | Name: "mq.subscription.last_message_age", |
| 4663 | Family: "subscriptions", |
| 4664 | Title: "IBM MQ Subscription Last Message Age", |
| 4665 | Units: "seconds", |
| 4666 | Type: module.Line, |
| 4667 | Priority: 9001, |
| 4668 | UpdateEvery: 1, |
| 4669 | Dimensions: []framework.Dimension{ |
| 4670 | { |
| 4671 | Name: "age", |
| 4672 | Algorithm: module.Absolute, |
| 4673 | Mul: 1, |
| 4674 | Div: 1, |
| 4675 | Precision: 1, |
| 4676 | }, |
| 4677 | }, |
| 4678 | LabelKeys: []string{ |
| 4679 | "subscription", |
| 4680 | "topic", |
| 4681 | }, |
| 4682 | }, |
| 4683 | }, |
| 4684 | } |
| 4685 | |
| 4686 | // --- Topic --- |
| 4687 | |
| 4688 | // TopicPublishersValues defines the type-safe values for Topic.Publishers context |
| 4689 | type TopicPublishersValues struct { |
| 4690 | Publishers int64 |
| 4691 | } |
| 4692 | |
| 4693 | // TopicPublishersContext provides type-safe operations for Topic.Publishers context |
| 4694 | type TopicPublishersContext struct { |
| 4695 | framework.Context[TopicLabels] |
| 4696 | } |
| 4697 | |
| 4698 | // Set provides type-safe dimension setting for Topic.Publishers context |
| 4699 | func (c TopicPublishersContext) Set(state *framework.CollectorState, labels TopicLabels, values TopicPublishersValues) { |
| 4700 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4701 | "publishers": values.Publishers, |
| 4702 | }) |
| 4703 | } |
| 4704 | |
| 4705 | // SetUpdateEvery sets the update interval for this instance |
| 4706 | func (c TopicPublishersContext) SetUpdateEvery(state *framework.CollectorState, labels TopicLabels, updateEvery int) { |
| 4707 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4708 | } |
| 4709 | |
| 4710 | // TopicSubscribersValues defines the type-safe values for Topic.Subscribers context |
| 4711 | type TopicSubscribersValues struct { |
| 4712 | Subscribers int64 |
| 4713 | } |
| 4714 | |
| 4715 | // TopicSubscribersContext provides type-safe operations for Topic.Subscribers context |
| 4716 | type TopicSubscribersContext struct { |
| 4717 | framework.Context[TopicLabels] |
| 4718 | } |
| 4719 | |
| 4720 | // Set provides type-safe dimension setting for Topic.Subscribers context |
| 4721 | func (c TopicSubscribersContext) Set(state *framework.CollectorState, labels TopicLabels, values TopicSubscribersValues) { |
| 4722 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4723 | "subscribers": values.Subscribers, |
| 4724 | }) |
| 4725 | } |
| 4726 | |
| 4727 | // SetUpdateEvery sets the update interval for this instance |
| 4728 | func (c TopicSubscribersContext) SetUpdateEvery(state *framework.CollectorState, labels TopicLabels, updateEvery int) { |
| 4729 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4730 | } |
| 4731 | |
| 4732 | // TopicMessagesValues defines the type-safe values for Topic.Messages context |
| 4733 | type TopicMessagesValues struct { |
| 4734 | Messages int64 |
| 4735 | } |
| 4736 | |
| 4737 | // TopicMessagesContext provides type-safe operations for Topic.Messages context |
| 4738 | type TopicMessagesContext struct { |
| 4739 | framework.Context[TopicLabels] |
| 4740 | } |
| 4741 | |
| 4742 | // Set provides type-safe dimension setting for Topic.Messages context |
| 4743 | func (c TopicMessagesContext) Set(state *framework.CollectorState, labels TopicLabels, values TopicMessagesValues) { |
| 4744 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4745 | "messages": values.Messages, |
| 4746 | }) |
| 4747 | } |
| 4748 | |
| 4749 | // SetUpdateEvery sets the update interval for this instance |
| 4750 | func (c TopicMessagesContext) SetUpdateEvery(state *framework.CollectorState, labels TopicLabels, updateEvery int) { |
| 4751 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4752 | } |
| 4753 | |
| 4754 | // TopicTimeSinceLastMessageValues defines the type-safe values for Topic.TimeSinceLastMessage context |
| 4755 | type TopicTimeSinceLastMessageValues struct { |
| 4756 | Time_since_last_msg int64 |
| 4757 | } |
| 4758 | |
| 4759 | // TopicTimeSinceLastMessageContext provides type-safe operations for Topic.TimeSinceLastMessage context |
| 4760 | type TopicTimeSinceLastMessageContext struct { |
| 4761 | framework.Context[TopicLabels] |
| 4762 | } |
| 4763 | |
| 4764 | // Set provides type-safe dimension setting for Topic.TimeSinceLastMessage context |
| 4765 | func (c TopicTimeSinceLastMessageContext) Set(state *framework.CollectorState, labels TopicLabels, values TopicTimeSinceLastMessageValues) { |
| 4766 | state.SetMetricsForGeneratedCode(&c.Context, labels, map[string]int64{ |
| 4767 | "time_since_last_msg": values.Time_since_last_msg, |
| 4768 | }) |
| 4769 | } |
| 4770 | |
| 4771 | // SetUpdateEvery sets the update interval for this instance |
| 4772 | func (c TopicTimeSinceLastMessageContext) SetUpdateEvery(state *framework.CollectorState, labels TopicLabels, updateEvery int) { |
| 4773 | state.SetUpdateEveryOverrideForGeneratedCode(&c.Context, labels, updateEvery) |
| 4774 | } |
| 4775 | |
| 4776 | // TopicLabels defines the required labels for Topic contexts |
| 4777 | type TopicLabels struct { |
| 4778 | Topic string |
| 4779 | } |
| 4780 | |
| 4781 | // InstanceID generates a unique instance ID using the hardcoded label order from YAML |
| 4782 | func (l TopicLabels) InstanceID(contextName string) string { |
| 4783 | // Label order from YAML: topic |
| 4784 | return contextName + "." + cleanLabelValue(l.Topic) |
| 4785 | } |
| 4786 | |
| 4787 | // Topic contains all metric contexts for Topic |
| 4788 | var Topic = struct { |
| 4789 | Publishers TopicPublishersContext |
| 4790 | Subscribers TopicSubscribersContext |
| 4791 | Messages TopicMessagesContext |
| 4792 | TimeSinceLastMessage TopicTimeSinceLastMessageContext |
| 4793 | }{ |
| 4794 | Publishers: TopicPublishersContext{ |
| 4795 | Context: framework.Context[TopicLabels]{ |
| 4796 | Name: "mq.topic.publishers", |
| 4797 | Family: "topics", |
| 4798 | Title: "Topic Publishers", |
| 4799 | Units: "publishers", |
| 4800 | Type: module.Line, |
| 4801 | Priority: 4000, |
| 4802 | UpdateEvery: 1, |
| 4803 | Dimensions: []framework.Dimension{ |
| 4804 | { |
| 4805 | Name: "publishers", |
| 4806 | Algorithm: module.Absolute, |
| 4807 | Mul: 1, |
| 4808 | Div: 1, |
| 4809 | Precision: 1, |
| 4810 | }, |
| 4811 | }, |
| 4812 | LabelKeys: []string{ |
| 4813 | "topic", |
| 4814 | }, |
| 4815 | }, |
| 4816 | }, |
| 4817 | Subscribers: TopicSubscribersContext{ |
| 4818 | Context: framework.Context[TopicLabels]{ |
| 4819 | Name: "mq.topic.subscribers", |
| 4820 | Family: "topics", |
| 4821 | Title: "Topic Subscribers", |
| 4822 | Units: "subscribers", |
| 4823 | Type: module.Line, |
| 4824 | Priority: 4001, |
| 4825 | UpdateEvery: 1, |
| 4826 | Dimensions: []framework.Dimension{ |
| 4827 | { |
| 4828 | Name: "subscribers", |
| 4829 | Algorithm: module.Absolute, |
| 4830 | Mul: 1, |
| 4831 | Div: 1, |
| 4832 | Precision: 1, |
| 4833 | }, |
| 4834 | }, |
| 4835 | LabelKeys: []string{ |
| 4836 | "topic", |
| 4837 | }, |
| 4838 | }, |
| 4839 | }, |
| 4840 | Messages: TopicMessagesContext{ |
| 4841 | Context: framework.Context[TopicLabels]{ |
| 4842 | Name: "mq.topic.messages", |
| 4843 | Family: "topics", |
| 4844 | Title: "Topic Message Rate", |
| 4845 | Units: "messages/s", |
| 4846 | Type: module.Line, |
| 4847 | Priority: 4002, |
| 4848 | UpdateEvery: 1, |
| 4849 | Dimensions: []framework.Dimension{ |
| 4850 | { |
| 4851 | Name: "messages", |
| 4852 | Algorithm: module.Incremental, |
| 4853 | Mul: 1, |
| 4854 | Div: 1, |
| 4855 | Precision: 1, |
| 4856 | }, |
| 4857 | }, |
| 4858 | LabelKeys: []string{ |
| 4859 | "topic", |
| 4860 | }, |
| 4861 | }, |
| 4862 | }, |
| 4863 | TimeSinceLastMessage: TopicTimeSinceLastMessageContext{ |
| 4864 | Context: framework.Context[TopicLabels]{ |
| 4865 | Name: "mq.topic.time_since_last_message", |
| 4866 | Family: "topics", |
| 4867 | Title: "Time Since Last Message", |
| 4868 | Units: "seconds", |
| 4869 | Type: module.Line, |
| 4870 | Priority: 4003, |
| 4871 | UpdateEvery: 1, |
| 4872 | Dimensions: []framework.Dimension{ |
| 4873 | { |
| 4874 | Name: "time_since_last_msg", |
| 4875 | Algorithm: module.Absolute, |
| 4876 | Mul: 1, |
| 4877 | Div: 1, |
| 4878 | Precision: 1, |
| 4879 | }, |
| 4880 | }, |
| 4881 | LabelKeys: []string{ |
| 4882 | "topic", |
| 4883 | }, |
| 4884 | }, |
| 4885 | }, |
| 4886 | } |
| 4887 | |
| 4888 | // GetAllContexts returns all contexts for framework registration |
| 4889 | func GetAllContexts() []interface{} { |
| 4890 | return []interface{}{ |
| 4891 | &Channel.Status.Context, |
| 4892 | &Channel.Messages.Context, |
| 4893 | &Channel.Bytes.Context, |
| 4894 | &Channel.Batches.Context, |
| 4895 | &Channel.BatchSize.Context, |
| 4896 | &Channel.BatchInterval.Context, |
| 4897 | &Channel.Intervals.Context, |
| 4898 | &Channel.ShortRetryCount.Context, |
| 4899 | &Channel.LongRetryInterval.Context, |
| 4900 | &Channel.MaxMessageLength.Context, |
| 4901 | &Channel.SharingConversations.Context, |
| 4902 | &Channel.NetworkPriority.Context, |
| 4903 | &Channel.BufferCounts.Context, |
| 4904 | &Channel.CurrentMessages.Context, |
| 4905 | &Channel.XmitQueueTime.Context, |
| 4906 | &Channel.MCAStatus.Context, |
| 4907 | &Channel.InDoubtStatus.Context, |
| 4908 | &Channel.SSLKeyResets.Context, |
| 4909 | &Channel.NPMSpeed.Context, |
| 4910 | &Channel.CurrentSharingConversations.Context, |
| 4911 | &ChannelStatistics.Messages.Context, |
| 4912 | &ChannelStatistics.Bytes.Context, |
| 4913 | &ChannelStatistics.Batches.Context, |
| 4914 | &ChannelStatistics.BatchSize.Context, |
| 4915 | &ChannelStatistics.PutRetries.Context, |
| 4916 | &Listener.Status.Context, |
| 4917 | &Listener.Backlog.Context, |
| 4918 | &Listener.Uptime.Context, |
| 4919 | &MQIStatistics.Opens.Context, |
| 4920 | &MQIStatistics.Closes.Context, |
| 4921 | &MQIStatistics.Inqs.Context, |
| 4922 | &MQIStatistics.Sets.Context, |
| 4923 | &Queue.Depth.Context, |
| 4924 | &Queue.DepthPercentage.Context, |
| 4925 | &Queue.Messages.Context, |
| 4926 | &Queue.Connections.Context, |
| 4927 | &Queue.HighDepth.Context, |
| 4928 | &Queue.UncommittedMessages.Context, |
| 4929 | &Queue.FileSize.Context, |
| 4930 | &Queue.LastActivity.Context, |
| 4931 | &Queue.OldestMessageAge.Context, |
| 4932 | &Queue.QueueTimeIndicators.Context, |
| 4933 | &Queue.ServiceInterval.Context, |
| 4934 | &Queue.InhibitStatus.Context, |
| 4935 | &Queue.Priority.Context, |
| 4936 | &Queue.MessagePersistence.Context, |
| 4937 | &Queue.RetentionInterval.Context, |
| 4938 | &Queue.Triggers.Context, |
| 4939 | &Queue.BackoutThreshold.Context, |
| 4940 | &Queue.MaxMessageLength.Context, |
| 4941 | &Queue.QueueScope.Context, |
| 4942 | &Queue.QueueUsage.Context, |
| 4943 | &Queue.MessageDeliverySequence.Context, |
| 4944 | &Queue.HardenGetBackout.Context, |
| 4945 | &QueueGroup.Depth.Context, |
| 4946 | &QueueGroup.DepthPercentage.Context, |
| 4947 | &QueueGroup.Messages.Context, |
| 4948 | &QueueGroup.Connections.Context, |
| 4949 | &QueueGroup.UncommittedMessages.Context, |
| 4950 | &QueueGroup.FileSize.Context, |
| 4951 | &QueueGroup.OldestMessageAge.Context, |
| 4952 | &QueueManager.Status.Context, |
| 4953 | &QueueManager.ConnectionCount.Context, |
| 4954 | &QueueManager.Uptime.Context, |
| 4955 | &QueueManager.QueuesOverview.Context, |
| 4956 | &QueueManager.ChannelsOverview.Context, |
| 4957 | &QueueManager.TopicsOverview.Context, |
| 4958 | &QueueManager.ListenersOverview.Context, |
| 4959 | &QueueManagerResources.CPUUsage.Context, |
| 4960 | &QueueManagerResources.MemoryUsage.Context, |
| 4961 | &QueueManagerResources.RAMUsage.Context, |
| 4962 | &QueueManagerResources.LogUtilization.Context, |
| 4963 | &QueueManagerResources.LogFileSize.Context, |
| 4964 | &QueueManagerResources.LogWriteRate.Context, |
| 4965 | &QueueStatistics.DepthMinMax.Context, |
| 4966 | &QueueStatistics.AvgQueueTime.Context, |
| 4967 | &QueueStatistics.QueueTimeIndicators.Context, |
| 4968 | &QueueStatistics.Operations.Context, |
| 4969 | &QueueStatistics.Bytes.Context, |
| 4970 | &QueueStatistics.Failures.Context, |
| 4971 | &QueueStatistics.MessageLifecycle.Context, |
| 4972 | &Subscription.MessageCount.Context, |
| 4973 | &Subscription.LastMessageAge.Context, |
| 4974 | &Topic.Publishers.Context, |
| 4975 | &Topic.Subscribers.Context, |
| 4976 | &Topic.Messages.Context, |
| 4977 | &Topic.TimeSinceLastMessage.Context, |
| 4978 | } |
| 4979 | } |