forked from elastic/integrations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[O11y][MSSQL] Add optional mssql.query field to
performance
data st…
…ream for debugging purposes (elastic#12212) * Remove unnecessary processor in performance data stream * add changelog entry * added debug flag that can preserve mssql.query field when enabled * Update packages/microsoft_sqlserver/data_stream/performance/manifest.yml Co-authored-by: Lalit Satapathy <69236064+lalit-satapathy@users.noreply.github.com> * update tag name * minor change in pipeline and system tests * minor change in tag description * address review comments --------- Co-authored-by: Lalit Satapathy <69236064+lalit-satapathy@users.noreply.github.com>
- Loading branch information
1 parent
767b182
commit 273355f
Showing
12 changed files
with
300 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...ges/microsoft_sqlserver/data_stream/performance/_dev/test/pipeline/test-common-config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fields: | ||
tags: | ||
- preserve_sql_queries |
71 changes: 71 additions & 0 deletions
71
...ages/microsoft_sqlserver/data_stream/performance/_dev/test/pipeline/test-performance.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"events": [ | ||
{ | ||
"@timestamp": "2024-12-30T10:34:25.697Z", | ||
"metricset": { | ||
"name": "query", | ||
"period": 10000 | ||
}, | ||
"ecs": { | ||
"version": "8.11.0" | ||
}, | ||
"host": { | ||
"name": "localhost" | ||
}, | ||
"agent": { | ||
"version": "8.13.0", | ||
"ephemeral_id": "70a3cef1-ba97-481f-95df-7c36355408c6", | ||
"id": "90dfcb72-653c-4ce1-b473-98969e1f308c", | ||
"name": "localhost", | ||
"type": "metricbeat" | ||
}, | ||
"service": { | ||
"address": "localhost:32782", | ||
"type": "sql" | ||
}, | ||
"sql": { | ||
"metrics": { | ||
"page_splits_per_sec": 1192, | ||
"transactions": 0, | ||
"compilations_per_sec": 115026, | ||
"buffer_checkpoint_pages_per_sec": 516, | ||
"buffer_target_pages": 1196032, | ||
"buffer_database_pages": 2940, | ||
"logouts_per_sec": 71268, | ||
"active_temp_tables": 0, | ||
"lock_waits_per_sec": 2, | ||
"batch_requests_per_sec": 455338, | ||
"user_connections": 2, | ||
"server_name": "f8ca37b1f01d", | ||
"logins_per_sec": 71270, | ||
"instance_name": "MSSQLSERVER", | ||
"buffer_cache_hit_ratio": 74, | ||
"connection_reset_per_sec": 274901, | ||
"buffer_page_life_expectancy": 529720, | ||
"re_compilations_per_sec": 400 | ||
}, | ||
"driver": "mssql", | ||
"query": [ | ||
"SELECT @@servername AS server_name, @@servicename AS instance_name;", | ||
"SELECT cntr_value As 'active_temp_tables' FROM sys.dm_os_performance_counters WHERE counter_name = 'Active Temp Tables' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'batch_requests_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Batch Requests/sec'", | ||
"SELECT cntr_value As 'buffer_cache_hit_ratio' FROM sys.dm_os_performance_counters WHERE counter_name = 'Buffer cache hit ratio' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'buffer_checkpoint_pages_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Checkpoint pages/sec' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'buffer_database_pages' FROM sys.dm_os_performance_counters WHERE counter_name = 'Database pages' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'buffer_page_life_expectancy' FROM sys.dm_os_performance_counters WHERE counter_name = 'Page life expectancy' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'buffer_target_pages' FROM sys.dm_os_performance_counters WHERE counter_name = 'Target pages' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'compilations_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'SQL Compilations/sec'", | ||
"SELECT cntr_value As 'connection_reset_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Connection Reset/sec' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'lock_waits_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Lock Waits/sec' AND instance_name = '_Total'", | ||
"SELECT cntr_value As 'logins_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Logins/sec' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'logouts_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Logouts/sec' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'page_splits_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Page splits/sec'", | ||
"SELECT cntr_value As 're_compilations_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'SQL Re-Compilations/sec'", | ||
"SELECT cntr_value As 'transactions' FROM sys.dm_os_performance_counters WHERE counter_name = 'Transactions' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'user_connections' FROM sys.dm_os_performance_counters WHERE counter_name= 'User Connections'", | ||
"SELECT counter_name, cntr_value FROM sys.dm_os_performance_counters WHERE counter_name like 'Memory Grants Pend%'" | ||
] | ||
} | ||
} | ||
] | ||
} |
73 changes: 73 additions & 0 deletions
73
..._sqlserver/data_stream/performance/_dev/test/pipeline/test-performance.json-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"expected": [ | ||
{ | ||
"@timestamp": "2024-12-30T10:34:25.697Z", | ||
"agent": { | ||
"ephemeral_id": "70a3cef1-ba97-481f-95df-7c36355408c6", | ||
"id": "90dfcb72-653c-4ce1-b473-98969e1f308c", | ||
"name": "localhost", | ||
"type": "metricbeat", | ||
"version": "8.13.0" | ||
}, | ||
"ecs": { | ||
"version": "8.11.0" | ||
}, | ||
"host": { | ||
"name": "localhost" | ||
}, | ||
"metricset": { | ||
"name": "query", | ||
"period": 10000 | ||
}, | ||
"mssql": { | ||
"metrics": { | ||
"active_temp_tables": 0, | ||
"batch_requests_per_sec": 455338, | ||
"buffer_cache_hit_ratio": 74, | ||
"buffer_checkpoint_pages_per_sec": 516, | ||
"buffer_database_pages": 2940, | ||
"buffer_page_life_expectancy": 529720, | ||
"buffer_target_pages": 1196032, | ||
"compilations_per_sec": 115026, | ||
"connection_reset_per_sec": 274901, | ||
"instance_name": "MSSQLSERVER", | ||
"lock_waits_per_sec": 2, | ||
"logins_per_sec": 71270, | ||
"logouts_per_sec": 71268, | ||
"page_splits_per_sec": 1192, | ||
"re_compilations_per_sec": 400, | ||
"server_name": "f8ca37b1f01d", | ||
"transactions": 0, | ||
"user_connections": 2 | ||
}, | ||
"query": [ | ||
"SELECT @@servername AS server_name, @@servicename AS instance_name;", | ||
"SELECT cntr_value As 'active_temp_tables' FROM sys.dm_os_performance_counters WHERE counter_name = 'Active Temp Tables' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'batch_requests_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Batch Requests/sec'", | ||
"SELECT cntr_value As 'buffer_cache_hit_ratio' FROM sys.dm_os_performance_counters WHERE counter_name = 'Buffer cache hit ratio' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'buffer_checkpoint_pages_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Checkpoint pages/sec' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'buffer_database_pages' FROM sys.dm_os_performance_counters WHERE counter_name = 'Database pages' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'buffer_page_life_expectancy' FROM sys.dm_os_performance_counters WHERE counter_name = 'Page life expectancy' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'buffer_target_pages' FROM sys.dm_os_performance_counters WHERE counter_name = 'Target pages' AND object_name like '%Buffer Manager%'", | ||
"SELECT cntr_value As 'compilations_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'SQL Compilations/sec'", | ||
"SELECT cntr_value As 'connection_reset_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Connection Reset/sec' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'lock_waits_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Lock Waits/sec' AND instance_name = '_Total'", | ||
"SELECT cntr_value As 'logins_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Logins/sec' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'logouts_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Logouts/sec' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'page_splits_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'Page splits/sec'", | ||
"SELECT cntr_value As 're_compilations_per_sec' FROM sys.dm_os_performance_counters WHERE counter_name = 'SQL Re-Compilations/sec'", | ||
"SELECT cntr_value As 'transactions' FROM sys.dm_os_performance_counters WHERE counter_name = 'Transactions' AND object_name like '%General Statistics%'", | ||
"SELECT cntr_value As 'user_connections' FROM sys.dm_os_performance_counters WHERE counter_name= 'User Connections'", | ||
"SELECT counter_name, cntr_value FROM sys.dm_os_performance_counters WHERE counter_name like 'Memory Grants Pend%'" | ||
] | ||
}, | ||
"service": { | ||
"address": "localhost:32782", | ||
"type": "sql" | ||
}, | ||
"tags": [ | ||
"preserve_sql_queries" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ vars: | |
- "{{Hostname}}" | ||
username: sa | ||
password: 1234_asdf | ||
data_stream: | ||
vars: | ||
preserve_sql_queries: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.