Previously, we collected a single histogram for all statements. While this sort of metric may be useful in overall database operations, application developers need more detail, to know how their code changes impact their query latencies.
By switching to HistogramVec, we can now offer per-statement-fingerprint latency metrics.
This feature is disabled by default. To know whether its safe to enable, we also track a cardinality estimate of the unique statement fingerprints that we see.
Release note (o11y change):
The sql.distsql.exec.latency and sql.exec.latency metrics may now be labeled with their statement fingerprint. Enable this feature using the server.detailed_latency_metrics application setting.
The sql.query.unique.count metric is a new count metric that estimates the cardinality of the set of all statement fingerprints. For most workloads, this ranges from dozens to hundreds. For workloads with over a couple thousand fingerprints, we advise caution in enabling server.detailed_latency_metrics.
Previously, we collected a single histogram for all statements. While this sort of metric may be useful in overall database operations, application developers need more detail, to know how their code changes impact their query latencies.
By switching to HistogramVec, we can now offer per-statement-fingerprint latency metrics.
This feature is disabled by default. To know whether its safe to enable, we also track a cardinality estimate of the unique statement fingerprints that we see.
TREQ: https://cockroachlabs.atlassian.net/browse/TREQ-703
Release note (o11y change): The
sql.distsql.exec.latency
andsql.exec.latency
metrics may now be labeled with their statement fingerprint. Enable this feature using theserver.detailed_latency_metrics
application setting.The
sql.query.unique.count
metric is a new count metric that estimates the cardinality of the set of all statement fingerprints. For most workloads, this ranges from dozens to hundreds. For workloads with over a couple thousand fingerprints, we advise caution in enablingserver.detailed_latency_metrics
.