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
Copy file name to clipboardExpand all lines: azure-sql/database/metrics-diagnostic-telemetry-logging-streaming-export-configure.md
+37-21Lines changed: 37 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -512,11 +512,11 @@ The following tables document the telemetry details available for all logs. For
512
512
|`ElasticPoolName_s`| Name of the elastic pool for the database, if any |
513
513
|`DatabaseName_s`| Name of the database |
514
514
|`ResourceId`| Resource URI |
515
-
|`query_hash_s`| Query hash |
516
-
|`query_plan_hash_s`| Query plan hash |
515
+
|`query_hash_s`<sup>1</sup> | Query hash |
516
+
|`query_plan_hash_s`<sup>1</sup> | Query plan hash |
517
517
|`statement_sql_handle_s`| Statement sql handle |
518
-
|`interval_start_time_d` <sup>1</sup> | Internal identifier for the start of the statistics interval. |
519
-
|`interval_end_time_d` <sup>1</sup> | Internal identifier for the end of the statistics interval. |
518
+
|`interval_start_time_d` <sup>2</sup> | Internal identifier for the start of the statistics interval. |
519
+
|`interval_end_time_d` <sup>2</sup> | Internal identifier for the end of the statistics interval. |
520
520
|`logical_io_writes_d`| Total number of logical IO writes |
521
521
|`max_logical_io_writes_d`| Max number of logical IO writes per execution |
522
522
|`physical_io_reads_d`| Total number of physical IO reads |
@@ -542,7 +542,9 @@ The following tables document the telemetry details available for all logs. For
542
542
|`query_id_d`| ID of the query in Query Store |
543
543
|`plan_id_d`| ID of the plan in Query Store |
544
544
545
-
<sup>1</sup> Use the [example Kusto query](#examples) to convert this value into a useable timestamp.
545
+
<sup>1</sup> To find matching queries and query plans in Query Store, see [Find matching queries and query plans in Query Store](#b-find-matching-queries-and-query-plans-in-query-store) later in this article.
546
+
547
+
<sup>2</sup> To convert this value into a useable timestamp, see [Convert the interval start and end times to datetime values](#a-convert-the-interval-start-and-end-times-to-datetime-values) later in this article.
546
548
547
549
For more information, see [sys.query_store_runtime_stats](/sql/relational-databases/system-catalog-views/sys-query-store-runtime-stats-transact-sql).
548
550
@@ -573,16 +575,18 @@ For more information, see [sys.query_store_runtime_stats](/sql/relational-databa
573
575
|`total_query_wait_time_ms_d`| Total wait time of the query on the specific wait category |
574
576
|`max_query_wait_time_ms_d`| Max wait time of the query in individual execution on the specific wait category |
575
577
|`query_param_type_d`| 0 |
576
-
|`query_hash_s`| Query hash in Query Store |
577
-
|`query_plan_hash_s`| Query plan hash in Query Store |
578
+
|`query_hash_s`<sup>1</sup> | Query hash in Query Store |
579
+
|`query_plan_hash_s`<sup>1</sup> | Query plan hash in Query Store |
578
580
|`statement_sql_handle_s`| Statement handle in Query Store |
579
-
|`interval_start_time_d` <sup>1</sup> | Internal identifier for the start of the statistics interval. |
580
-
|`interval_end_time_d` <sup>1</sup> | Internal identifier for the end of the statistics interval. |
581
+
|`interval_start_time_d` <sup>2</sup> | Internal identifier for the start of the statistics interval. |
582
+
|`interval_end_time_d` <sup>2</sup> | Internal identifier for the end of the statistics interval. |
581
583
|`count_executions_d`| Count of executions of the query |
582
584
|`query_id_d`| ID of the query in Query Store |
583
585
|`plan_id_d`| ID of the plan in Query Store |
584
586
585
-
<sup>1</sup> Use the [example Kusto query](#examples) to convert this value into a useable timestamp.
587
+
<sup>1</sup> To find matching queries and query plans in Query Store, see [Find matching queries and query plans in Query Store](#b-find-matching-queries-and-query-plans-in-query-store) later in this article.
588
+
589
+
<sup>2</sup> To convert this value into a useable timestamp, see [Convert the interval start and end times to datetime values](#a-convert-the-interval-start-and-end-times-to-datetime-values) later in this article.
586
590
587
591
For more information, see [sys.query_store_wait_stats](/sql/relational-databases/system-catalog-views/sys-query-store-wait-stats-transact-sql).
588
592
@@ -610,8 +614,10 @@ For more information, see [sys.query_store_wait_stats](/sql/relational-databases
610
614
|`error_number_d`| Error code |
611
615
|`Severity`| Severity of the error |
612
616
|`state_d`| State of the error |
613
-
|`query_hash_s`| Query hash of the failed query, if available |
614
-
|`query_plan_hash_s`| Query plan hash of the failed query, if available |
617
+
|`query_hash_s` <sup>1</sup> | Query hash of the failed query, if available |
618
+
|`query_plan_hash_s` <sup>1</sup> | Query plan hash of the failed query, if available |
619
+
620
+
<sup>1</sup> To find matching queries and query plans in Query Store, see [Find matching queries and query plans in Query Store](#b-find-matching-queries-and-query-plans-in-query-store) later in this article.
615
621
616
622
For more information, see [Database Engine events and errors](/sql/relational-databases/errors-events/database-engine-events-and-errors).
617
623
@@ -664,8 +670,10 @@ For more information about database wait statistics, see [sys.dm_os_wait_stats](
664
670
|`DatabaseName_s`| Name of the database |
665
671
|`ResourceId`| Resource URI |
666
672
|`error_state_d`| A numeric state value associated with the query timeout (an [attention](/sql/relational-databases/errors-events/mssqlserver-3617-database-engine-error) event) |
667
-
|`query_hash_s`| Query hash, if available |
668
-
|`query_plan_hash_s`| Query plan hash, if available |
673
+
|`query_hash_s` <sup>1</sup> | Query hash, if available |
674
+
|`query_plan_hash_s` <sup>1</sup> | Query plan hash, if available |
675
+
676
+
<sup>1</sup> To find matching queries and query plans in Query Store, see [Find matching queries and query plans in Query Store](#b-find-matching-queries-and-query-plans-in-query-store) later in this article.
669
677
670
678
#### Blockings dataset
671
679
@@ -742,21 +750,17 @@ For more information about database wait statistics, see [sys.dm_os_wait_stats](
742
750
|`Event_s`| Type of Automatic tuning event |
743
751
|`Timestamp_t`| Last updated timestamp |
744
752
745
-
The `query_hash_s` and `query_plan_hash_s` properties appear as numeric values. To find matching queries and query plans in [Monitor performance by using the Query Store](/sql/relational-databases/performance/monitoring-performance-by-using-the-query-store), use the following T-SQL expression. It converts numeric hash values to binary hash values used in [sys.query_store_query](/sql/relational-databases/system-catalog-views/sys-query-store-query-transact-sql) and [sys.query_store_plan](/sql/relational-databases/system-catalog-views/sys-query-store-plan-transact-sql):
746
753
747
-
```sql
748
-
SELECT CAST(CAST(hash_value asBIGINT) AS BINARY(8));
749
-
```
750
-
751
-
Replace the `hash_value` placeholder with the actual `query_hash_s` or `query_plan_hash_s` numeric value.
752
754
753
755
#### Intelligent Insights dataset
754
756
755
757
For more information, see [Use the Intelligent Insights performance diagnostics log of Azure SQL Database and Azure SQL Managed Instance performance issues](intelligent-insights-use-diagnostics-log.md).
756
758
757
759
## Examples
758
760
759
-
The following Kusto query converts the `interval_start_time_d` and `interval_end_time_d` columns in the [Query Store runtime statistics](#query-store-runtime-statistics) and [Query Store wait statistics](#query-store-wait-statistics) datasets from internal values into `datetime` values.
761
+
### A. Convert the interval start and end times to datetime values
762
+
763
+
The following Kusto expression converts the `interval_start_time_d` and `interval_end_time_d` columns in the [Query Store runtime statistics](#query-store-runtime-statistics) and [Query Store wait statistics](#query-store-wait-statistics) datasets from internal values into `datetime` values.
### B. Find matching queries and query plans in Query Store
775
+
776
+
The `query_hash_s` and `query_plan_hash_s` properties appear as numeric values in the Query Store [runtime](#query-store-runtime-statistics) and [wait](#query-store-wait-statistics) statistics, and the [Errors](#errors-dataset) and [Time-outs](#time-outs-dataset) datasets.
777
+
778
+
To find matching queries and query plans in [Query Store](/sql/relational-databases/performance/monitoring-performance-by-using-the-query-store), use the following T-SQL expression. It converts numeric hash values to binary hash values used in [sys.query_store_query](/sql/relational-databases/system-catalog-views/sys-query-store-query-transact-sql) and [sys.query_store_plan](/sql/relational-databases/system-catalog-views/sys-query-store-plan-transact-sql).
779
+
780
+
```sql
781
+
SELECT CAST(CAST(<hash_value>asBIGINT) AS BINARY(8));
782
+
```
783
+
784
+
Replace `<hash_value>` with the actual `query_hash_s` or `query_plan_hash_s` numeric value.
785
+
770
786
## Next steps
771
787
772
788
To learn how to enable logging and to understand the metrics and log categories supported by the various Azure services, see:
0 commit comments