You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pkg/*: Refactor metric visibility handling across the codebase
This commit replaces the `Essential` field with a `Visibility` field in various metric definitions, updating the metric metadata to categorize them as INTERNAL, SUPPORT, or ESSENTIAL. This change enhances clarity regarding the intended audience for each metric and ensures consistent handling of metric visibility throughout the codebase.
Part of: CRDB-57261
Epic: CRDB-55082
Release note: None
m.HowToUse=fmt.Sprintf(`This metric tracks the number of active %s statistics jobs that could also be consuming resources. Ensure that foreground SQL traffic is not impacted by correlating this metric with SQL latency and query volume metrics.`, detail)
118
118
casejobspb.TypeBackup:
119
-
m.Essential=true
119
+
m.Visibility=metric.Metadata_ESSENTIAL
120
120
m.Category=metric.Metadata_SQL
121
121
m.HowToUse=`See Description.`
122
122
casejobspb.TypeRowLevelTTL:
123
-
m.Essential=true
123
+
m.Visibility=metric.Metadata_ESSENTIAL
124
124
m.Category=metric.Metadata_TTL
125
125
m.HowToUse=`Monitor this metric to ensure there are not too many Row Level TTL jobs running at the same time. Generally, this metric should be in the low single digits.`
m.HowToUse=fmt.Sprintf(`This metric is a high-level indicator that automatically generated %sstatistics jobs are paused which can lead to the query optimizer running with stale statistics. Stale statistics can cause suboptimal query plans to be selected leading to poor query performance.`, partialDetail)
172
172
casejobspb.TypeBackup:
173
-
m.Essential=true
173
+
m.Visibility=metric.Metadata_ESSENTIAL
174
174
m.Category=metric.Metadata_SQL
175
175
m.HowToUse=`Monitor and alert on this metric to safeguard against an inadvertent operational error of leaving a backup job in a paused state for an extended period of time. In functional areas, a paused job can hold resources or have concurrency impact or some other negative consequence. Paused backup may break the recovery point objective (RPO).`
176
176
casejobspb.TypeChangefeed:
177
-
m.Essential=true
177
+
m.Visibility=metric.Metadata_ESSENTIAL
178
178
m.Category=metric.Metadata_CHANGEFEEDS
179
179
m.HowToUse=`Monitor and alert on this metric to safeguard against an inadvertent operational error of leaving a changefeed job in a paused state for an extended period of time. Changefeed jobs should not be paused for a long time because the protected timestamp prevents garbage collection.`
180
180
casejobspb.TypeRowLevelTTL:
181
-
m.Essential=true
181
+
m.Visibility=metric.Metadata_ESSENTIAL
182
182
m.Category=metric.Metadata_TTL
183
183
m.HowToUse=`Monitor this metric to ensure the Row Level TTL job does not remain paused inadvertently for an extended period.`
m.HowToUse=`If Row Level TTL is enabled, this metric should be nonzero and correspond to the ttl_cron setting that was chosen. If this metric is zero, it means the job is not running`
m.HowToUse=fmt.Sprintf(`This metric is a high-level indicator that automatically generated %stable statistics is failing. Failed statistic creation can lead to the query optimizer running with stale statistics. Stale statistics can cause suboptimal query plans to be selected leading to poor query performance.`, partialDetail)
255
255
casejobspb.TypeRowLevelTTL:
256
-
m.Essential=true
256
+
m.Visibility=metric.Metadata_ESSENTIAL
257
257
m.Category=metric.Metadata_TTL
258
258
m.HowToUse=`This metric should remain at zero. Repeated errors means the Row Level TTL job is not deleting data.`
m.HowToUse=`Changefeeds use protected timestamps to protect the data from being garbage collected. Ensure the protected timestamp age does not significantly exceed the GC TTL zone configuration. Alert on this metric if the protected timestamp age is greater than 3 times the GC TTL.`
0 commit comments