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
144610: metric: reinitialise sql child metrics on cluster settings change r=aa-joshi a=aa-joshi
This patch introduces two new cluster settings:
`sql.metrics.application_name.enabled` and `sql.metrics.database_name.enabled`. These settings are used to configure `application_name` and `database` labels in sql metrics. To support these labels changes in subsequent metric export, sql metrics require ability to "reset" labels. This reset functionality needs to be added to the sql server because cluster settings and labels are scoped to the virtual cluster. We have extended existing metric registry functionality to reinitialise metrics on cluster change. The metric registry was ideal place because it tracks and manages metrics.
Epic: CRDB-43153
Part of: CRDB-48253
Release note (sql change): New cluster settings
`sql.metrics.application_name.enabled` and `sql.metrics.database_name.enabled` with default value of `false` can be set to true, to display application and database name on supported metrics respectively.
Co-authored-by: Akshay Joshi <[email protected]>
Copy file name to clipboardExpand all lines: docs/generated/settings/settings-for-tenants.txt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -323,6 +323,8 @@ sql.log.slow_query.internal_queries.enabled boolean false when set to true, inte
323
323
sql.log.slow_query.latency_threshold duration 0s when set to non-zero, log statements whose service latency exceeds the threshold to a secondary logger on each node application
324
324
sql.log.user_audit string user/role-based audit logging configuration. An enterprise license is required for this cluster setting to take effect. application
325
325
sql.log.user_audit.reduced_config.enabled boolean false enables logic to compute a reduced audit configuration, computing the audit configuration only once at session start instead of at each SQL event. The tradeoff with the increase in performance (~5%), is that changes to the audit configuration (user role memberships/cluster setting) are not reflected within session. Users will need to start a new session to see these changes in their auditing behaviour. application
326
+
sql.metrics.application_name.enabled boolean false when enabled, SQL metrics would export application name as and additional label as part of child metrics. The number of unique label combinations is limited to 5000 by default. application
327
+
sql.metrics.database_name.enabled boolean false when enabled, SQL metrics would export database name as and additional label as part of child metrics. The number of unique label combinations is limited to 5000 by default. application
326
328
sql.metrics.index_usage_stats.enabled boolean true collect per index usage statistics application
327
329
sql.metrics.max_mem_reported_stmt_fingerprints integer 100000 the maximum number of reported statement fingerprints stored in memory application
328
330
sql.metrics.max_mem_reported_txn_fingerprints integer 100000 the maximum number of reported transaction fingerprints stored in memory application
Copy file name to clipboardExpand all lines: docs/generated/settings/settings.html
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -278,6 +278,8 @@
278
278
<tr><td><divid="setting-sql-log-slow-query-latency-threshold" class="anchored"><code>sql.log.slow_query.latency_threshold</code></div></td><td>duration</td><td><code>0s</code></td><td>when set to non-zero, log statements whose service latency exceeds the threshold to a secondary logger on each node</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
279
279
<tr><td><divid="setting-sql-log-user-audit" class="anchored"><code>sql.log.user_audit</code></div></td><td>string</td><td><code></code></td><td>user/role-based audit logging configuration. An enterprise license is required for this cluster setting to take effect.</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
280
280
<tr><td><divid="setting-sql-log-user-audit-reduced-config-enabled" class="anchored"><code>sql.log.user_audit.reduced_config.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>enables logic to compute a reduced audit configuration, computing the audit configuration only once at session start instead of at each SQL event. The tradeoff with the increase in performance (~5%), is that changes to the audit configuration (user role memberships/cluster setting) are not reflected within session. Users will need to start a new session to see these changes in their auditing behaviour.</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
281
+
<tr><td><divid="setting-sql-metrics-application-name-enabled" class="anchored"><code>sql.metrics.application_name.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>when enabled, SQL metrics would export application name as and additional label as part of child metrics. The number of unique label combinations is limited to 5000 by default.</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
282
+
<tr><td><divid="setting-sql-metrics-database-name-enabled" class="anchored"><code>sql.metrics.database_name.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>when enabled, SQL metrics would export database name as and additional label as part of child metrics. The number of unique label combinations is limited to 5000 by default.</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
281
283
<tr><td><divid="setting-sql-metrics-index-usage-stats-enabled" class="anchored"><code>sql.metrics.index_usage_stats.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>collect per index usage statistics</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
282
284
<tr><td><divid="setting-sql-metrics-max-mem-reported-stmt-fingerprints" class="anchored"><code>sql.metrics.max_mem_reported_stmt_fingerprints</code></div></td><td>integer</td><td><code>100000</code></td><td>the maximum number of reported statement fingerprints stored in memory</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
283
285
<tr><td><divid="setting-sql-metrics-max-mem-reported-txn-fingerprints" class="anchored"><code>sql.metrics.max_mem_reported_txn_fingerprints</code></div></td><td>integer</td><td><code>100000</code></td><td>the maximum number of reported transaction fingerprints stored in memory</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
0 commit comments