-
Notifications
You must be signed in to change notification settings - Fork 599
[microsoft_sqlserver] Add transaction log DataStream #3395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
6c544cf
1519e1d
b3fa097
669063c
9d4439e
bde0d4d
5936aef
655a0aa
e8112f8
4367a9c
5f39acc
d643da6
8106660
a232927
94ed940
58b0be2
9002a79
fb4ae99
d8b90b2
f6a273a
1eb3f47
ad28113
e6dea96
41dad43
adc5335
a8e67b5
573f755
1159a60
2f5d7f6
271b171
f338a30
d44010c
1ca96a3
9e9079b
2489810
ab33d10
3ebbdff
e9436dd
357e6b4
3f9a2a4
4717288
7716acc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| metricsets: ["query"] | ||
| hosts: | ||
| - sqlserver://{{username}}:{{password}}@{{hosts}}:{{port}} | ||
| period: {{period}} | ||
| driver: mssql | ||
| raw_data.enabled: true | ||
| # Collect the transaction logs from the system database | ||
| sql_queries: | ||
| - query: "SELECT name As 'database_name', database_id FROM sys.databases WHERE database_id=1;" | ||
| response_format: table | ||
| - query: "SELECT 'master' As database_name, database_id,total_log_size_mb,active_log_size_mb,log_backup_time,log_since_last_log_backup_mb,log_since_last_checkpoint_mb,log_recovery_size_mb FROM sys.dm_db_log_stats(1) master" | ||
| response_format: table | ||
| - query: "SELECT *, 'master' As 'database_name' FROM sys.dm_db_log_space_usage master" | ||
| response_format: table | ||
| - query: "SELECT name As 'database_name', database_id FROM sys.databases WHERE database_id=2;" | ||
| response_format: table | ||
| - query: "SELECT database_id,'tempdb' As 'database_name',total_log_size_mb,active_log_size_mb,log_backup_time,log_since_last_log_backup_mb,log_since_last_checkpoint_mb,log_recovery_size_mb FROM sys.dm_db_log_stats(2) tempdb" | ||
| response_format: table | ||
| - query: "SELECT *, 'tempdb' As 'database_name' FROM sys.dm_db_log_space_usage tempdb" | ||
| response_format: table | ||
| - query: "SELECT name As 'database_name', database_id FROM sys.databases WHERE database_id=3;" | ||
| response_format: table | ||
| - query: "SELECT 'model' As 'database_name',database_id,total_log_size_mb,active_log_size_mb,log_backup_time,log_since_last_log_backup_mb,log_since_last_checkpoint_mb,log_recovery_size_mb FROM sys.dm_db_log_stats(3) model" | ||
| response_format: table | ||
| - query: "SELECT *, 'model' As 'database_name' FROM sys.dm_db_log_space_usage model" | ||
| response_format: table | ||
| - query: "SELECT name As 'database_name', database_id FROM sys.databases WHERE database_id=4;" | ||
| response_format: table | ||
| - query: "SELECT 'msdb' As 'database_name',database_id,total_log_size_mb,active_log_size_mb,log_backup_time,log_since_last_log_backup_mb,log_since_last_checkpoint_mb,log_recovery_size_mb FROM sys.dm_db_log_stats(4) msdb" | ||
| response_format: table | ||
| - query: "SELECT *, 'msdb' As 'database_name' FROM sys.dm_db_log_space_usage model" | ||
| response_format: table | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| - name: data_stream.type | ||
| type: constant_keyword | ||
| description: Data stream type. | ||
| - name: data_stream.dataset | ||
| type: constant_keyword | ||
| description: Data stream dataset. | ||
| - name: data_stream.namespace | ||
| type: constant_keyword | ||
| description: Data stream namespace. | ||
| - name: '@timestamp' | ||
| type: date | ||
| description: Event timestamp. | ||
|
muthu-mps marked this conversation as resolved.
Outdated
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| - name: sql | ||
|
muthu-mps marked this conversation as resolved.
Outdated
|
||
| type: group | ||
| release: experimental | ||
| fields: | ||
| - name: driver | ||
|
muthu-mps marked this conversation as resolved.
Outdated
|
||
| type: keyword | ||
| description: Driver used to execute the query. | ||
| - name: query | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to index the query? Should we set it to
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We dont need to index the query, will set as false.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, do we need the query at all in the final document? This is an implementation detail of the integration, I think that it could be removed. But, if we are storing metrics coming from different queries in different documents we may need some dimension to distinguish between queries. So we may need to index the query to use it as dimension, or find some other field that could cover this. We can also wait to have some way to join events (elastic/beats#31806 (comment)), then
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done. |
||
| type: keyword | ||
| description: Query executed to collect metrics. | ||
| - name: metrics.database_id | ||
| type: long | ||
| description: Unique ID of the database inside MSSQL. | ||
| - name: metrics.database_name | ||
|
muthu-mps marked this conversation as resolved.
Outdated
|
||
| type: keyword | ||
| description: Name of the database. | ||
| - name: metrics.log_since_last_checkpoint_mb | ||
| type: long | ||
| description: Log size in bytes since last checkpoint log sequence number (LSN). | ||
| - name: metrics.log_recovery_size_mb | ||
| type: long | ||
| description: Log size in bytes since log recovery log sequence number (LSN). | ||
| - name: metrics.total_log_size_mb | ||
| type: long | ||
| description: Total log size. | ||
| - name: metrics.log_backup_time | ||
| type: date | ||
|
muthu-mps marked this conversation as resolved.
Outdated
|
||
| description: Last transaction log backup time. | ||
| - name: metrics.active_log_size_mb | ||
| type: long | ||
| description: Total active transaction log size in bytes. | ||
| - name: metrics.log_since_last_log_backup_mb | ||
| type: long | ||
| description: Log file size since last backup | ||
| - name: metrics.used_log_space_in_percent | ||
| type: float | ||
| description: A percentage of the occupied size of the log as a percent of the total log size. | ||
| - name: metrics.used_log_space_in_bytes | ||
| type: long | ||
| description: The occupied size of the log in bytes. | ||
| - name: metrics.log_space_in_bytes_since_last_backup | ||
| type: long | ||
| description: The amount of space used since the last log backup in bytes. | ||
| - name: metrics.total_log_size_in_bytes | ||
| type: long | ||
| description: Total transaction log size in bytes. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| type: metrics | ||
| title: Microsoft SqlServer transaction_log metrics | ||
| release: experimental | ||
| streams: | ||
| - input: sql/metrics | ||
| vars: | ||
| - name: period | ||
| type: text | ||
| title: Period | ||
| multi: false | ||
| required: true | ||
| show_user: true | ||
| default: 10s | ||
| title: Microsoft SqlServer transaction_log metrics | ||
| description: Collect Microsoft SqlServer transaction_log metrics |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,208 @@ | ||
| { | ||
| "attributes": { | ||
| "description": "An overview of the transaction log of each database in a Microsoft SqlServer instance", | ||
| "hits": 0, | ||
| "kibanaSavedObjectMeta": { | ||
| "searchSourceJSON": { | ||
| "filter": [], | ||
| "query": { | ||
| "language": "kuery", | ||
| "query": "" | ||
| } | ||
| } | ||
| }, | ||
| "optionsJSON": { | ||
| "darkTheme": false, | ||
| "hidePanelTitles": false, | ||
| "useMargins": true | ||
| }, | ||
| "panelsJSON": [ | ||
| { | ||
| "embeddableConfig": { | ||
| "enhancements": {}, | ||
| "hidePanelTitles": false | ||
| }, | ||
| "gridData": { | ||
| "h": 12, | ||
| "i": "1", | ||
| "w": 24, | ||
| "x": 0, | ||
| "y": 12 | ||
| }, | ||
| "panelIndex": "1", | ||
| "panelRefName": "panel_1", | ||
| "type": "visualization", | ||
| "version": "8.3.0-SNAPSHOT" | ||
| }, | ||
| { | ||
| "embeddableConfig": { | ||
| "enhancements": {}, | ||
| "hidePanelTitles": false | ||
| }, | ||
| "gridData": { | ||
| "h": 13, | ||
| "i": "2", | ||
| "w": 24, | ||
| "x": 24, | ||
| "y": 24 | ||
| }, | ||
| "panelIndex": "2", | ||
| "panelRefName": "panel_2", | ||
| "type": "visualization", | ||
| "version": "8.3.0-SNAPSHOT" | ||
| }, | ||
| { | ||
| "embeddableConfig": { | ||
| "enhancements": {}, | ||
| "hidePanelTitles": false | ||
| }, | ||
| "gridData": { | ||
| "h": 12, | ||
| "i": "3", | ||
| "w": 18, | ||
| "x": 30, | ||
| "y": 0 | ||
| }, | ||
| "panelIndex": "3", | ||
| "panelRefName": "panel_3", | ||
| "type": "visualization", | ||
| "version": "8.3.0-SNAPSHOT" | ||
| }, | ||
| { | ||
| "embeddableConfig": { | ||
| "enhancements": {}, | ||
| "hidePanelTitles": false | ||
| }, | ||
| "gridData": { | ||
| "h": 13, | ||
| "i": "4", | ||
| "w": 24, | ||
| "x": 0, | ||
| "y": 37 | ||
| }, | ||
| "panelIndex": "4", | ||
| "panelRefName": "panel_4", | ||
| "type": "visualization", | ||
| "version": "8.3.0-SNAPSHOT" | ||
| }, | ||
| { | ||
| "embeddableConfig": { | ||
| "enhancements": {}, | ||
| "hidePanelTitles": false | ||
| }, | ||
| "gridData": { | ||
| "h": 13, | ||
| "i": "5", | ||
| "w": 24, | ||
| "x": 0, | ||
| "y": 24 | ||
| }, | ||
| "panelIndex": "5", | ||
| "panelRefName": "panel_5", | ||
| "type": "visualization", | ||
| "version": "8.3.0-SNAPSHOT" | ||
| }, | ||
| { | ||
| "embeddableConfig": { | ||
| "enhancements": {}, | ||
| "hidePanelTitles": false | ||
| }, | ||
| "gridData": { | ||
| "h": 12, | ||
| "i": "6", | ||
| "w": 24, | ||
| "x": 24, | ||
| "y": 12 | ||
| }, | ||
| "panelIndex": "6", | ||
| "panelRefName": "panel_6", | ||
| "type": "visualization", | ||
| "version": "8.3.0-SNAPSHOT" | ||
| }, | ||
| { | ||
| "embeddableConfig": { | ||
| "enhancements": {}, | ||
| "hidePanelTitles": false | ||
| }, | ||
| "gridData": { | ||
| "h": 12, | ||
| "i": "7", | ||
| "w": 18, | ||
| "x": 12, | ||
| "y": 0 | ||
| }, | ||
| "panelIndex": "7", | ||
| "panelRefName": "panel_7", | ||
| "type": "visualization", | ||
| "version": "8.3.0-SNAPSHOT" | ||
| }, | ||
| { | ||
| "embeddableConfig": { | ||
| "enhancements": {} | ||
| }, | ||
| "gridData": { | ||
| "h": 12, | ||
| "i": "8", | ||
| "w": 12, | ||
| "x": 0, | ||
| "y": 0 | ||
| }, | ||
| "panelIndex": "8", | ||
| "panelRefName": "panel_8", | ||
| "type": "visualization", | ||
| "version": "8.3.0-SNAPSHOT" | ||
| } | ||
| ], | ||
| "timeRestore": false, | ||
| "title": "[Metrics Microsoft SqlServer] Transaction log", | ||
| "version": 1 | ||
| }, | ||
| "coreMigrationVersion": "8.3.0", | ||
| "id": "microsoft_sqlserver-18d66970-1fb4-11e9-8a4d-eb34d2834f6b", | ||
| "migrationVersion": { | ||
| "dashboard": "8.3.0" | ||
| }, | ||
| "references": [ | ||
| { | ||
| "id": "microsoft_sqlserver-e9654a40-1fb2-11e9-8a4d-eb34d2834f6b", | ||
| "name": "1:panel_1", | ||
| "type": "visualization" | ||
| }, | ||
| { | ||
| "id": "microsoft_sqlserver-1757d530-1fb3-11e9-8a4d-eb34d2834f6b", | ||
| "name": "2:panel_2", | ||
| "type": "visualization" | ||
| }, | ||
| { | ||
| "id": "microsoft_sqlserver-a55bb000-1fb2-11e9-8a4d-eb34d2834f6b", | ||
| "name": "3:panel_3", | ||
| "type": "visualization" | ||
| }, | ||
| { | ||
| "id": "microsoft_sqlserver-edb7a0c0-1f2b-11e9-8a4d-eb34d2834f6b", | ||
| "name": "4:panel_4", | ||
| "type": "visualization" | ||
| }, | ||
| { | ||
| "id": "microsoft_sqlserver-c9ead180-1fb2-11e9-8a4d-eb34d2834f6b", | ||
| "name": "5:panel_5", | ||
| "type": "visualization" | ||
| }, | ||
| { | ||
| "id": "microsoft_sqlserver-68fa61b0-1fb2-11e9-8a4d-eb34d2834f6b", | ||
| "name": "6:panel_6", | ||
| "type": "visualization" | ||
| }, | ||
| { | ||
| "id": "microsoft_sqlserver-6710ff20-1f2c-11e9-8a4d-eb34d2834f6b", | ||
| "name": "7:panel_7", | ||
| "type": "visualization" | ||
| }, | ||
| { | ||
| "id": "microsoft_sqlserver-82bf9480-260b-11e9-a46a-471d2a76b305", | ||
| "name": "8:panel_8", | ||
| "type": "visualization" | ||
| } | ||
| ], | ||
| "type": "dashboard" | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.