@@ -299,21 +299,6 @@ func (c *StoreReconciler) ReconcileAll(ctx context.Context) error {
299299return err
300300}
301301
302- // Report a metric only if the preset uses the latest version of the template and the template is not deleted.
303- // This avoids conflicts between metrics from old and new template versions.
304- //
305- // NOTE: Multiple versions of a preset can exist with the same orgName, templateName, and presetName,
306- // because templates can have multiple versions — or deleted templates can share the same name.
307- //
308- // The safest approach is to report the metric only for the latest version of the preset.
309- // When a new template version is released, the metric for the new preset should overwrite
310- // the old value in Prometheus.
311- //
312- // However, there’s one edge case: if an admin creates a template, it becomes hard-limited,
313- // then deletes the template and never creates another with the same name,
314- // the old preset will continue to be reported as hard-limited —
315- // even though it’s deleted. This will persist until `coderd` is restarted.
316-
317302func (c * StoreReconciler )reportHardLimitedPresets (snapshot * prebuilds.GlobalSnapshot ) {
318303// presetsMap is a map from key (orgName:templateName:presetName) to list of corresponding presets.
319304// Multiple versions of a preset can exist with the same orgName, templateName, and presetName,
@@ -414,24 +399,6 @@ func (c *StoreReconciler) ReconcilePreset(ctx context.Context, ps prebuilds.Pres
414399slog .F ("preset_name" ,ps .Preset .Name ),
415400)
416401
417- // Report a metric only if the preset uses the latest version of the template and the template is not deleted.
418- // This avoids conflicts between metrics from old and new template versions.
419- //
420- // NOTE: Multiple versions of a preset can exist with the same orgName, templateName, and presetName,
421- // because templates can have multiple versions — or deleted templates can share the same name.
422- //
423- // The safest approach is to report the metric only for the latest version of the preset.
424- // When a new template version is released, the metric for the new preset should overwrite
425- // the old value in Prometheus.
426- //
427- // However, there’s one edge case: if an admin creates a template, it becomes hard-limited,
428- // then deletes the template and never creates another with the same name,
429- // the old preset will continue to be reported as hard-limited —
430- // even though it’s deleted. This will persist until `coderd` is restarted.
431- //if ps.Preset.UsingActiveVersion && !ps.Preset.Deleted {
432- //c.metrics.trackHardLimitedStatus(ps.Preset.OrganizationName, ps.Preset.TemplateName, ps.Preset.Name, ps.IsHardLimited)
433- //}
434-
435402// If the preset reached the hard failure limit for the first time during this iteration:
436403// - Mark it as hard-limited in the database
437404// - Send notifications to template admins