- Notifications
You must be signed in to change notification settings - Fork1.1k
Commit2a15aa8
feat: add hard-limited presets metric (#18008)
Closes#17988Define `preset_hard_limited` metric which for every preset indicateswhether a given preset has reached the hard failure limit (1 forhard-limited, 0 otherwise).CLI example:```curl -X GET localhost:2118/metrics | grep preset_hard_limited# HELP coderd_prebuilt_workspaces_preset_hard_limited Indicates whether a given preset has reached the hard failure limit (1 for hard-limited, 0 otherwise).# TYPE coderd_prebuilt_workspaces_preset_hard_limited gaugecoderd_prebuilt_workspaces_preset_hard_limited{organization_name="coder",preset_name="GoLand: Large",template_name="Test7"} 1coderd_prebuilt_workspaces_preset_hard_limited{organization_name="coder",preset_name="GoLand: Large",template_name="ValidTemplate"} 0coderd_prebuilt_workspaces_preset_hard_limited{organization_name="coder",preset_name="IU: Medium",template_name="Test7"} 1coderd_prebuilt_workspaces_preset_hard_limited{organization_name="coder",preset_name="IU: Medium",template_name="ValidTemplate"} 0coderd_prebuilt_workspaces_preset_hard_limited{organization_name="coder",preset_name="WS: Small",template_name="Test7"} 1```NOTE:```goif !ps.Preset.Deleted && ps.Preset.UsingActiveVersion {c.metrics.trackHardLimitedStatus(ps.Preset.OrganizationName, ps.Preset.TemplateName, ps.Preset.Name, ps.IsHardLimited)}```Only active template version is tracked. If admin creates new templateversion - old value of metric (for previous template version) will beoverwritten with new value of metric (for active template version).Because `template_version` is not part of metric:```golabels = []string{"template_name", "preset_name", "organization_name"}```Implementation is similar to implementation of`MetricResourceReplacementsCount` metric---------Co-authored-by: Susana Ferreira <ssncferreira@gmail.com>1 parent0731304 commit2a15aa8
File tree
3 files changed
+334
-11
lines changed- enterprise/coderd/prebuilds
3 files changed
+334
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
| |||
104 | 111 | | |
105 | 112 | | |
106 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
107 | 117 | | |
108 | 118 | | |
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
112 | 122 | | |
| 123 | + | |
113 | 124 | | |
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
117 | 128 | | |
| 129 | + | |
118 | 130 | | |
119 | 131 | | |
120 | 132 | | |
| |||
126 | 138 | | |
127 | 139 | | |
128 | 140 | | |
| 141 | + | |
129 | 142 | | |
130 | 143 | | |
131 | 144 | | |
| |||
173 | 186 | | |
174 | 187 | | |
175 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
176 | 200 | | |
177 | 201 | | |
178 | 202 | | |
| |||
247 | 271 | | |
248 | 272 | | |
249 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
369 | 373 | | |
370 | 374 | | |
371 | 375 | | |
372 | 376 | | |
373 | | - | |
374 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
375 | 380 | | |
376 | 381 | | |
377 | 382 | | |
| |||
384 | 389 | | |
385 | 390 | | |
386 | 391 | | |
387 | | - | |
388 | 392 | | |
389 | | - | |
390 | | - | |
391 | 393 | | |
392 | 394 | | |
393 | 395 | | |
| |||
452 | 454 | | |
453 | 455 | | |
454 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
455 | 464 | | |
456 | 465 | | |
457 | 466 | | |
| |||
0 commit comments
Comments
(0)