Skip to content

Commit

Permalink
Add query count to metricbeat's mysql plugin output (#3251)
Browse files Browse the repository at this point in the history
* Add query count to metricbeat's mysql plugin output

* Add semicolon before newline

* Add event information to MySQL's fields.yml

* Update docs & metricbeat.templates

* Change field name from "com" to "command"
  • Loading branch information
st1t authored and tsg committed Jan 3, 2017
1 parent 72823f8 commit bbee3fe
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ https://github.com/elastic/beats/compare/v5.0.2...v5.1.1[View commits]
- Add support for MongoDB 3.4 and WiredTiger metrics. {pull}2999[2999]
- Add experimental kafka module with partition metricset. {pull}2969[2969]
- Add raw config option for mysql/status metricset. {pull}3001[3001]
- Add command fileds for mysql/status metricset. {pull}3251[3251]
*Filebeat*
Expand Down
34 changes: 34 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3463,6 +3463,40 @@ type: long
[float]
== command Fields
[float]
=== mysql.status.command.delete
type: long
[float]
=== mysql.status.command.insert
type: long
[float]
=== mysql.status.command.select
type: long
[float]
=== mysql.status.command.update
type: long
[[exported-fields-nginx]]
== Nginx Fields
Expand Down
16 changes: 16 additions & 0 deletions metricbeat/metricbeat.template-es2x.json
Original file line number Diff line number Diff line change
Expand Up @@ -1885,6 +1885,22 @@
}
}
},
"command": {
"properties": {
"delete": {
"type": "long"
},
"insert": {
"type": "long"
},
"select": {
"type": "long"
},
"update": {
"type": "long"
}
}
},
"connections": {
"type": "long"
},
Expand Down
16 changes: 16 additions & 0 deletions metricbeat/metricbeat.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,22 @@
}
}
},
"command": {
"properties": {
"delete": {
"type": "long"
},
"insert": {
"type": "long"
},
"select": {
"type": "long"
},
"update": {
"type": "long"
}
}
},
"connections": {
"type": "long"
},
Expand Down
6 changes: 6 additions & 0 deletions metricbeat/module/mysql/status/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
"received": 992,
"sent": 40657
},
"command": {
"delete": 0,
"insert": 0,
"select": 9,
"update": 0
},
"connections": 11,
"created": {
"tmp": {
Expand Down
20 changes: 20 additions & 0 deletions metricbeat/module/mysql/status/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,23 @@
- name: opened_tables
type: long
description: >
- name: command
type: group
description: >
fields:
- name: delete
type: long
description: >
- name: insert
type: long
description: >
- name: select
type: long
description: >
- name: update
type: long
description: >
6 changes: 6 additions & 0 deletions metricbeat/module/mysql/status/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ var (
"tables": c.Int("Open_tables"),
},
"opened_tables": c.Int("Opened_tables"),
"command": s.Object{
"delete": c.Int("Com_delete"),
"insert": c.Int("Com_insert"),
"select": c.Int("Com_select"),
"update": c.Int("Com_update"),
},
}
)

Expand Down

0 comments on commit bbee3fe

Please sign in to comment.