Skip to content

Commit

Permalink
Add stats metricset to Kibana module (#6746)
Browse files Browse the repository at this point in the history
This is based on the existing `status` module, which will be deprecated in Kibana once `stats` becomes established. The stats endpoint will be available in Kibana 6.4 and newer.
  • Loading branch information
tsullivan authored and jsoriano committed May 25, 2018
1 parent 0bfb541 commit 8fa913c
Show file tree
Hide file tree
Showing 16 changed files with 803 additions and 31 deletions.
264 changes: 264 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6418,6 +6418,270 @@ Kibana module
[float]
== stats fields
Kibana stats and run-time metrics.
*`kibana.stats.cluster_uuid`*::
+
--
type: keyword
UUID of the Elasticsearch cluster to which Kibana connects.
--
*`kibana.stats.name`*::
+
--
type: keyword
Kibana instance name.
--
*`kibana.stats.uuid`*::
+
--
type: keyword
Kibana instance uuid.
--
*`kibana.stats.version.number`*::
+
--
type: keyword
Kibana version number.
--
*`kibana.stats.status.overall.state`*::
+
--
type: keyword
Kibana overall state.
--
[float]
== process fields
Kibana process metrics.
[float]
== mem fields
Memory usage metrics of the Kibana instance.
*`kibana.stats.process.mem.heap.max.bytes`*::
+
--
type: long
format: bytes
Total amount of heap memory used by V8.
--
*`kibana.stats.process.mem.heap.used.bytes`*::
+
--
type: long
format: bytes
Amount of memory in use by V8.
--
*`kibana.stats.process.mem.resident_set_size.bytes`*::
+
--
type: long
format: bytes
The amount of space occupied in main memory for the process. Includes heap, code segment, and stack.
--
*`kibana.stats.process.mem.external.bytes`*::
+
--
type: long
format: bytes
Memory usage of C++ objects bound to JavaScript objects managed by V8.
--
*`kibana.stats.process.pid`*::
+
--
type: long
Process ID of the Kibana instance.
--
*`kibana.stats.process.uptime.ms`*::
+
--
type: long
Amount of time that the Kibana process has been running in milliseconds.
--
[float]
== response_times fields
HTTP Server response time metrics
*`kibana.stats.response_times.avg.ms`*::
+
--
type: long
Accumulated averages for response times, for all responses in a 5-second time window.
--
*`kibana.stats.response_times.max.ms`*::
+
--
type: long
Accumulated maximums for response times, for all responses in a 5-second time window.
--
[float]
== requests fields
HTTP Server request metrics
*`kibana.stats.requests.status_codes`*::
+
--
type: object
Key-value pairs for each status code sent by the server, and the number of times it sent that code.
--
*`kibana.stats.requests.total`*::
+
--
type: long
Total number of requests sent by the server.
--
*`kibana.stats.requests.disconnects`*::
+
--
type: long
Total number of client disconnects encountered by the server.
--
*`kibana.stats.concurrent_connections`*::
+
--
type: long
Number of client connections made to the server. Note that browsers can send multiple simultaneous connections to request mulitple server assets at once, and they can re-use established connections.
--
[float]
== sockets fields
HTTP Web Sockets metrics
[float]
== http fields
Web Sockets over plaintext HTTP
*`kibana.stats.sockets.http.total`*::
+
--
type: long
Number of HTTP web socket connections established
--
[float]
== https fields
Web Sockets over encrypted HTTPS
*`kibana.stats.sockets.https.total`*::
+
--
type: long
Number of HTTPS web socket connections established
--
*`kibana.stats.event_loop_delay`*::
+
--
type: long
Node event loop delay calculated with internal benchmarking.
--
[float]
== status fields
Expand Down
4 changes: 4 additions & 0 deletions metricbeat/docs/modules/kibana.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ This module supports TLS connection when using `ssl` config field, as described

The following metricsets are available:

* <<metricbeat-metricset-kibana-stats,stats>>

* <<metricbeat-metricset-kibana-status,status>>

include::kibana/stats.asciidoc[]

include::kibana/status.asciidoc[]

23 changes: 23 additions & 0 deletions metricbeat/docs/modules/kibana/stats.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-kibana-stats]]
=== Kibana stats metricset

beta[]

include::../../../module/kibana/stats/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-kibana,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/kibana/stats/_meta/data.json[]
----
3 changes: 2 additions & 1 deletion metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ This file is generated! See scripts/docs_collector.py
.2+| .2+| |<<metricbeat-metricset-kafka-consumergroup,consumergroup>> beta[]
|<<metricbeat-metricset-kafka-partition,partition>> beta[]
|<<metricbeat-module-kibana,Kibana>> beta[] |image:./images/icon-no.png[No prebuilt dashboards] |
.1+| .1+| |<<metricbeat-metricset-kibana-status,status>> beta[]
.2+| .2+| |<<metricbeat-metricset-kibana-stats,stats>> beta[]
|<<metricbeat-metricset-kibana-status,status>> beta[]
|<<metricbeat-module-kubernetes,Kubernetes>> |image:./images/icon-yes.png[Prebuilt dashboards are available] |
.12+| .12+| |<<metricbeat-metricset-kubernetes-container,container>>
|<<metricbeat-metricset-kubernetes-event,event>> beta[]
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/include/fields.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions metricbeat/include/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import (
_ "github.com/elastic/beats/metricbeat/module/kafka/consumergroup"
_ "github.com/elastic/beats/metricbeat/module/kafka/partition"
_ "github.com/elastic/beats/metricbeat/module/kibana"
_ "github.com/elastic/beats/metricbeat/module/kibana/stats"
_ "github.com/elastic/beats/metricbeat/module/kibana/status"
_ "github.com/elastic/beats/metricbeat/module/kubernetes"
_ "github.com/elastic/beats/metricbeat/module/kubernetes/apiserver"
Expand Down
35 changes: 35 additions & 0 deletions metricbeat/module/kibana/mtest/testing.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package mtest

import (
"net"
"os"
)

// GetEnvHost returns host for Kibana
func GetEnvHost() string {
host := os.Getenv("KIBANA_HOST")

if len(host) == 0 {
host = "127.0.0.1"
}
return host
}

// GetEnvPort returns port for Kibana
func GetEnvPort() string {
port := os.Getenv("KIBANA_PORT")

if len(port) == 0 {
port = "5601"
}
return port
}

// GetConfig returns config for kibana module
func GetConfig(metricset string) map[string]interface{} {
return map[string]interface{}{
"module": "kibana",
"metricsets": []string{metricset},
"hosts": []string{net.JoinHostPort(GetEnvHost(), GetEnvPort())},
}
}
Loading

0 comments on commit 8fa913c

Please sign in to comment.