Skip to content

Commit

Permalink
Merge pull request #1155 from ruflin/mb-mysql
Browse files Browse the repository at this point in the history
Enhance MySQL implementation
  • Loading branch information
andrewkroh committed Mar 15, 2016
2 parents 45423de + e5b256f commit 10d77bf
Show file tree
Hide file tree
Showing 13 changed files with 370 additions and 49 deletions.
105 changes: 100 additions & 5 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,53 @@ This file is generated! See etc/fields.yml and scripts/generate_field_docs.py
This document describes the fields that are exported by Metricbeat. They are
grouped in the following categories:

* <<exported-fields-common>>
* <<exported-fields-redis-info>>
* <<exported-fields-mysql-status>>

[[exported-fields-common]]
=== Common fields Fields

Contains common fields available in all event types.



==== beat.name

The name of the Beat sending the log messages. If the shipper name is set in the configuration file, then that value is used. If it is not set, the hostname is used.


==== beat.hostname

The hostname as returned by the operating system on which the Beat is running.


==== @timestamp

type: date

example: 2015-01-24 14:06:05.071000

format: YYYY-MM-DDTHH:MM:SS.milliZ

required: True

The timestamp when the log line was read. The precision is in milliseconds. The timezone is UTC.


==== response_time

type: long

required: True

Event Reponse time in nano seconds


[[exported-fields-redis-info]]
=== Redis Info Stats Fields

Redis info Stats
Redis Stats



Expand All @@ -33,28 +74,28 @@ Redis client stats

==== redis-info.clients.connected_clients

type: int
type: integer

Number of client connections (excluding connections from slaves)


==== redis-info.clients.client_longest_output_list

type: int
type: integer

Longest output list among current client connections.


==== redis-info.clients.client_biggest_input_buf

type: int
type: integer

Biggest input buffer among current client connections


==== redis-info.clients.blocked_clients

type: int
type: integer

Number of clients pending on a blocking call (BLPOP, BRPOP, BRPOPLPUSH)

Expand Down Expand Up @@ -106,3 +147,57 @@ type: float
User CPU consumed by the background processes


[[exported-fields-mysql-status]]
=== MySQL Status Fields

MySQL Stats



[[exported-fields-mysql-status]]
=== MySQL Status Fields

MySQL Status



=== aborted Fields

Aborted status fields



==== mysql-status.aborted.Aborted_clients

type: integer

The number of connections that were aborted because the client died without closing the connection properly.


==== mysql-status.aborted.Aborted_connects

type: integer

The number of failed attempts to connect to the MySQL server.


=== bytes Fields

Bytes stats



==== mysql-status.bytes.Bytes_received

type: integer

The number of bytes received from all clients.


==== mysql-status.bytes.Bytes_sent

type: integer

The number of bytes sent to all clients.


82 changes: 77 additions & 5 deletions metricbeat/etc/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,83 @@ defaults:
ignore_above: 1024

sections:
- ["common", "Common fields"]
- ["redis-info", "Redis Info Stats"]
- ["mysql-status", "MySQL Status"]

common:
type: group
description: >
Contains common fields available in all event types.
fields:
- name: beat.name
description: >
The name of the Beat sending the log messages. If the shipper name is set
in the configuration file, then that value is used. If it is not set,
the hostname is used.
- name: beat.hostname
description: >
The hostname as returned by the operating system on which the Beat is
running.
- name: "@timestamp"
type: date
required: true
format: YYYY-MM-DDTHH:MM:SS.milliZ
example: 2015-01-24T14:06:05.071Z
description: >
The timestamp when the log line was read. The precision is in
milliseconds. The timezone is UTC.
- name: response_time
type: long
required: true
description: >
Event Reponse time in nano seconds
mysql-status:
type: group
description: >
MySQL Stats
fields:
- name: mysql-status
type: group
description: >
MySQL Status
fields:
- name: aborted
type: group
description: >
Aborted status fields
fields:
- name: Aborted_clients
type: integer
description: >
The number of connections that were aborted because the client died without closing the connection properly.
- name: Aborted_connects
type: integer
description: >
The number of failed attempts to connect to the MySQL server.
- name: bytes
type: group
description: >
Bytes stats
fields:
- name: Bytes_received
type: integer
description: >
The number of bytes received from all clients.
- name: Bytes_sent
type: integer
description: >
The number of bytes sent to all clients.
redis-info:
type: group
description: >
Redis info Stats
Redis Stats
fields:
- name: redis-info
type: group
Expand All @@ -25,22 +97,22 @@ redis-info:
Redis client stats
fields:
- name: connected_clients
type: int
type: integer
description: >
Number of client connections (excluding connections from slaves)
- name: client_longest_output_list
type: int
type: integer
description: >
Longest output list among current client connections.
- name: client_biggest_input_buf
type: int
type: integer
description: >
Biggest input buffer among current client connections
- name: blocked_clients
type: int
type: integer
description: >
Number of clients pending on a blocking call (BLPOP, BRPOP, BRPOPLPUSH)
Expand Down
33 changes: 33 additions & 0 deletions metricbeat/etc/fields_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,37 @@ defaults:
ignore_above: 1024

sections:
- ["common", "Common fields"]
- ["redis-info", "Redis Info Stats"]
- ["mysql-status", "MySQL Status"]

common:
type: group
description: >
Contains common fields available in all event types.
fields:
- name: beat.name
description: >
The name of the Beat sending the log messages. If the shipper name is set
in the configuration file, then that value is used. If it is not set,
the hostname is used.
- name: beat.hostname
description: >
The hostname as returned by the operating system on which the Beat is
running.
- name: "@timestamp"
type: date
required: true
format: YYYY-MM-DDTHH:MM:SS.milliZ
example: 2015-01-24T14:06:05.071Z
description: >
The timestamp when the log line was read. The precision is in
milliseconds. The timezone is UTC.
- name: response_time
type: long
required: true
description: >
Event Reponse time in nano seconds
13 changes: 13 additions & 0 deletions metricbeat/etc/kibana/dashboard/metricbeat-mysql.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"hits": 0,
"timeRestore": false,
"description": "",
"title": "metricbeat-mysql",
"uiStateJSON": "{}",
"panelsJSON": "[{\"id\":\"metricbeat-mysql-open\",\"type\":\"visualization\",\"panelIndex\":1,\"size_x\":12,\"size_y\":3,\"col\":1,\"row\":1}]",
"optionsJSON": "{\"darkTheme\":false}",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[{\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}]}"
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"hits": 0,
"timeRestore": false,
"description": "",
"title": "redis",
"uiStateJSON": "{\"P-2\":{\"vis\":{\"legendOpen\":false}},\"P-1\":{\"vis\":{\"legendOpen\":false}}}",
"panelsJSON": "[{\"id\":\"connected_clients\",\"type\":\"visualization\",\"panelIndex\":1,\"size_x\":9,\"size_y\":2,\"col\":1,\"row\":1},{\"id\":\"connections-received\",\"type\":\"visualization\",\"panelIndex\":2,\"size_x\":9,\"size_y\":2,\"col\":1,\"row\":3}]",
"optionsJSON": "{\"darkTheme\":false}",
"version": 1,
"hits": 0,
"timeRestore": false,
"description": "",
"title": "metricbeat-redis",
"uiStateJSON": "{\"P-2\":{\"vis\":{\"legendOpen\":false}},\"P-1\":{\"vis\":{\"legendOpen\":false}}}",
"panelsJSON": "[{\"id\":\"connected_clients\",\"type\":\"visualization\",\"panelIndex\":1,\"size_x\":9,\"size_y\":2,\"col\":1,\"row\":1},{\"id\":\"connections-received\",\"type\":\"visualization\",\"panelIndex\":2,\"size_x\":9,\"size_y\":2,\"col\":1,\"row\":3}]",
"optionsJSON": "{\"darkTheme\":false}",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[{\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}]}"
}
}
}
10 changes: 10 additions & 0 deletions metricbeat/etc/kibana/visualization/metricbeat-mysql-open.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"visState": "{\"title\":\"New Visualization\",\"type\":\"line\",\"params\":{\"shareYAxis\":true,\"addTooltip\":true,\"addLegend\":true,\"showCircles\":true,\"smoothLines\":false,\"interpolate\":\"linear\",\"scale\":\"linear\",\"drawLinesBetweenPoints\":true,\"radiusRatio\":9,\"times\":[],\"addTimeMarker\":false,\"defaultYExtents\":false,\"setYExtents\":false,\"yAxis\":{}},\"aggs\":[{\"id\":\"1\",\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"mysql-status.open.Open_tables\"}},{\"id\":\"2\",\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"@timestamp\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}},{\"id\":\"3\",\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"mysql-status.open.Open_files\"}},{\"id\":\"4\",\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"mysql-status.open.Opened_tables\"}}],\"listeners\":{}}",
"description": "",
"title": "metricbeat-mysql-open",
"uiStateJSON": "{\"vis\":{\"colors\":{\"Max mysql-status.bytes.Bytes_received\":\"#F4D598\"}}}",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"metricbeat-*\",\"query\":{\"query_string\":{\"query\":\"module:\\\"mysql\\\"\",\"analyze_wildcard\":true}},\"filter\":[]}"
}
}
7 changes: 7 additions & 0 deletions metricbeat/etc/metricbeat.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
}
],
"properties": {
"@timestamp": {
"type": "date"
},
"redis-info": {
"properties": {
"cpu": {
Expand All @@ -44,6 +47,10 @@
}
}
}
},
"response_time": {
"doc_values": "true",
"type": "long"
}
}
}
Expand Down
Loading

0 comments on commit 10d77bf

Please sign in to comment.