Skip to content
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

transaction_log Metricset for MSSQL Module (also db metricset removal) #10109

Merged
merged 2 commits into from
Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Release http.server metricset as GA. {pull}10240[10240]
- Making RabbitMQ Metricbeat module GA. {pull}10165[10165]
- Release use of xpack.enabled: true flag in Elasticsearch and Kibana modules as GA. {pull}10222[10222]
- Rename 'db' Metricset to 'transaction_log' in MSSQL Metricbeat module {pull}10109[10109]

*Packetbeat*

Expand Down
210 changes: 147 additions & 63 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16613,84 +16613,27 @@ MS SQL module



[float]
== db fields

db metricset will fetch information about each db from a sql server


[float]
== database fields

Database where the metrics have been fetched from


*`mssql.db.database.id`*::
+
--
type: keyword

The database ID

--

[float]
== log_space_usage fields

Space usage information for the transaction log


[float]
== total fields

Total space usage
The database that the metrics is being referred to


*`mssql.db.log_space_usage.total.bytes`*::
*`mssql.database.id`*::
+
--
type: long

The size of the log
Unique ID of the database inside MSSQL

--

[float]
== used fields

The occupied size of the log


*`mssql.db.log_space_usage.used.bytes`*::
*`mssql.database.name`*::
+
--
type: long

The occupied size of the log in bytes

--

*`mssql.db.log_space_usage.used.pct`*::
+
--
type: float

A percentaje of the occupied size of the log as a percent of the total log size

--

[float]
== since_last_backup fields

The amount of space used since the last log backup


*`mssql.db.log_space_usage.since_last_backup.bytes`*::
+
--
type: long
type: keyword

The amount of space used since the last log backup in bytes
Name of the database

--

Expand Down Expand Up @@ -16857,6 +16800,147 @@ Ideal number of pages in the buffer pool.

--

[float]
== transaction_log fields

transaction_log metricset will fetch information about the operation and transaction log of each database from a MSSQL instance


[float]
== space_usage fields

Space usage information for the transaction log


[float]
== since_last_backup fields

The amount of space used since the last log backup


*`mssql.transaction_log.space_usage.since_last_backup.bytes`*::
+
--
type: long

The amount of space used since the last log backup in bytes

--

[float]
== total fields

The size of the log


*`mssql.transaction_log.space_usage.total.bytes`*::
+
--
type: long

The size of the log in bytes

--

[float]
== used fields

The occupied size of the log


*`mssql.transaction_log.space_usage.used.bytes`*::
+
--
type: long

The occupied size of the log in bytes

--

*`mssql.transaction_log.space_usage.used.pct`*::
+
--
type: float

A percentage of the occupied size of the log as a percent of the total log size

--

[float]
== stats fields

Returns summary level attributes and information on transaction log files of databases. Use this information for monitoring and diagnostics of transaction log health.


[float]
== active_size fields

Total active transaction log size.


*`mssql.transaction_log.stats.active_size.bytes`*::
+
--
type: long

Total active transaction log size in bytes

--

*`mssql.transaction_log.stats.backup_time`*::
+
--
type: date

Last transaction log backup time.

--

[float]
== recovery_size fields

Log size since log recovery log sequence number (LSN).


*`mssql.transaction_log.stats.recovery_size.bytes`*::
+
--
type: long

Log size in bytes since log recovery log sequence number (LSN).

--

[float]
== since_last_checkpoint fields

Log size since last checkpoint log sequence number (LSN).


*`mssql.transaction_log.stats.since_last_checkpoint.bytes`*::
+
--
type: long

Log size in bytes since last checkpoint log sequence number (LSN).

--

[float]
== total_size fields

Total transaction log size.


*`mssql.transaction_log.stats.total_size.bytes`*::
+
--
type: long

Total transaction log size in bytes.

--

[[exported-fields-munin]]
== Munin fields

Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/include/list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x-pack/metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ metricbeat.modules:
#-------------------------------- Mssql Module --------------------------------
- module: mssql
metricsets:
- "db"
- "transaction_log"
- "performance"
hosts: ["sqlserver://sa@localhost"]
period: 10s
Expand Down
2 changes: 1 addition & 1 deletion x-pack/metricbeat/module/mssql/_meta/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- module: mssql
metricsets:
- "db"
- "transaction_log"
- "performance"
hosts: ["sqlserver://sa@localhost"]
period: 10s
Expand Down
10 changes: 7 additions & 3 deletions x-pack/metricbeat/module/mssql/_meta/docs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ The module is being tested with https://hub.docker.com/r/microsoft/mssql-server-
[float]
== Metricsets

The following Metricset is already included:
The following Metricsets are already included:

=== `db`
=== `transaction_log`

`db` Metricset fetches a set of values from https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-db-log-space-usage-transact-sql?view=sql-server-2017[log space usage] which returns space usage information for the transaction log for each different database.
`transaction_log` Metricset fetches information about the operation and transaction log of each MSSQL database in the monitored instance. All data is extracted from the https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/database-related-dynamic-management-views-transact-sql?view=sql-server-2017[Database Dynamic Management Views]

=== `performance`

`performance` Metricset fetches information from what's commonly known as https://docs.microsoft.com/en-us/sql/relational-databases/system-dynamic-management-views/sys-dm-os-performance-counters-transact-sql?view=sql-server-2017[Performance Counters] in MSSQL.
10 changes: 10 additions & 0 deletions x-pack/metricbeat/module/mssql/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@
type: group
description: >
fields:
- name: database
type: group
description: The database that the metrics is being referred to
fields:
- name: id
type: long
description: Unique ID of the database inside MSSQL
- name: name
type: keyword
description: Name of the database
3 changes: 3 additions & 0 deletions x-pack/metricbeat/module/mssql/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ package mssql
import (
"database/sql"

// Register driver.
_ "github.com/denisenkom/go-mssqldb"

"github.com/pkg/errors"
)

Expand Down
38 changes: 0 additions & 38 deletions x-pack/metricbeat/module/mssql/db/_meta/data.json

This file was deleted.

1 change: 0 additions & 1 deletion x-pack/metricbeat/module/mssql/db/_meta/docs.asciidoc

This file was deleted.

39 changes: 0 additions & 39 deletions x-pack/metricbeat/module/mssql/db/_meta/fields.yml

This file was deleted.

Loading