---
display_name: Azure SQL Database
resource_type: Microsoft.Sql/servers/databases
metrics:
  - id: cpu_percent
    azure_name: cpu_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
      - aggregation: maximum
        kind: gauge
  - id: dtu_consumption_percent
    azure_name: dtu_consumption_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: sql_instance_cpu_percent
    azure_name: sql_instance_cpu_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: sql_instance_memory_percent
    azure_name: sql_instance_memory_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: physical_data_read_percent
    azure_name: physical_data_read_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: log_write_percent
    azure_name: log_write_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: workers_percent
    azure_name: workers_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: sessions_percent
    azure_name: sessions_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: sessions_count
    azure_name: sessions_count
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: availability
    azure_name: availability
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: connection_successful
    azure_name: connection_successful
    time_grain: PT1M
    series:
      - aggregation: total
        kind: counter
  - id: connection_failed
    azure_name: connection_failed
    time_grain: PT1M
    series:
      - aggregation: total
        kind: counter
  - id: connection_failed_user_error
    azure_name: connection_failed_user_error
    time_grain: PT1M
    series:
      - aggregation: total
        kind: counter
  - id: blocked_by_firewall
    azure_name: blocked_by_firewall
    time_grain: PT1M
    series:
      - aggregation: total
        kind: counter
  - id: deadlock
    azure_name: deadlock
    time_grain: PT1M
    series:
      - aggregation: total
        kind: counter
  - id: storage
    azure_name: storage
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: allocated_data_storage
    azure_name: allocated_data_storage
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: storage_percent
    azure_name: storage_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: xtp_storage_percent
    azure_name: xtp_storage_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: tempdb_data_size
    azure_name: tempdb_data_size
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: tempdb_log_size
    azure_name: tempdb_log_size
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: tempdb_log_used_percent
    azure_name: tempdb_log_used_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: cpu_used
    azure_name: cpu_used
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: cpu_limit
    azure_name: cpu_limit
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: dtu_used
    azure_name: dtu_used
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: dtu_limit
    azure_name: dtu_limit
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: replication_lag_seconds
    azure_name: replication_lag_seconds
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: app_cpu_percent
    azure_name: app_cpu_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: app_memory_percent
    azure_name: app_memory_percent
    time_grain: PT1M
    series:
      - aggregation: average
        kind: gauge
  - id: app_cpu_billed
    azure_name: app_cpu_billed
    time_grain: PT1M
    series:
      - aggregation: total
        kind: counter
  - id: app_cpu_billed_ha_replicas
    azure_name: app_cpu_billed_ha_replicas
    time_grain: PT1M
    series:
      - aggregation: total
        kind: counter
  - id: free_amount_consumed
    azure_name: free_amount_consumed
    time_grain: PT15M
    series:
      - aggregation: average
        kind: gauge
  - id: free_amount_remaining
    azure_name: free_amount_remaining
    time_grain: PT15M
    series:
      - aggregation: average
        kind: gauge
  - id: ledger_digest_upload_failed
    azure_name: ledger_digest_upload_failed
    time_grain: PT1M
    series:
      - aggregation: count
        kind: counter
  - id: ledger_digest_upload_success
    azure_name: ledger_digest_upload_success
    time_grain: PT1M
    series:
      - aggregation: count
        kind: counter
template:
  family: Azure SQL Database
  context_namespace: sql_database
  chart_defaults:
    label_promotion:
      - resource_name
      - resource_group
      - region
      - resource_type
      - profile
    instances:
      by_labels:
        - resource_uid
  charts:
    - id: am_azure_sql_database__cpu
      title: Azure SQL Database CPU Utilization
      context: cpu
      family: Utilization
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: cpu_percent_average
          name: average
        - selector: cpu_percent_maximum
          name: maximum
    - id: am_azure_sql_database__instance_cpu
      title: Azure SQL Database Instance CPU Utilization
      context: instance_cpu
      family: Utilization
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: sql_instance_cpu_percent_average
          name: average
    - id: am_azure_sql_database__instance_memory
      title: Azure SQL Database Instance Memory Utilization
      context: instance_memory
      family: Utilization
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: sql_instance_memory_percent_average
          name: average
    - id: am_azure_sql_database__dtu_consumption
      title: Azure SQL Database DTU Consumption
      context: dtu_consumption
      family: Utilization
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: dtu_consumption_percent_average
          name: average
    - id: am_azure_sql_database__io_utilization
      title: Azure SQL Database I/O Utilization
      context: io_utilization
      family: IO
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: physical_data_read_percent_average
          name: data_read
        - selector: log_write_percent_average
          name: log_write
    - id: am_azure_sql_database__resource_utilization
      title: Azure SQL Database Resource Utilization
      context: resource_utilization
      family: Utilization
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: workers_percent_average
          name: workers
        - selector: sessions_percent_average
          name: sessions
    - id: am_azure_sql_database__availability
      title: Azure SQL Database Availability
      context: availability
      family: Availability
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: availability_average
          name: average
    - id: am_azure_sql_database__connections
      title: Azure SQL Database Connection Events
      context: connections
      family: Connections
      type: line
      units: connections/s
      algorithm: incremental
      dimensions:
        - selector: connection_successful_total
          name: successful
        - selector: connection_failed_total
          name: failed_system
        - selector: connection_failed_user_error_total
          name: failed_user
        - selector: blocked_by_firewall_total
          name: firewall_blocked
    - id: am_azure_sql_database__deadlocks
      title: Azure SQL Database Deadlocks
      context: deadlocks
      family: Locking
      type: line
      units: deadlocks/s
      algorithm: incremental
      dimensions:
        - selector: deadlock_total
          name: total
    - id: am_azure_sql_database__storage
      title: Azure SQL Database Storage
      context: storage
      family: Storage
      type: line
      units: bytes
      algorithm: absolute
      dimensions:
        - selector: storage_average
          name: used
        - selector: allocated_data_storage_average
          name: allocated
    - id: am_azure_sql_database__storage_utilization
      title: Azure SQL Database Storage Utilization
      context: storage_utilization
      family: Storage
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: storage_percent_average
          name: average
    - id: am_azure_sql_database__tempdb_size
      title: Azure SQL Database Tempdb Size
      context: tempdb_size
      family: Tempdb
      type: line
      units: KiB
      algorithm: absolute
      dimensions:
        - selector: tempdb_data_size_average
          name: data
        - selector: tempdb_log_size_average
          name: log
    - id: am_azure_sql_database__tempdb_log_utilization
      title: Azure SQL Database Tempdb Log Utilization
      context: tempdb_log_utilization
      family: Tempdb
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: tempdb_log_used_percent_average
          name: average
    - id: am_azure_sql_database__vcore_usage
      title: Azure SQL Database vCore Usage
      context: vcore_usage
      family: Capacity
      type: line
      units: vCores
      algorithm: absolute
      dimensions:
        - selector: cpu_used_average
          name: used
        - selector: cpu_limit_average
          name: limit
    - id: am_azure_sql_database__dtu_usage
      title: Azure SQL Database DTU Usage
      context: dtu_usage
      family: Capacity
      type: line
      units: DTU
      algorithm: absolute
      dimensions:
        - selector: dtu_used_average
          name: used
        - selector: dtu_limit_average
          name: limit
    - id: am_azure_sql_database__sessions_count
      title: Azure SQL Database Sessions Count
      context: sessions_count
      family: Capacity
      type: line
      units: sessions
      algorithm: absolute
      dimensions:
        - selector: sessions_count_average
          name: average
    - id: am_azure_sql_database__replication_lag
      title: Azure SQL Database Replication Lag
      context: replication_lag
      family: Replication
      type: line
      units: seconds
      algorithm: absolute
      dimensions:
        - selector: replication_lag_seconds_average
          name: average
    - id: am_azure_sql_database__xtp_storage
      title: Azure SQL Database In-Memory OLTP Storage
      context: xtp_storage
      family: In-Memory OLTP
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: xtp_storage_percent_average
          name: average
    - id: am_azure_sql_database__serverless_utilization
      title: Azure SQL Database Serverless Utilization
      context: serverless_utilization
      family: Serverless
      type: line
      units: percentage
      algorithm: absolute
      dimensions:
        - selector: app_cpu_percent_average
          name: cpu
        - selector: app_memory_percent_average
          name: memory
    - id: am_azure_sql_database__serverless_billing
      title: Azure SQL Database Serverless Billing
      context: serverless_billing
      family: Serverless
      type: line
      units: vCore-seconds/s
      algorithm: incremental
      dimensions:
        - selector: app_cpu_billed_total
          name: total
        - selector: app_cpu_billed_ha_replicas_total
          name: ha_replicas
    - id: am_azure_sql_database__free_tier_usage
      title: Azure SQL Database Free Tier Usage
      context: free_tier_usage
      family: Free Tier
      type: line
      units: vCore-seconds
      algorithm: absolute
      dimensions:
        - selector: free_amount_consumed_average
          name: consumed
        - selector: free_amount_remaining_average
          name: remaining
    - id: am_azure_sql_database__ledger_digest
      title: Azure SQL Database Ledger Digest Uploads
      context: ledger_digest
      family: Ledger
      type: line
      units: events/s
      algorithm: incremental
      dimensions:
        - selector: ledger_digest_upload_success_count
          name: success
        - selector: ledger_digest_upload_failed_count
          name: failed
