-
Notifications
You must be signed in to change notification settings - Fork 515
[Microsoft Sqlserver] - Ingest instance and server name & query optimisation #4698
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
Merged
muthu-mps
merged 12 commits into
elastic:main
from
muthu-mps:transaction_log_db_instance_name
Dec 14, 2022
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8c5601f
capturing instance name
muthu-mps b76c602
resolving conflicts
muthu-mps da61d6f
resolving conflicts
muthu-mps 528e160
resolving conflicts
muthu-mps b18af68
system test update
muthu-mps 200b04a
updated readme file
muthu-mps fe8b41a
changelog updated and small typo fix
muthu-mps 7d0d837
condition check update
muthu-mps 94c5558
updated new sample event
muthu-mps f71a0f6
Merge branch 'main' into transaction_log_db_instance_name
muthu-mps d83e619
Merge branch 'main' into transaction_log_db_instance_name
muthu-mps 439016e
Updated README.md
muthu-mps File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ merge_results: true | |
| dynamic_counter_name: "{{dynamic_counter_name}}" | ||
| driver: "mssql" | ||
| sql_queries: | ||
| - query: "SELECT @@servername AS server_name, @@servicename AS instance_name;" | ||
|
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. Can we add a section to the documentation, how the server_name and instance_name populated with an example? |
||
| response_format: table | ||
| - query: "SELECT cntr_value As 'user_connections' FROM sys.dm_os_performance_counters WHERE counter_name= 'User Connections'" | ||
| response_format: table | ||
| - query: "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%'" | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
108 changes: 74 additions & 34 deletions
108
packages/microsoft_sqlserver/data_stream/transaction_log/sample_event.json
This file contains hidden or 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 |
|---|---|---|
| @@ -1,47 +1,87 @@ | ||
| { | ||
| "@timestamp": "2022-06-08T10:20:14.787809Z", | ||
| "mssql": { | ||
| "metrics": { | ||
| "database_name": "msdb", | ||
| "database_id": 1, | ||
| "used_log_space_bytes": 41.17647171020508, | ||
muthu-mps marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "log_space_in_bytes_since_last_backup": 397312, | ||
| "total_log_size_bytes": 2088960, | ||
| "used_log_space_pct": 860160 | ||
| } | ||
| }, | ||
| "metricset": { | ||
| "period": 10000, | ||
| "name": "query" | ||
| }, | ||
| "@timestamp": "2022-11-23T10:53:05.080Z", | ||
| "agent": { | ||
| "id": "e7b17c22-4223-46c3-b982-ff0d570b5fa6", | ||
| "ephemeral_id": "d1a76cf4-2463-478a-a474-36e771218467", | ||
| "ephemeral_id": "70f5c0c1-37b1-486b-9806-8105b2cdcd20", | ||
| "id": "6d444a4a-2158-445e-8953-dc6eef720a34", | ||
| "name": "docker-fleet-agent", | ||
| "type": "metricbeat", | ||
| "version": "8.3.0" | ||
| "version": "8.5.0" | ||
| }, | ||
| "service": { | ||
| "address": "54.90.251.237:1433", | ||
| "type": "sql" | ||
| "cloud": { | ||
| "account": {}, | ||
| "instance": { | ||
| "id": "b30e45e6-7900-4900-8d67-e37cb13374bc", | ||
| "name": "obs-int-windows-dev" | ||
| }, | ||
| "machine": { | ||
| "type": "Standard_D16ds_v5" | ||
| }, | ||
| "provider": "azure", | ||
| "region": "CentralIndia", | ||
| "service": { | ||
| "name": "Virtual Machines" | ||
| } | ||
| }, | ||
| "data_stream": { | ||
| "dataset": "microsoft_sqlserver.transaction_log", | ||
| "namespace": "ep", | ||
| "type": "metrics" | ||
| }, | ||
| "ecs": { | ||
| "version": "8.0.0" | ||
| }, | ||
| "elastic_agent": { | ||
| "id": "e7b17c22-4223-46c3-b982-ff0d570b5fa6", | ||
| "version": "8.3.0", | ||
| "snapshot": true | ||
| "id": "6d444a4a-2158-445e-8953-dc6eef720a34", | ||
| "snapshot": false, | ||
| "version": "8.5.0" | ||
| }, | ||
| "event": { | ||
| "duration": 5595352584, | ||
| "agent_id_status": "verified", | ||
| "ingested": "2022-05-23T10:20:21Z", | ||
| "module": "sql", | ||
| "dataset": "microsoft_sqlserver.transaction_log" | ||
| "dataset": "microsoft_sqlserver.transaction_log", | ||
| "duration": 1449739900, | ||
| "ingested": "2022-11-23T10:53:07Z", | ||
| "module": "sql" | ||
| }, | ||
| "data_stream": { | ||
| "namespace": "default", | ||
| "type": "metrics", | ||
| "dataset": "microsoft_sqlserver.transaction_log" | ||
| "host": { | ||
| "architecture": "x86_64", | ||
| "containerized": false, | ||
| "hostname": "docker-fleet-agent", | ||
| "id": "66392b0697b84641af8006d87aeb89f1", | ||
| "ip": [ | ||
| "172.18.0.5" | ||
| ], | ||
| "mac": [ | ||
| "02-42-AC-12-00-05" | ||
| ], | ||
| "name": "docker-fleet-agent", | ||
| "os": { | ||
| "codename": "focal", | ||
| "family": "debian", | ||
| "kernel": "5.10.104-linuxkit", | ||
| "name": "Ubuntu", | ||
| "platform": "ubuntu", | ||
| "type": "linux", | ||
| "version": "20.04.5 LTS (Focal Fossa)" | ||
| } | ||
| }, | ||
| "ecs": { | ||
| "version": "8.0.0" | ||
| "metricset": { | ||
| "name": "query", | ||
| "period": 60000 | ||
| }, | ||
| "mssql": { | ||
| "metrics": { | ||
| "database_id": 1, | ||
| "database_name": "master", | ||
| "instance_name": "MSSQLSERVER", | ||
| "log_space_in_bytes_since_last_backup": 139264, | ||
| "server_name": "obs-service-int", | ||
| "total_log_size_bytes": 2088960, | ||
| "used_log_space_bytes": 626688, | ||
| "used_log_space_pct": 30 | ||
| } | ||
| }, | ||
| "service": { | ||
| "address": "20.121.218.233", | ||
| "type": "sql" | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.