mirror of
https://github.com/SigNoz/signoz.git
synced 2026-06-11 19:30:31 +01:00
Compare commits
2 Commits
issue_5324
...
nv/functio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68da3b2beb | ||
|
|
5574e08ddc |
@@ -1364,7 +1364,6 @@ components:
|
||||
- appservice
|
||||
- containerapp
|
||||
- aks
|
||||
- sqldatabase
|
||||
type: string
|
||||
CloudintegrationtypesServiceMetadata:
|
||||
properties:
|
||||
|
||||
@@ -2655,7 +2655,6 @@ export enum CloudintegrationtypesServiceIDDTO {
|
||||
appservice = 'appservice',
|
||||
containerapp = 'containerapp',
|
||||
aks = 'aks',
|
||||
sqldatabase = 'sqldatabase',
|
||||
}
|
||||
export type CloudintegrationtypesCloudIntegrationServiceDTOAnyOf = {
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18"><defs><linearGradient id="f67d1585-6164-4ad0-b2dd-f9cc59b2969f" x1="9.908" y1="15.943" x2="7.516" y2="2.383" gradientUnits="userSpaceOnUse"><stop offset="0.15" stop-color="#0078d4"/><stop offset="0.8" stop-color="#5ea0ef"/><stop offset="1" stop-color="#83b9f9"/></linearGradient></defs><g id="a4fd1868-54fe-4ca6-8ff6-3b01866dc27b"><path d="M14.49,7.15A5.147,5.147,0,0,0,9.24,2.164,5.272,5.272,0,0,0,4.216,5.653,4.869,4.869,0,0,0,0,10.4a4.946,4.946,0,0,0,5.068,4.814H13.82A4.292,4.292,0,0,0,18,11.127,4.105,4.105,0,0,0,14.49,7.15Z" fill="url(#f67d1585-6164-4ad0-b2dd-f9cc59b2969f)"/><path d="M12.9,11.4V8H12v4.13h2.46V11.4ZM5.76,9.73a1.825,1.825,0,0,1-.51-.31.441.441,0,0,1-.12-.32.342.342,0,0,1,.15-.3.683.683,0,0,1,.42-.12,1.62,1.62,0,0,1,1,.29V8.11a2.58,2.58,0,0,0-1-.16,1.641,1.641,0,0,0-1.09.34,1.08,1.08,0,0,0-.42.89c0,.51.32.91,1,1.21a2.907,2.907,0,0,1,.62.36.419.419,0,0,1,.15.32.381.381,0,0,1-.16.31.806.806,0,0,1-.45.11,1.66,1.66,0,0,1-1.09-.42V12a2.173,2.173,0,0,0,1.07.24,1.877,1.877,0,0,0,1.18-.33A1.08,1.08,0,0,0,6.84,11a1.048,1.048,0,0,0-.25-.7A2.425,2.425,0,0,0,5.76,9.73ZM11,11.32A2.191,2.191,0,0,0,11,9a1.808,1.808,0,0,0-.7-.75,2,2,0,0,0-1-.26,2.112,2.112,0,0,0-1.08.27A1.856,1.856,0,0,0,7.49,9a2.465,2.465,0,0,0-.26,1.14,2.256,2.256,0,0,0,.24,1,1.766,1.766,0,0,0,.69.74,2.056,2.056,0,0,0,1,.3l.86,1h1.21L10,12.08A1.79,1.79,0,0,0,11,11.32Zm-1-.25a.941.941,0,0,1-.76.35.916.916,0,0,1-.76-.36,1.523,1.523,0,0,1-.29-1,1.529,1.529,0,0,1,.29-1,1,1,0,0,1,.78-.37.869.869,0,0,1,.75.37,1.619,1.619,0,0,1,.27,1A1.459,1.459,0,0,1,10,11.07Z" fill="#f2f2f2"/></g></svg>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -1,565 +0,0 @@
|
||||
{
|
||||
"id": "sqldatabase",
|
||||
"title": "Azure SQL Database",
|
||||
"icon": "file://icon.svg",
|
||||
"overview": "file://overview.md",
|
||||
"supportedSignals": {
|
||||
"metrics": true,
|
||||
"logs": true
|
||||
},
|
||||
"dataCollected": {
|
||||
"metrics": [
|
||||
{
|
||||
"name": "azure_cpu_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Percentage of CPU used by the database workload, relative to its limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_cpu_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Percentage of CPU used by the database workload, relative to its limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_cpu_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Percentage of CPU used by the database workload, relative to its limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_sql_instance_cpu_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Total CPU usage (user plus system) of the SQL instance, as a percentage."
|
||||
},
|
||||
{
|
||||
"name": "azure_sql_instance_cpu_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Total CPU usage (user plus system) of the SQL instance, as a percentage."
|
||||
},
|
||||
{
|
||||
"name": "azure_sql_instance_cpu_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Total CPU usage (user plus system) of the SQL instance, as a percentage."
|
||||
},
|
||||
{
|
||||
"name": "azure_sql_instance_memory_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Memory usage of the SQL instance, as a percentage of its limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_sql_instance_memory_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Memory usage of the SQL instance, as a percentage of its limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_sql_instance_memory_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Memory usage of the SQL instance, as a percentage of its limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_physical_data_read_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Data file IO usage as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_physical_data_read_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Data file IO usage as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_physical_data_read_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Data file IO usage as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_log_write_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Transaction log write throughput as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_log_write_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Transaction log write throughput as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_log_write_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Transaction log write throughput as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_workers_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Worker threads in use as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_workers_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Worker threads in use as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_workers_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Worker threads in use as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_sessions_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Active sessions as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_sessions_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Active sessions as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_sessions_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Active sessions as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_sessions_count_average",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Number of active sessions."
|
||||
},
|
||||
{
|
||||
"name": "azure_sessions_count_maximum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Number of active sessions."
|
||||
},
|
||||
{
|
||||
"name": "azure_sessions_count_minimum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Number of active sessions."
|
||||
},
|
||||
{
|
||||
"name": "azure_dtu_consumption_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "DTU consumption as a percentage of the limit (DTU-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_dtu_consumption_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "DTU consumption as a percentage of the limit (DTU-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_dtu_consumption_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "DTU consumption as a percentage of the limit (DTU-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_dtu_used_average",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "DTUs used (DTU-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_dtu_used_maximum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "DTUs used (DTU-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_dtu_used_minimum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "DTUs used (DTU-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_dtu_limit_average",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "DTU limit (DTU-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_dtu_limit_maximum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "DTU limit (DTU-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_dtu_limit_minimum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "DTU limit (DTU-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_cpu_used_average",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "vCores used (vCore-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_cpu_used_maximum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "vCores used (vCore-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_cpu_used_minimum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "vCores used (vCore-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_cpu_limit_average",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "vCore limit (vCore-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_cpu_limit_maximum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "vCore limit (vCore-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_cpu_limit_minimum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "vCore limit (vCore-based purchasing model)."
|
||||
},
|
||||
{
|
||||
"name": "azure_storage_average",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Data space used by the database."
|
||||
},
|
||||
{
|
||||
"name": "azure_storage_maximum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Data space used by the database."
|
||||
},
|
||||
{
|
||||
"name": "azure_storage_minimum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Data space used by the database."
|
||||
},
|
||||
{
|
||||
"name": "azure_storage_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Data space used as a percentage of the maximum data size."
|
||||
},
|
||||
{
|
||||
"name": "azure_storage_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Data space used as a percentage of the maximum data size."
|
||||
},
|
||||
{
|
||||
"name": "azure_storage_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Data space used as a percentage of the maximum data size."
|
||||
},
|
||||
{
|
||||
"name": "azure_allocated_data_storage_average",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Data space allocated to the database (includes unused space)."
|
||||
},
|
||||
{
|
||||
"name": "azure_allocated_data_storage_maximum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Data space allocated to the database (includes unused space)."
|
||||
},
|
||||
{
|
||||
"name": "azure_allocated_data_storage_minimum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Data space allocated to the database (includes unused space)."
|
||||
},
|
||||
{
|
||||
"name": "azure_xtp_storage_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "In-Memory OLTP storage used as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_xtp_storage_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "In-Memory OLTP storage used as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_xtp_storage_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "In-Memory OLTP storage used as a percentage of the limit."
|
||||
},
|
||||
{
|
||||
"name": "azure_full_backup_size_bytes_average",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Cumulative full backup storage size."
|
||||
},
|
||||
{
|
||||
"name": "azure_full_backup_size_bytes_maximum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Cumulative full backup storage size."
|
||||
},
|
||||
{
|
||||
"name": "azure_full_backup_size_bytes_minimum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Cumulative full backup storage size."
|
||||
},
|
||||
{
|
||||
"name": "azure_diff_backup_size_bytes_average",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Cumulative differential backup storage size."
|
||||
},
|
||||
{
|
||||
"name": "azure_diff_backup_size_bytes_maximum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Cumulative differential backup storage size."
|
||||
},
|
||||
{
|
||||
"name": "azure_diff_backup_size_bytes_minimum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Cumulative differential backup storage size."
|
||||
},
|
||||
{
|
||||
"name": "azure_log_backup_size_bytes_average",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Cumulative transaction log backup storage size."
|
||||
},
|
||||
{
|
||||
"name": "azure_log_backup_size_bytes_maximum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Cumulative transaction log backup storage size."
|
||||
},
|
||||
{
|
||||
"name": "azure_log_backup_size_bytes_minimum",
|
||||
"unit": "Bytes",
|
||||
"type": "Gauge",
|
||||
"description": "Cumulative transaction log backup storage size."
|
||||
},
|
||||
{
|
||||
"name": "azure_replication_lag_seconds_average",
|
||||
"unit": "Seconds",
|
||||
"type": "Gauge",
|
||||
"description": "Geo-replication lag (RPO) in seconds; reported on the primary database only."
|
||||
},
|
||||
{
|
||||
"name": "azure_replication_lag_seconds_maximum",
|
||||
"unit": "Seconds",
|
||||
"type": "Gauge",
|
||||
"description": "Geo-replication lag (RPO) in seconds; reported on the primary database only."
|
||||
},
|
||||
{
|
||||
"name": "azure_replication_lag_seconds_minimum",
|
||||
"unit": "Seconds",
|
||||
"type": "Gauge",
|
||||
"description": "Geo-replication lag (RPO) in seconds; reported on the primary database only."
|
||||
},
|
||||
{
|
||||
"name": "azure_connection_successful_total",
|
||||
"unit": "Count",
|
||||
"type": "Sum",
|
||||
"description": "Number of successful connections."
|
||||
},
|
||||
{
|
||||
"name": "azure_connection_successful_count",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Number of successful connections."
|
||||
},
|
||||
{
|
||||
"name": "azure_connection_failed_total",
|
||||
"unit": "Count",
|
||||
"type": "Sum",
|
||||
"description": "Number of failed connections caused by system errors."
|
||||
},
|
||||
{
|
||||
"name": "azure_connection_failed_count",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Number of failed connections caused by system errors."
|
||||
},
|
||||
{
|
||||
"name": "azure_connection_failed_user_error_total",
|
||||
"unit": "Count",
|
||||
"type": "Sum",
|
||||
"description": "Number of failed connections caused by user errors."
|
||||
},
|
||||
{
|
||||
"name": "azure_connection_failed_user_error_count",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Number of failed connections caused by user errors."
|
||||
},
|
||||
{
|
||||
"name": "azure_blocked_by_firewall_total",
|
||||
"unit": "Count",
|
||||
"type": "Sum",
|
||||
"description": "Number of connection attempts blocked by the firewall."
|
||||
},
|
||||
{
|
||||
"name": "azure_blocked_by_firewall_count",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Number of connection attempts blocked by the firewall."
|
||||
},
|
||||
{
|
||||
"name": "azure_deadlock_total",
|
||||
"unit": "Count",
|
||||
"type": "Sum",
|
||||
"description": "Number of deadlocks."
|
||||
},
|
||||
{
|
||||
"name": "azure_deadlock_count",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Number of deadlocks."
|
||||
},
|
||||
{
|
||||
"name": "azure_availability_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Database availability percentage (100 if connections succeed, 0 if all fail) per minute."
|
||||
},
|
||||
{
|
||||
"name": "azure_availability_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Database availability percentage (100 if connections succeed, 0 if all fail) per minute."
|
||||
},
|
||||
{
|
||||
"name": "azure_availability_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Database availability percentage (100 if connections succeed, 0 if all fail) per minute."
|
||||
},
|
||||
{
|
||||
"name": "azure_availability_count",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "Database availability percentage (100 if connections succeed, 0 if all fail) per minute."
|
||||
},
|
||||
{
|
||||
"name": "azure_availability_total",
|
||||
"unit": "Percent",
|
||||
"type": "Sum",
|
||||
"description": "Database availability percentage (100 if connections succeed, 0 if all fail) per minute."
|
||||
},
|
||||
{
|
||||
"name": "azure_tempdb_data_size_average",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Space used in tempdb data files, in kilobytes."
|
||||
},
|
||||
{
|
||||
"name": "azure_tempdb_data_size_maximum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Space used in tempdb data files, in kilobytes."
|
||||
},
|
||||
{
|
||||
"name": "azure_tempdb_data_size_minimum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Space used in tempdb data files, in kilobytes."
|
||||
},
|
||||
{
|
||||
"name": "azure_tempdb_log_size_average",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Space used in the tempdb transaction log file, in kilobytes."
|
||||
},
|
||||
{
|
||||
"name": "azure_tempdb_log_size_maximum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Space used in the tempdb transaction log file, in kilobytes."
|
||||
},
|
||||
{
|
||||
"name": "azure_tempdb_log_size_minimum",
|
||||
"unit": "Count",
|
||||
"type": "Gauge",
|
||||
"description": "Space used in the tempdb transaction log file, in kilobytes."
|
||||
},
|
||||
{
|
||||
"name": "azure_tempdb_log_used_percent_average",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "tempdb transaction log space used as a percentage."
|
||||
},
|
||||
{
|
||||
"name": "azure_tempdb_log_used_percent_maximum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "tempdb transaction log space used as a percentage."
|
||||
},
|
||||
{
|
||||
"name": "azure_tempdb_log_used_percent_minimum",
|
||||
"unit": "Percent",
|
||||
"type": "Gauge",
|
||||
"description": "tempdb transaction log space used as a percentage."
|
||||
}
|
||||
],
|
||||
"logs": [
|
||||
{
|
||||
"name": "Resource ID",
|
||||
"path": "resources.azure.resource.id",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"telemetryCollectionStrategy": {
|
||||
"azure": {
|
||||
"resourceProvider": "Microsoft.Sql",
|
||||
"resourceType": "servers/databases",
|
||||
"metrics": {},
|
||||
"logs": {
|
||||
"categoryGroups": [
|
||||
"allLogs"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"assets": {
|
||||
"dashboards": [
|
||||
{
|
||||
"id": "overview",
|
||||
"title": "Azure SQL Database Overview",
|
||||
"description": "Overview of Azure SQL Database metrics",
|
||||
"definition": "file://assets/dashboards/overview.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
### Monitor Azure SQL Database with SigNoz
|
||||
|
||||
Collect key Azure SQL Database (single database) metrics and view them with an out of the box dashboard.
|
||||
|
||||
This integration collects platform metrics for the `Microsoft.Sql/servers/databases` resource type.
|
||||
|
||||
Note: This integration is for Azure SQL Database (the PaaS offering). Azure SQL Managed Instance and SQL Server on Azure VMs expose a different set of metrics and are not covered here.
|
||||
@@ -1,6 +1,8 @@
|
||||
package sqlschema
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hash/fnv"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
@@ -49,9 +51,23 @@ type Index interface {
|
||||
ToDropSQL(fmter SQLFormatter) []byte
|
||||
}
|
||||
|
||||
// UniqueIndex models a unique index on a table.
|
||||
//
|
||||
// In the common case the index keys on plain columns: set only ColumnNames and
|
||||
// the SQL is emitted with each column identifier-quoted by the formatter
|
||||
// (`CREATE UNIQUE INDEX uq_t_a_b ON t (a, b)`).
|
||||
//
|
||||
// For functional indexes (e.g. case-insensitive uniqueness on `LOWER(col)`),
|
||||
// set Expressions to the raw SQL parts and use ColumnNames as metadata for
|
||||
// "which columns does this index touch". When Expressions is non-empty, it
|
||||
// overrides ColumnNames for SQL emission — each entry is written verbatim, so
|
||||
// the caller owns well-formedness — and the auto-generated name uses a hash
|
||||
// suffix instead of a readable column join because expressions aren't valid
|
||||
// identifier fragments.
|
||||
type UniqueIndex struct {
|
||||
TableName TableName
|
||||
ColumnNames []ColumnName
|
||||
Expressions []string
|
||||
name string
|
||||
}
|
||||
|
||||
@@ -71,16 +87,28 @@ func (index *UniqueIndex) Name() string {
|
||||
}
|
||||
b.WriteString(string(column))
|
||||
}
|
||||
|
||||
if len(index.Expressions) > 0 {
|
||||
if len(index.ColumnNames) > 0 {
|
||||
b.WriteString("_")
|
||||
}
|
||||
hasher := fnv.New32a()
|
||||
_, _ = hasher.Write([]byte(strings.Join(index.Expressions, "\x00")))
|
||||
fmt.Fprintf(&b, "%08x", hasher.Sum32())
|
||||
}
|
||||
return b.String()
|
||||
}
|
||||
|
||||
func (index *UniqueIndex) Named(name string) Index {
|
||||
copyOfColumnNames := make([]ColumnName, len(index.ColumnNames))
|
||||
copy(copyOfColumnNames, index.ColumnNames)
|
||||
copyOfExpressions := make([]string, len(index.Expressions))
|
||||
copy(copyOfExpressions, index.Expressions)
|
||||
|
||||
return &UniqueIndex{
|
||||
TableName: index.TableName,
|
||||
ColumnNames: copyOfColumnNames,
|
||||
Expressions: copyOfExpressions,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
@@ -101,7 +129,18 @@ func (index *UniqueIndex) Equals(other Index) bool {
|
||||
if other.Type() != IndexTypeUnique {
|
||||
return false
|
||||
}
|
||||
|
||||
otherUnique, ok := other.(*UniqueIndex)
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
// Plain and functional indexes produce different SQL even if their column
|
||||
// sets overlap; require both shapes to match.
|
||||
if (len(index.Expressions) == 0) != (len(otherUnique.Expressions) == 0) {
|
||||
return false
|
||||
}
|
||||
if len(index.Expressions) > 0 && !slices.Equal(index.Expressions, otherUnique.Expressions) {
|
||||
return false
|
||||
}
|
||||
return index.Name() == other.Name() && slices.Equal(index.Columns(), other.Columns())
|
||||
}
|
||||
|
||||
@@ -114,12 +153,20 @@ func (index *UniqueIndex) ToCreateSQL(fmter SQLFormatter) []byte {
|
||||
sql = fmter.AppendIdent(sql, string(index.TableName))
|
||||
sql = append(sql, " ("...)
|
||||
|
||||
for i, column := range index.ColumnNames {
|
||||
if i > 0 {
|
||||
sql = append(sql, ", "...)
|
||||
if len(index.Expressions) > 0 {
|
||||
for i, expr := range index.Expressions {
|
||||
if i > 0 {
|
||||
sql = append(sql, ", "...)
|
||||
}
|
||||
sql = append(sql, expr...)
|
||||
}
|
||||
} else {
|
||||
for i, column := range index.ColumnNames {
|
||||
if i > 0 {
|
||||
sql = append(sql, ", "...)
|
||||
}
|
||||
sql = fmter.AppendIdent(sql, string(column))
|
||||
}
|
||||
|
||||
sql = fmter.AppendIdent(sql, string(column))
|
||||
}
|
||||
|
||||
sql = append(sql, ")"...)
|
||||
|
||||
@@ -38,6 +38,43 @@ func TestIndexToCreateSQL(t *testing.T) {
|
||||
},
|
||||
sql: `CREATE UNIQUE INDEX IF NOT EXISTS "my_index" ON "users" ("id", "name", "email")`,
|
||||
},
|
||||
{
|
||||
name: "Unique_Functional_SingleExpression",
|
||||
index: &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"email"},
|
||||
Expressions: []string{"LOWER(email)"},
|
||||
},
|
||||
sql: `CREATE UNIQUE INDEX IF NOT EXISTS "uq_users_email_1e5a87f1" ON "users" (LOWER(email))`,
|
||||
},
|
||||
{
|
||||
name: "Unique_Functional_MixedColumnsAndExpressions",
|
||||
index: &UniqueIndex{
|
||||
TableName: "tag",
|
||||
ColumnNames: []ColumnName{"org_id", "kind", "key", "value"},
|
||||
Expressions: []string{"org_id", "kind", "LOWER(key)", "LOWER(value)"},
|
||||
},
|
||||
sql: `CREATE UNIQUE INDEX IF NOT EXISTS "uq_tag_org_id_kind_key_value_57e8f81f" ON "tag" (org_id, kind, LOWER(key), LOWER(value))`,
|
||||
},
|
||||
{
|
||||
name: "Unique_Functional_ComplexExpression",
|
||||
index: &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"first_name", "last_name"},
|
||||
Expressions: []string{"LOWER(TRIM(first_name) || ' ' || TRIM(last_name))"},
|
||||
},
|
||||
sql: `CREATE UNIQUE INDEX IF NOT EXISTS "uq_users_first_name_last_name_adb1ff53" ON "users" (LOWER(TRIM(first_name) || ' ' || TRIM(last_name)))`,
|
||||
},
|
||||
{
|
||||
name: "Unique_Functional_Named",
|
||||
index: &UniqueIndex{
|
||||
TableName: "tag",
|
||||
ColumnNames: []ColumnName{"org_id", "kind", "key", "value"},
|
||||
Expressions: []string{"org_id", "kind", "LOWER(key)", "LOWER(value)"},
|
||||
name: "uq_tag_org_kind_lower_key_lower_value",
|
||||
},
|
||||
sql: `CREATE UNIQUE INDEX IF NOT EXISTS "uq_tag_org_kind_lower_key_lower_value" ON "tag" (org_id, kind, LOWER(key), LOWER(value))`,
|
||||
},
|
||||
{
|
||||
name: "PartialUnique_1Column",
|
||||
index: &PartialUniqueIndex{
|
||||
@@ -229,6 +266,47 @@ func TestIndexEquals(t *testing.T) {
|
||||
},
|
||||
equals: false,
|
||||
},
|
||||
{
|
||||
name: "Unique_Functional_Same",
|
||||
a: &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"email"},
|
||||
Expressions: []string{"LOWER(email)"},
|
||||
},
|
||||
b: &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"email"},
|
||||
Expressions: []string{"LOWER(email)"},
|
||||
},
|
||||
equals: true,
|
||||
},
|
||||
{
|
||||
name: "Unique_Functional_DifferentExpressions",
|
||||
a: &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"email"},
|
||||
Expressions: []string{"LOWER(email)"},
|
||||
},
|
||||
b: &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"email"},
|
||||
Expressions: []string{"UPPER(email)"},
|
||||
},
|
||||
equals: false,
|
||||
},
|
||||
{
|
||||
name: "Unique_Functional_NotEqualToPlainSameColumns",
|
||||
a: &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"email"},
|
||||
Expressions: []string{"LOWER(email)"},
|
||||
},
|
||||
b: &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"email"},
|
||||
},
|
||||
equals: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
@@ -238,6 +316,75 @@ func TestIndexEquals(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestUniqueIndexFunctionalName(t *testing.T) {
|
||||
t.Run("autogen uses uq_<table>_<hash>", func(t *testing.T) {
|
||||
idx := &UniqueIndex{
|
||||
TableName: "tag",
|
||||
ColumnNames: []ColumnName{"org_id", "kind", "key", "value"},
|
||||
Expressions: []string{"org_id", "kind", "LOWER(key)", "LOWER(value)"},
|
||||
}
|
||||
assert.Equal(t, "uq_tag_org_id_kind_key_value_57e8f81f", idx.Name())
|
||||
})
|
||||
|
||||
t.Run("same expressions produce the same name", func(t *testing.T) {
|
||||
a := &UniqueIndex{
|
||||
TableName: "users",
|
||||
Expressions: []string{"LOWER(email)"},
|
||||
}
|
||||
b := &UniqueIndex{
|
||||
TableName: "users",
|
||||
Expressions: []string{"LOWER(email)"},
|
||||
}
|
||||
assert.Equal(t, a.Name(), b.Name())
|
||||
})
|
||||
|
||||
t.Run("different expressions produce different names", func(t *testing.T) {
|
||||
a := &UniqueIndex{
|
||||
TableName: "users",
|
||||
Expressions: []string{"LOWER(email)"},
|
||||
}
|
||||
b := &UniqueIndex{
|
||||
TableName: "users",
|
||||
Expressions: []string{"UPPER(email)"},
|
||||
}
|
||||
assert.NotEqual(t, a.Name(), b.Name())
|
||||
})
|
||||
|
||||
t.Run("expressions in different order produce different names", func(t *testing.T) {
|
||||
a := &UniqueIndex{
|
||||
TableName: "tag",
|
||||
Expressions: []string{"org_id", "LOWER(key)"},
|
||||
}
|
||||
b := &UniqueIndex{
|
||||
TableName: "tag",
|
||||
Expressions: []string{"LOWER(key)", "org_id"},
|
||||
}
|
||||
assert.NotEqual(t, a.Name(), b.Name())
|
||||
})
|
||||
|
||||
t.Run("functional autogen differs from plain autogen for same columns", func(t *testing.T) {
|
||||
plain := &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"email"},
|
||||
}
|
||||
functional := &UniqueIndex{
|
||||
TableName: "users",
|
||||
ColumnNames: []ColumnName{"email"},
|
||||
Expressions: []string{"LOWER(email)"},
|
||||
}
|
||||
assert.Equal(t, "uq_users_email", plain.Name())
|
||||
assert.NotEqual(t, plain.Name(), functional.Name())
|
||||
})
|
||||
|
||||
t.Run("Named() override wins over hash", func(t *testing.T) {
|
||||
idx := (&UniqueIndex{
|
||||
TableName: "tag",
|
||||
Expressions: []string{"org_id", "LOWER(key)"},
|
||||
}).Named("my_functional_index")
|
||||
assert.Equal(t, "my_functional_index", idx.Name())
|
||||
})
|
||||
}
|
||||
|
||||
func TestPartialUniqueIndexName(t *testing.T) {
|
||||
a := &PartialUniqueIndex{
|
||||
TableName: "users",
|
||||
|
||||
@@ -31,7 +31,6 @@ var (
|
||||
AzureServiceAppService = ServiceID{valuer.NewString("appservice")}
|
||||
AzureServiceContainerApp = ServiceID{valuer.NewString("containerapp")}
|
||||
AzureServiceAKS = ServiceID{valuer.NewString("aks")}
|
||||
AzureServiceSQLDatabase = ServiceID{valuer.NewString("sqldatabase")}
|
||||
)
|
||||
|
||||
func (ServiceID) Enum() []any {
|
||||
@@ -55,7 +54,6 @@ func (ServiceID) Enum() []any {
|
||||
AzureServiceAppService,
|
||||
AzureServiceContainerApp,
|
||||
AzureServiceAKS,
|
||||
AzureServiceSQLDatabase,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +81,6 @@ var SupportedServices = map[CloudProviderType][]ServiceID{
|
||||
AzureServiceAppService,
|
||||
AzureServiceContainerApp,
|
||||
AzureServiceAKS,
|
||||
AzureServiceSQLDatabase,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user