- Notifications
You must be signed in to change notification settings - Fork905
Commite8c75eb
authored
fix: fix metric for hard-limited presets (#18045)
```// Report a metric only if the preset uses the latest version of the template and the template is not deleted.// This avoids conflicts between metrics from old and new template versions.//// NOTE: Multiple versions of a preset can exist with the same orgName, templateName, and presetName,// because templates can have multiple versions — or deleted templates can share the same name.//// The safest approach is to report the metric only for the latest version of the preset.// When a new template version is released, the metric for the new preset should overwrite// the old value in Prometheus.//// However, there’s one edge case: if an admin creates a template, it becomes hard-limited,// then deletes the template and never creates another with the same name,// the old preset will continue to be reported as hard-limited —// even though it’s deleted. This will persist until `coderd` is restarted.```1 parent5b90c69 commite8c75eb
2 files changed
+21
-10
lines changedLines changed: 16 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
361 | 361 |
| |
362 | 362 |
| |
363 | 363 |
| |
364 |
| - | |
365 |
| - | |
366 |
| - | |
| 364 | + | |
| 365 | + | |
367 | 366 |
| |
368 |
| - | |
369 |
| - | |
370 |
| - | |
371 |
| - | |
372 |
| - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
373 | 381 |
| |
374 | 382 |
| |
375 | 383 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1034 | 1034 |
| |
1035 | 1035 |
| |
1036 | 1036 |
| |
1037 |
| - | |
| 1037 | + | |
| 1038 | + | |
1038 | 1039 |
| |
1039 | 1040 |
| |
1040 | 1041 |
| |
1041 | 1042 |
| |
1042 | 1043 |
| |
1043 | 1044 |
| |
1044 | 1045 |
| |
1045 |
| - | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1046 | 1049 |
| |
1047 | 1050 |
| |
1048 | 1051 |
| |
|
0 commit comments
Comments
(0)